简体   繁体   中英

MSBuild and ASP.NET

I am trying to accomplish MSBuild for an out-of-the-box MVC4 project, in order to eventually use it combined with Jenkins in my real life application. The very not detailed tutorial I've tried following is Here

First, is there any alternative, open sourced, way to compile + deploy ASP.NET app? - it must be pluggable into Jenkins.

Second, I keep getting many types of errors, none of them are easy to debug, since valuable documentation doesn't popped up easily on google. Any good "auto generated" tool or good short manuals to get started with it?

Third, concrete errors:
1. Build started 7/15/2014 10:47:13 AM. 1>Project "C:\\WebSites\\jenkinsDeployment\\Jenkins\\TestJenkinsGit.sln" on no de 1 (default targets). 1>C:\\WebSites\\jenkinsDeployment\\Jenkins\\TestJenkinsGit.sln.metaproj : erro r MSB4126: The specified solution configuration "Debug|HPD" is invalid. Please specify a valid solution configuration using the Configuration an d Platform properties (eg MSBuild.exe Solution.sln /p:Configuration=De bug /p:Platform="Any CPU") or leave those properties blank to use the de fault solution configuration. [C:\\WebSites\\jenkinsDeployment\\Jenkins\\Tes tJenkinsGit.sln] 1>Done Building Project "C:\\WebSites\\jenkinsDeployment\\Jenkins\\TestJenkins Git.sln" (default targets) -- FAILED. Build started 7/15/2014 10:47:13 AM. 1>Project "C:\\WebSites\\jenkinsDeployment\\Jenkins\\TestJenkinsGit.sln" on no de 1 (default targets). 1>C:\\WebSites\\jenkinsDeployment\\Jenkins\\TestJenkinsGit.sln.metaproj : erro r MSB4126: The specified solution configuration "Debug|HPD" is invalid. Please specify a valid solution configuration using the Configuration an d Platform properties (eg MSBuild.exe Solution.sln /p:Configuration=De bug /p:Platform="Any CPU") or leave those properties blank to use the de fault solution configuration. [C:\\WebSites\\jenkinsDeployment\\Jenkins\\Tes tJenkinsGit.sln] 1>Done Building Project "C:\\WebSites\\jenkinsDeployment\\Jenkins\\TestJenkins Git.sln" (default targets) -- FAILED. 2.

C:\Program Files (x86)\Jenkins\jobs\MyApp-Test\workspace>C:\Windows\Microsoft.NET\Framework\v4.0.30319
\MSBuild.exe /p:DeployOnBuild= true /p:PublishProfile=Test;SolutionDir=C:\Program Files (x86)\Jenkins\
jobs\MyApp-Test\workspace /m /p:Configuration=Release "/p:Platform=Any CPU" DeployIt.sln              
Microsoft (R) Build Engine version 4.0.30319.33440                                                    
[Microsoft .NET Framework, version 4.0.30319.34014]                                                   
Copyright (C) Microsoft Corporation. All rights reserved.                                             

MSBUILD : error MSB1008: Only one project can be specified.                                           
Switch: Files                                                                                         

For switch syntax, type "MSBuild /help"                                                               

And many many more...

  1. There is Mono . Everything is pluggable into Jenkins since it can run an executable, hence you can plug in MSPaint if you wanted to.

  2. MSDN , the javadocs of anything .NET including MVC. There is also dedicated asp.net/mvc .

    1. If you're passing a custom platform ( HPD ) to an .sln then all .csproj in that solution have to have it, otherwise click on solution in Studio, go to Properties > Configuration Properties and check your [default] project platform settings.

    2. /p flag shouldn't be in quotes, all paths with spaces should, DeployOnBuild shouldn't have a space before value and so on. Remote onto the build server, copy/paste the command from the error log and fix it till it runs manually before plugging back it into Jenkins or anywhere else; better yet make it build locally first from command line regardless of the CI server.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM