Team System - Website Under source control

I have the Team Build Configured and I am also able to start the build from any of the client machines. 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. All of these projects are under Team System source control.

The website has Project references to other library projects within the same solution but the team build 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

Team System - Website Under source control

  • Play4sure

    This scenario is working fine on B3R bits. I would suggest upgrading from B2 bits to newer bits of TFS.

  • drJekyll

    Ok, well not the answer I was hoping for, but at least it give me something to look into.

    Thanks,

    ~slee

  • Joel Pobar

    I am having this same issue.  Are there any workarounds available

    Or are we unable to use MSBuild (and therefore Team Build) for web projects

  • logogamer

    This looks like the same as the other topic you started, though with more detail.
    http://forums.microsoft.com/msdn/ShowPost.aspx PostID=10669

    Is that the case

    Buck

  • Nyidalur

    Actually this seem to be an issue with the MSBuild task when compiling solutions not a Team Build Issue ..
  • diluted_water

    Yeah, sorry, didn't know where to post regarding Team Builds, I had to do a work around to split the solution and manually edit the proj file to compile websites. Right now I have 3 solutions,

      1) one with all of the projects including the web, this I use for development.
      2) second with all the class projects for Team Build
      3) third with just the web project for Team Build.

    I split the compile process in the Teambuild.proj file to build the second solution, then use copy task to copy all assemblies produced from compiling this solution to the website's bin folder under source directory, then compile the web project. This completes the build successfully.

    Its a work-around and pain to get over the issue of having to deal with web site with project reference. Hopefully this gets fixed in the next CTP/RTM.

    Right now i am looking into hooking on the Check-in event to trigger the build automatically ala' for continuos integration...
     

  • Haitham Salah

    For Beta 2 no, MS has recognized it as an issue and has fixed for RTM, http://forums.microsoft.com/msdn/ShowPost.aspx PostID=11950 , for now you would need to write a copy task to  manually put the referenced assemblies in the bin directory of the website, which also means for Team Build you would need to have two different soln, one with the libraries and the other with the website..and put the copy task between them....I know its a pain, Here is some code from the Team Build proj file.




    <!-- Other tags from the proj file -->

    <ItemGroup>

    <!-- Solution with just the library projects -->

    <
    SolutionToBuild Include="$(SolutionRoot)\Solution_Library_TeamBuild.sln" />

    </ItemGroup>

    <ItemGroup>

    <!-- assemblies to copy, these would be the result of the  compiling the sln above -->
    <
    WebReferedAssemblies Include="$(BuildDirectoryPath)\$(PortfolioProject)\$(BuildConfiguration)\Binaries\Debug\*.dll;$(BuildDirectoryPath)\$(PortfolioProject)\$(BuildConfiguration)\Binaries\Debug\*.pdb"/>

    </ItemGroup>

    <ItemGroup>

    <!-- Solution with just the website -->
    <
    WebSolutionToBuild Include="$(SolutionRoot)\Solution_Website.sln" />

    </ItemGroup>

    <Target Name="Compile" DependsOnTargets="CustomCompile">

    <TeamBuildMessage Tag="Configuration" Value="Debug" />

    <TeamBuildMessage Tag="Platform" Value="AnyCPU" />

    <!-- Library solution-->
    <
    MSBuild Projects="@(SolutionToBuild)" Properties="Configuration=Debug;Platform=AnyCPU;RunFxCop=$(RunFxCopFlag);SkipInvalidConfigurations=true;VCBuildOverride=$(MSBuildProjectDirectory)\VCOverrides.vsprops;FxCopDir=$(FxCopDir);OutDir=$(BuildDirectoryPath)\$(PortfolioProject)\$(BuildConfiguration)\Binaries\Debug\" ContinueOnError="false" />

    <!-- Copy task -->
    <
    Copy SourceFiles="@(WebReferedAssemblies)" DestinationFolder="$(BuildDirectoryPath)\$(PortfolioProject)\$(BuildConfiguration)\sources\website\Bin" />

    <!-- website -->
    <
    MSBuild Projects="@(WebSolutionToBuild)" Properties="Configuration=Debug;Platform=AnyCPU;RunFxCop=$(RunFxCopFlag);SkipInvalidConfigurations=true;VCBuildOverride=$(MSBuildProjectDirectory)\VCOverrides.vsprops;FxCopDir=$(FxCopDir);OutDir=$(BuildDirectoryPath)\$(PortfolioProject)\$(BuildConfiguration)\Binaries\Debug\" ContinueOnError="false" />

    <OnError ExecuteTargets="CreateWorkItem;" />

    </Target>

    <!-- rest of the tags from the proj file -->


     



    Krishna


  • MikeP2a

    Is it possible to add the copy task at the end of each project file

    For example, having an assembly project Proj1 and a web site:
    in Proj1.proj add the copy stuff <Copy .....>

    In this case you dont need to create an extra solution.


  • Team System - Website Under source control