Is it possible, in C#, to share code between Visual Studio projects without needing to distribute a DLL?
I'm maintaining some software that's composed of a few Visual Studio C# projects, each building to a simple console executable. There's a lot of shared code between the projects that I'd like to move out. I believe I can put the code in a Class Library project, but I'd rather avoid tacking on a DLL to distribute with each of the executables.
Is there any way around this? I'm new at C#, so perhaps I'm thinking about this all wrong anyway - are there any alternate suggestions?
If you select Start Collaboration session from the Session Details menu, an invitation link to your session will automatically be copied to your clipboard. You can share this link with anyone you'd like to collaborate with, as long as they also have VS Code and the Live Share Extension Pack downloaded.
This can be achieved by adding reference of one project in the other project. If both the projects are in the same solution, then expand the project name, right click on 'References', click on Add references. Go to 'Projects' Tab, select the project name which you want to use in current project, click ok.
You can think of “shared items” projects as another way of organizing your files in case you have many projects building the same source file (e.g. in case you build multiple applications that share the same source and you're not already using static libraries for this purpose).
Use a zip program, and zip the executable and the cpp source file into one file. You can then send it without the browser complaining. It's best to let the person you're sending it to, know what you sent, and maybe even the size of each file, so they know what to expect.
You can use ILMerge to combine the class library with the exe.
http://research.microsoft.com/en-us/people/mbarnett/ilmerge.aspx
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With