我想创建一个带有以下虚拟路径的样式包(插件框架):
"~/Areas/Domain.PluginTest.Wui/Bundles/PluginCss"
当我走到那条路时,我收到一条错误,指出该文件不存在。 静态文件处理程序正在尝试查找文件。如何通过捆绑来完成这项工作?
System.Web.HttpException
Message:
File does not exist.
Stack trace:
at System.Web.StaticFileHandler.GetFileInfo(String
virtualPathWithPathInfo, String physicalPath, HttpResponse response) at
System.Web.StaticFileHandler.ProcessRequestInternal(HttpContext context, String
overrideVirtualPath) at System.Web.DefaultHttpHandler.BeginProcessRequest(HttpContext
context, AsyncCallback callback, Object state) at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.
HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step,
Boolean& completedSynchronously)
答案 0 :(得分:0)
捆绑程序正在尝试查找不存在的路径~/Areas/Domain.PluginTest.Wui/Bundles/PluginCss
。这就是我们通常使用bundles
bundles.Add(new StyleBundle("~/bundles/Areas/Domain.PluginTest.Wui/Bundles/PluginCss")
.Include());