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
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’