Soxiz

Hello

I am in the process of setting up a build server (CruiseControl.Net) a would like to use MSBuild to build my projects.

When MSBuild build a Web Application it don't create a _PublishedWebsites unless your OutDir is different from the default. After using a few hours on this i found out that MSBuild use the following target file: Microsoft.WebApplication.targets.

I Changed the .target file so the CopyWebApplication now looks like the following:
<Target Name="_CopyWebApplication" Condition="'$(OutDir)' != '$(OutputPath)' or '$(WebProjectOutputDir)' != '$(MSBuildProjectDirectory)'" >
Which atleast make it always create a folder thats ready for production.

After getting this working I found another problem, it seems when building a webservice the .target file place the .XmlSerializers.dll in the main WebProjectOutputDir and not in the WebProjectOutputDir\bin. After looking arround i found that its the following line:
<Copy SourceFiles="$(IntermediateOutputPath)$(_SGenDllName)" DestinationFolder="$(WebProjectOutputDir)\%(Content.SubFolder)%(Content.RecursiveDir)" SkipUnchangedFiles="true" Condition="'$(_SGenDllCreated)'=='true'" />

Which seems to be the reason why the file is placed there. I have the following questions:

1: Is it safe to just replace the %(Content.SubFolder)%(Content.RecursiveDir) with bin
2: What does %(Content.SubFolder)%(Content.RecursiveDir) refer to Is there a list or something with all these variables that just come out of nowhere

Best Regards
Mads Lutzhoft


Re: Visual Studio MSBuild MSBuild and Web Applications

Soxiz

Are there really no one that can help me with these questions

Best Regards
Mads Lutzhoft




Re: Visual Studio MSBuild MSBuild and Web Applications

RobvanderVeer

Check out my solution at http://www.driebier.net/post/Using-MSBuild-to-deploy-visual-studio-2005-web-applications.aspx. After reading about your problems with this, I decided to give it a go.





Re: Visual Studio MSBuild MSBuild and Web Applications

Michael Harmsen

Soxiz wrote:
Are there really no one that can help me with these questions

Best Regards
Mads Lutzhoft

We're experiencing the exact same issue several months into development in a couple of projects. If someone can shed some light on why .XmlSerializers.dll is created in the incorrect folder we would love to hear it.

Posting a link to some 10.x address doesn't help as that is an internal IP address.

Cheers,

Michael





Re: Visual Studio MSBuild MSBuild and Web Applications

RobvanderVeer

Oops. I've changed the link.

Please let me know if my 'bugfix' solves your issue. For me at least it magically started copying the correct assemblies to my output folder.





Re: Visual Studio MSBuild MSBuild and Web Applications

Michael Harmsen

Thanks for the updated link. However our problem is not quite the same I see now after I checked again. My CruiseControl build actually works - it's on our local development machines that the XmlSerializers.dll is created in the wrong folder. The build script is the same on all machines and Microsoft.WebApplication.targets file is also the same. The really fun part is that the problem suddenly appeared after we had been building for months. I'm stomped...



Re: Visual Studio MSBuild MSBuild and Web Applications

RobvanderVeer

Sorry to hear that. I had similar problems with DLL's appearing in the root folder but that was because I forgot about adding the /p:WebProjectOutputDir=<dropdir> on my command line.But as you state all your scripts are equal so that cannot be the cause. Perhaps it has something to do with some environment variables (just a wild guess)

I don't know if you saw my update already, but the modified script is not required at all. All I needed was to add an additional target on the build command. Although it may have nothing to do with your problems, I'd thought i'd mention it anyway.





Re: Visual Studio MSBuild MSBuild and Web Applications

Sayed Ibrahim Hashimi

I have also run into the issue of the _PublishedWebsites deal. Have a look at my blog entry MSBuild: Property & Item Override Problems for information about how to get around this without having to specify the property at the command line.

Sayed Ibrahim Hashimi
www.sedodream.com