MSBuild Task, Compiling web site with project references

I was testing to use MSBuild from command line for an automated build process, MSBuild Task seem to have an issue compiling website with project references within the same solution. The library, console, windows services and application are all compiling with out any errors but when it comes to compiling websites I am running into issues. 

The website has Project references to other library projects within the same solution but the MSbuild does not seem to be copying these referenced assemblies into the website's bin directory after compiling those libraries, because of this the website compilation is failing, is there any thing that i need to do to make sure the assemblies all are copied over to the right place

If I use assembly reference instead of Project reference the compilation is not giving errors. Even the log shows the error as missing assembly reference in the former case [compiling within the IDE on the client machine works fine] Example from Compilationlog.txt :-

d:\Development\yyyy\Complete Build [Debug]\sources\website\App_Code\UIBaseClasses\PageHelper.cs(8,0): error CS0234: The type or namespace name 'xxx' does not exist in the namespace 'xxx' (are you missing an assembly reference )


Thanks,
Krishna


Answer this question

MSBuild Task, Compiling web site with project references

  • Bharath Nadig

    it would be lovely if you could post the (working) config here! Big Smile

  • Johannes Jauch

    Unfortunately, this is a limitation of Beta2 (it is fixed for RTM). MSBuild Beta2 will not copy the referenced projects' outputs to the website's bin directory. As you've already discovered, you can use assembly references to work around the problem. We're sorry about the inconvenience.

    thanks,
    Lukasz

  • jamaddox

    Can anyone confirm that this is really fixed   I'm hitting the same problem with v2.0.50727. 
  • Karthikeyan

    Great, Thanks, for now I've written a copy task in the proj file to copy over the files and then compile the website, which works for now.
  • tubefeed

    I just got it working by removing a couple of unnecessary references between library assemblies.  Code had been moved from one project to another but some references to the original project remained even though the code didn't use them. 
    The redundant references were between library assemblies - the web application references remained unchanged.  Removing the references was enough to get MSBuild copying all the required assemblies into the web site bin directory.


  • Mark Ramey

    Yes, for those of us waiting for the RTM fix taking a look at your workaround would be a great help.
  • MSBuild Task, Compiling web site with project references