MSBuild _CopyWebApplication does not copy <link> from vbproj

We have a CMD file that downloads the MSBuild XML file and builds and publishes our VB.NET Web App. Today I noticed that one of the user controls we use is not copied to the UserControls folder in the output directory. However, when I create and publish a project from Visual Studio 2008, this file is.

I believe that the reason for this is that the file located in the UserControls folder in the project is a shortcut to the file in another solution within the same project. The ItemGroup XML element in the file is MyProject.vbprojas follows:

<Content Include="..\OtherSolution\UserControlFile.ascx">
  <Link>UserControls\UserControlFile.ascx</Link>
</Content>

In the MSBuild.xml file, we do the following: after the solution has been built:

<MSBuild Projects="$(ProjectRootPath)\MyProject.vbproj" 
            Targets="_CopyWebApplication;_BuiltWebOutputGroupOutput" 
            Properties="OutDir=$(BuildFilesPath)\" />

Can anyone understand why the shortcut is not copied to OutDir? I checked a lot of questions here and tried Google, but there seems to be no solution specific to this problem.

thank

+3
source share
1 answer

We use a number of related files in our projects, the only way to make them work is to set the Copy to Output Directory property to Always Copy

+2
source

All Articles