Team System Developer Center > Visual Studio Team System Forums > Team Foundation Server - Build Automation > TFS Build Error when using @Reference to access UserControl class
Ask a questionAsk a question
 

AnswerTFS Build Error when using @Reference to access UserControl class

  • Monday, November 02, 2009 5:06 PMlostatredrock Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    I have just started playing with the idea of automating site builds using TFS so I have been stumbling a bit through the process figuring out issues along the way.  Last week I ran into an issue I have been unable to get working.  In several places through my project I use the @Reference directive to allow casting of a generic UserControl returned by a component to the correct user control class.  On my local machine, this code compile with no issue, but when compiling using TFS  I get the error:

    error CS0246: The type or namespace name '<Class Name>' could not be found (are you missing a using directive or an assembly reference?)

    I have been searching around looking for some reference to an issue like this, but as you can imagine an search for TFS, build and reference is not entirely helpful for the problem I am having....

    Thanks for any help, 
    Andrew

Answers

  • Wednesday, November 04, 2009 9:30 AMRuiz YiModeratorUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer
    Hi,

     MSBuild run "aspnet_compiler.exe" to compile web site, could you run the command in CMD directly both on local machine and build machine? 

    You can find the command the command in Buildlog like  " C:\Windows\Microsoft.NET\Framework\v2.0.50727\aspnet_compiler.exe -v /WebSiteToBuild -p WebSiteToBuild\ -u -f C:\Users\TFSBuild\AppData\Local\Temp\TestTFS\WebSite\Binaries\Release\_PublishedWebsites\WebSiteToBuild\"

    Best Regards,
    Ruiz


    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread. Sincerely, Ruiz Yi

All Replies

  • Wednesday, November 04, 2009 9:30 AMRuiz YiModeratorUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer
    Hi,

     MSBuild run "aspnet_compiler.exe" to compile web site, could you run the command in CMD directly both on local machine and build machine? 

    You can find the command the command in Buildlog like  " C:\Windows\Microsoft.NET\Framework\v2.0.50727\aspnet_compiler.exe -v /WebSiteToBuild -p WebSiteToBuild\ -u -f C:\Users\TFSBuild\AppData\Local\Temp\TestTFS\WebSite\Binaries\Release\_PublishedWebsites\WebSiteToBuild\"

    Best Regards,
    Ruiz


    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread. Sincerely, Ruiz Yi