Web 部署项目无法映射包含虚拟的路径

发布于 2024-09-02 16:03:56 字数 660 浏览 2 评论 0原文

我正在使用 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

以往的大感动 2024-09-09 16:03:57

尽管 SSI 在框架中可用,但执行 include 的首选方法是将文件中的内容包装到 用户控件 (.ascx )按照 MSDN 文档 请参阅另外:support.microsoft.com/kb/306575

Although SSI's are available within the Framework, the preferred way of doing include is to wrap the content from the file into a User Control (.ascx) as per the MSDN documentation See also: support.microsoft.com/kb/306575

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文