Question

I'm trying to develop an Application in .Net4, that creates a custom Window, inserts custom controls and saves it in a directory. My next challenge is how I can generate/build additional code from my Visual Studio Solution in a WPF .exe Aplication. I need only some classes that will be generated and transformed to a .exe. This classes will give the logic to navigate from one Window to another.

Here is a little diagram that I did for the question: enter image description here

Things that I have researched:

  1. CSharpCodeProvider: I can pass some classes in a string[] but I don't know how they will work with dependency, or when a error/bug occurs it will be difficult to see where the error is. And finally worst thing is that I can't set a location to build this .exe. It's built in the main Solution/Bin/Debug.
  2. MSBuild: Here I can set the location where I will build the solution, but for this I need an extra Visual Studio Solution. What I'm trying to do is to have inside my Application a Build button that can build like in Visual Studio a .exe program but with custom classes that I will have in my Application.

I don't know if its possible, I was looking for it but I'm a little bit lost. I see in http://www.icsharpcode.net/opensource/sd/ that the have a builder, and they can set the location and build a .exe from the code. The only difference from SharpDevelop is that my controls and Window are customs.

UPDATE:

Maybe what I'm trying to do is better with other tools. Maybe compiling C# in runtime is not he best way. I will appreciate another ways to solve the problem.

enter image description here

Was it helpful?

Solution

What I do is Creating a new extra project for this .exe and must just copy/paste this .exe to each Project location.

But this is not very useful, if every time we must copy/paste this .exe

I just searching or a solution. I made this as a alternative solution but I don't like it so I will continue to investigate for a generation tool or something else.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top