3

I would like to create a Visual Studio Solution and a C# Project programmatically, but without a instance of Visual Studio installed on the machine.

Scenario

I am trying to build a "engine" that will read some metadata in a SQL database and transform them into a UI. The database will be maintained by another people with a Web or WCF interface and I want the Server Application frequently (by schedule or pressing a button) use this informations to create autommaticaly a new version of the software (create solution -> project -> build -> create deployment).

So, I searched about programmatically create Solution and I found only the Automation Model in VS, it's about use an Add-In Project and this don't serves for my propose.

Perhaps I was a little confused in my explanation, so ask me more especific details, so I can be more accurate :)

Thanks for help

1
  • oswaldo, did you ever figure this out? Commented Aug 12, 2016 at 22:16

2 Answers 2

3

I think generating the solution is a little extreme.

The solution file structure hasn't changed much since 2005 http://msdn.microsoft.com/en-us/library/bb165951(v=VS.80).aspx, and there are a few projects trying to automate their generation, like Premake https://bitbucket.org/premake.

However, the kind of scenario you describe, might be I believe (better?) adressed with t4 templates http://msdn.microsoft.com/en-us/library/vstudio/bb126445.aspx, or only project file generation.

Sign up to request clarification or add additional context in comments.

5 Comments

Thanks for the response. You clarified me a lot! I think creating manually the .sln file is too hard and i can have compatibility problem in future. About the PREMAKE I don't like to use 3rd part solutions cause never know the software life cycle. So, i will study T4 templates, it can be the way...
Well, I read the T4 documentation and it's only about generate files with a template, but how to add them to a Project and build/deploy this project?
It's actually pretty well explained here: msdn.microsoft.com/en-us/library/ee847423.aspx no worries.
Then maybe you don't need to create projects and solution and you should look up the schema aware widgets that already exist in .net and extend them or capitalize on their behavior? Like: msdn.microsoft.com/en-us/library/cc488523(v=vs.90).aspx
Forget this... thanks for your time! I am thinking like a Model-Driven Development, but the model will be made dynamicaly with a non-visual enviroment.
0

What you are describing is possible to do in C# Windows app but tedious and difficult. I remember seeing VB6.0 app like that but here i would suggest you look into WPF. Still it's C# programming but WPF can load dynamically a "window" from a string or a file if you want.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.