locked
MSBuild, TeamCity and Architecture Validation RRS feed

  • Question

  • On our CI Server, we are able to run a build with the ValidateArchitecture parameter set to true, but only from the Visual Studio command prompt.

     

    When trying to run the same command from TeamCity, we get the following output from MSBuild:

     

    [08:27:43]: C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\ArchitectureTools\Microsoft.VisualStudio.TeamArchitect.LayerDesigner.targets(149,5): error MSB4018: The "GraphCmd" task failed unexpectedly. [E:\TeamCity\buildAgent2\work\b5a7f60f5353d68a\AlgoCollateral.Modeling\AlgoCollateral.Modeling.modelproj]
    [08:27:43]: C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\ArchitectureTools\Microsoft.VisualStudio.TeamArchitect.LayerDesigner.targets(149,5): error MSB4018: System.InvalidOperationException: Cannot start process because a file name has not been provided. [E:\TeamCity\buildAgent2\work\b5a7f60f5353d68a\AlgoCollateral.Modeling\AlgoCollateral.Modeling.modelproj]
    [08:27:43]: C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\ArchitectureTools\Microsoft.VisualStudio.TeamArchitect.LayerDesigner.targets(149,5): error MSB4018: at System.Diagnostics.Process.Start() [E:\TeamCity\buildAgent2\work\b5a7f60f5353d68a\AlgoCollateral.Modeling\AlgoCollateral.Modeling.modelproj]
    [08:27:43]: C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\ArchitectureTools\Microsoft.VisualStudio.TeamArchitect.LayerDesigner.targets(149,5): error MSB4018: at Microsoft.Build.Utilities.ToolTask.ExecuteTool(String pathToTool, String responseFileCommands, String commandLineCommands) [E:\TeamCity\buildAgent2\work\b5a7f60f5353d68a\AlgoCollateral.Modeling\AlgoCollateral.Modeling.modelproj]
    [08:27:43]: C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\ArchitectureTools\Microsoft.VisualStudio.TeamArchitect.LayerDesigner.targets(149,5): error MSB4018: at Microsoft.Build.Utilities.ToolTask.Execute() [E:\TeamCity\buildAgent2\work\b5a7f60f5353d68a\AlgoCollateral.Modeling\AlgoCollateral.Modeling.modelproj]
    [08:27:43]: C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\ArchitectureTools\Microsoft.VisualStudio.TeamArchitect.LayerDesigner.targets(149,5): error MSB4018: at Microsoft.VisualStudio.TeamArchitect.LayerDesigner.Build.GraphCmd.Execute() [E:\TeamCity\buildAgent2\work\b5a7f60f5353d68a\AlgoCollateral.Modeling\AlgoCollateral.Modeling.modelproj]
    [08:27:43]: C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\ArchitectureTools\Microsoft.VisualStudio.TeamArchitect.LayerDesigner.targets(149,5): error MSB4018: at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute() [E:\TeamCity\buildAgent2\work\b5a7f60f5353d68a\AlgoCollateral.Modeling\AlgoCollateral.Modeling.modelproj]
    [08:27:43]: C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\ArchitectureTools\Microsoft.VisualStudio.TeamArchitect.LayerDesigner.targets(149,5): error MSB4018: at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(ITaskExecutionHost taskExecutionHost, TaskLoggingContext taskLoggingContext, TaskHost taskHost, ItemBucket bucket, TaskExecutionMode howToExecuteTask, Boolean& taskResult) [E:\TeamCity\buildAgent2\work\b5a7f60f5353d68a\AlgoCollateral.Modeling\AlgoCollateral.Modeling.modelproj]
    


    We've tried setting the working directory to the MSBuild directory and the GraphCmd directory (C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE), and also tried setting the path in a normal command prompt window to exactly the path we get from the Visual Studio command prompt.  But none of these allow us to run a build with architecture validation from anything but the Visual Studio command prompt.

    What do we need to do to have MSBuild run architecture validation from a normal command prompt (and presumably then from TeamCity)

    Thanks,

    Alex

    Wednesday, June 29, 2011 12:37 PM

All replies

  • Hi Alex,

     

    Welcome to the MSDN forum.

     

    According to your description of the problem. the issue you are experiencing is that you can build your project only from the Visual Studio command prompt but doesn’t work from other command prompt.

     

    Based on my analysis of the issue. I suggest you use the Visual Studio Command Prompt, since it configures the environments suitable for building the solution. And the other command prompt doesn’t configure the environment which used in building a project. So it will appear error.

     

     If you want use the normal command Prompt to build your project. I have some actions for you to perform in order to resolve your problem. Please take the following steps:

     

    Step1:

    Right-click the Visual Studio command prompt and choose the properties.

     

    Step2:

    Copy the path in Target textbox. (e.g.” %comspec% /k ""e:\Program Files\Microsoft Visual Studio 10.0\VC\vcvarsall.bat"" x86”). And run your normal Command Prompt.

     

    Step3:

    And paste the path in the command Prompt and Enter. Then the Command Prompt screen will print “Setting environment for using Microsoft Visual Studio 2010 x86 tools.” You can input your command line in this setting environment. It works like in the Visual Studio Command Prompt.

     

    What’s more, the TeamCity is the Third Party Product. And we don’t familiar with that Product. Here has the link of TeamCity Websit.  http://www.jetbrains.com/teamcity/.You can get more information from it or post thread in the Discussion Forums there.

     

    Please let me know the results of these actions at your earliest convenience.

    I hope this will help resolve your problem. If anything is unclear, please free feel to let us know.

    Thank you for your understanding and support.

    I look forward to hearing from you.

     

    This response contains a reference to a third party World Wide Web site. Microsoft is providing this information as a convenience to you. Microsoft does not control these sites and has not tested any software or information found on these sites; therefore, Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. There are inherent dangers in the use of any software found on the Internet, and Microsoft cautions you to make sure that you completely understand the risk before retrieving any software from the Internet.

     

    Best Regards,

    Elkan Du


    Elkan Du [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Friday, July 1, 2011 7:19 AM
  • Hi Alex,

     

    Did this help? If you still have any questions about this issue, please feel free to let me know. We will continue to work with you on this issue.

     

    If I have misunderstood anything, please describe your question in more detail and we will be able to provide quicker and better responses.

     

    Best Regards,

     

    Elkan Du


    Elkan Du [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Tuesday, July 5, 2011 8:58 AM
  • Thanks Elkan, my main question was whether I could use Architecture Validation with MSBuild from the normal command prompt (which TeamCity exposes for this kind of situation).  I know that if I can get it working from the normal command prompt it will work from TeamCity. 

    I guess any information on why this won't work from the normal command prompt would be helpful.  It seems that I should be able to use the architecture validation wherever I would use MSBuild.

    Thanks,

    Alex

    Tuesday, July 5, 2011 2:56 PM