我有一个包含 2 个项目(网站)的 Visual Studio 解决方案:
Solution
- Project A
- App_Start
- BundleConfig.cs
- Scripts
- Project B
- App_Start
- Scripts
- my_file.js
有没有办法包含来自
Project B
的文件在 Project A
,使用 bundle ?:public static void RegisterBundles(BundleCollection bundles)
{
bundles.Add(
new ScriptBundle("~/bundles/my_bundle")
// This obviously doesn't work
.Include("~/../Scripts/my_file.js")
// Neither does this
.Include("../../../Scripts/my_file.js")
);
}
最佳答案
您可以将来自项目 A 的文件添加到项目 B 中,方法是链接它们而不是复制它们,然后添加到您的包中。请记住,您可以将文件添加到您的项目中,仅供引用。
关于c# - 跨项目在包中包含文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21025969/