Click here to Skip to main content
Click here to Skip to main content

Creating MSBuild projects from .sln files.

By , 6 Apr 2011
Rate this:
Please Sign up or sign in to vote.
I recently had a need to create an MSBuild file for a complex (multi-project) solution in VS2010. By default .sln files are not in msbuild format, but they can be called from MSBuild - while I could have done this, I didn't want to - I wanted a proper MSBuild solution. Fortunately, there is a way to convert the .sln file into an MSBuild .proj file. Open up a Visual Studio command prompt and type in the following:
set MSBuildEmitSolution=1
msbuild <<your project>>.sln 
That's it. If your solution builds successfully, an addition MSBuild .proj file is created (this is the file that MSBuild creates internally to process .sln files). It's that simple.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

About the Author

Pete O'Hanlon
CEO
United Kingdom United Kingdom
A developer for over 30 years, I've been lucky enough to write articles and applications for Code Project as well as the Intel Ultimate Coder - Going Perceptual challenge. I live in the North East of England with 2 wonderful daughters and a wonderful wife.
 
I am not the Stig, but I do wish I had Lotus Tuned Suspension.
Follow on   Twitter   Google+

Comments and Discussions

 
QuestionNice! Pinmemberdrhender18-Nov-13 6:40 
QuestionIn Application PinmemberÉverton França18-Jul-13 9:15 
AnswerRe: In Application PinprotectorPete O'Hanlon18-Jul-13 9:23 
GeneralUseful! PinmemberBrisingr Aerowing29-Mar-13 14:18 
QuestionNice one! PinmemberXandip27-Sep-12 21:46 
AnswerRe: Nice one! PinmemberMember 947095929-Sep-12 9:39 
next to the solution file, it wil be named .sln.metaproj.
GeneralClean and Simple PinmemberMackZero29-Aug-12 10:36 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Mobile
Web03 | 2.8.140415.2 | Last Updated 6 Apr 2011
Article Copyright 2011 by Pete O'Hanlon
Everything else Copyright © CodeProject, 1999-2014
Terms of Use
Layout: fixed | fluid