Web 部署项目无法映射包含虚拟的路径
我正在使用 Web 部署项目构建我的网站,但构建失败并出现许多错误,所有错误都与我的母版页中的“#include virtual”指令有关。
导入一组集中管理的 html 模板文件需要包含这些内容。
以下是 include 指令和相关错误的示例:
<!-- #include virtual="/v3/sits/pdpdev/assets-templates/inc/head.html" -->
/PDPRegistration.csproj/Pages/ContentPage.Master(15):
error ASPPARSE: Failed to map the path
'/v3/sits/pdpdev/assets-templates/inc/head.html'.
每个包含文件的错误实际上会出现多次。我不确定正在映射什么或为什么,但这从来都不是问题,直到我开始使用 WDP(我想根据构建环境等更改 web.config)。
该项目是在我的本地构建的PC,然后通过映射驱动器复制到网络服务器。我在网上找到了一些涉及 IIS 元数据库的解决方案 - 它们对我来说不太清楚,而且我不确定它们是否适用于我构建和部署项目的方式(也就是说,我是否必须在与 IIS 相同的系统以便使用元数据库?)
任何人都可以建议我如何使用 WDP 构建我的项目吗?
I am building my site with a web deployment project but the build fails with a number of errors all relating to the "#include virtual" directives in my master page.
The includes are necessary to import a set of centrally managed html template files.
Here is an example of the include directive and associated error:
<!-- #include virtual="/v3/sits/pdpdev/assets-templates/inc/head.html" -->
/PDPRegistration.csproj/Pages/ContentPage.Master(15):
error ASPPARSE: Failed to map the path
'/v3/sits/pdpdev/assets-templates/inc/head.html'.
The error for each included file actually appears multiple times. I'm not sure what is being mapped or why, but this was never a problem until I started using WDP (which I wanted to alter web.config depending on the build environment, among other things.)
The project is built locally on my PC and then copied to the web server via a mapped drive. I found a few solutions on the 'net involving IIS metabase - they weren't quite clear to me, and I'm not sure if they apply given how I build and deploy the project (that is, would I have to build on the same system as IIS in order to make use of the metabase?)
Can anyone suggest how I can get my project to build with WDP?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尽管 SSI 在框架中可用,但执行
include
的首选方法是将文件中的内容包装到用户控件
(.ascx
)按照 MSDN 文档 请参阅另外:support.microsoft.com/kb/306575Although SSI's are available within the Framework, the preferred way of doing
include
is to wrap the content from the file into aUser Control
(.ascx
) as per the MSDN documentation See also: support.microsoft.com/kb/306575