MSBuild _CopyWebApplication 不复制来自 vbproj
我们有一个 CMD 文件,它加载 MSBuild XML 文件并构建和发布我们的 VB .NET Web 应用程序。今天我注意到我们正在使用的用户控件之一没有被复制到输出目录中的 UserControls 文件夹中。但是,当我从 Visual Studio 2008 中构建并发布项目时,该文件就在那里。
我相信发生这种情况的原因是因为项目中 UserControls 文件夹中的文件是同一项目中不同解决方案中文件的快捷方式。 MyProject.vbproj
文件中的 ItemGroup XML 如下所示:
<Content Include="..\OtherSolution\UserControlFile.ascx">
<Link>UserControls\UserControlFile.ascx</Link>
</Content>
在我们的 MSBuild.xml 文件中,构建解决方案后正在运行以下内容:
<MSBuild Projects="$(ProjectRootPath)\MyProject.vbproj"
Targets="_CopyWebApplication;_BuiltWebOutputGroupOutput"
Properties="OutDir=$(BuildFilesPath)\" />
有谁知道为什么快捷方式是这样的吗?没有被复制到OutDir
?我在这里检查了很多问题,并尝试了谷歌,但似乎没有针对这个问题的解决方案。
谢谢
We have a CMD file which loads an MSBuild XML file and builds and publishes our VB .NET Web App. I noticed today that one of the user controls we're using is not being copied to the UserControls folder in the output directory. However when I build and publish the project from within Visual Studio 2008 that file is there.
I believe the reason this is happening is because the file that is in the UserControls folder in the project is a shortcut to a file in a different solution within the same project. The ItemGroup XML in the MyProject.vbproj
file looks like this:
<Content Include="..\OtherSolution\UserControlFile.ascx">
<Link>UserControls\UserControlFile.ascx</Link>
</Content>
In the MSBuild.xml file we have, the following is being run after the solution has been built:
<MSBuild Projects="$(ProjectRootPath)\MyProject.vbproj"
Targets="_CopyWebApplication;_BuiltWebOutputGroupOutput"
Properties="OutDir=$(BuildFilesPath)\" />
Does anyone have any idea why the shortcut is not being copied to the OutDir
? I've checked a bunch of questions on here, and tried Google, but there doesn't seem to be solutions specific to this problem.
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我们在项目中使用许多链接文件,让它们工作的唯一方法是将“复制到输出目录”属性设置为“始终复制”
We use a number of linked files in our projects, the only way we can get them to work is to set the 'Copy to Output Directory' property to 'Copy Always'