Click here to Skip to main content
15,881,424 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
I want to create a windows application project which can add .cs file(it will be generated by my project) to an another project(available in a different solution).

Can it be achieved by C#, if no is there any other way?
Posted
Comments
Sergey Alexandrovich Kryukov 23-Dec-14 23:12pm    
Not clear and does not seem to make any sense. Why trying to do such things; what's the point?
It simply means that you need to modify the project file and perhaps directory structure of some project. But why?
—SA
BillWoodruff 24-Dec-14 0:00am    
There are several ways your question could be interpreted, so I'd like to ask you to clarify. Are you speaking about one Application which is RUNNING inserting a file into the folder structure of another .NET Application which is not running and modifying that not-running Application so when it starts up it loads the inserted file ?

Or ... ?
Sicppy 24-Dec-14 2:13am    
You might consider expanding your question to include what exactly you are trying to accomplish here. I have posted an answer which would cover some of the most common needs for such an operation, and if it answers your question, please consider accepting the solution.

1 solution

If you have a way to compile it into a dll, you can always use System.Reflection to load a dll at runtime(see this StackOverflow question). If not you can always try lua, there's a good article about that over on DreamInCode.
 
Share this answer
 
Comments
BillWoodruff 24-Dec-14 0:43am    
This is, potentially, a very good answer ... once we understand what the OP actually is doing, and what their goal is.
Sicppy 24-Dec-14 0:46am    
Yes they were a bit vague, lua is usually my goto for these type of things as you can link lua functions to c# functions in your program and essentially program without compiling.
BillWoodruff 24-Dec-14 1:55am    
That's interesting ! Perhaps you might consider doing an article on using Lua with C#, and show how you have found it useful, essential, etc. ?

I wonder if the OP in this case is after some kind of plug-in architecture, in which case I think MEF would be a candidate.

thanks, Bill
Sicppy 24-Dec-14 2:11am    
I might do just that!

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900