Click here to Skip to main content
15,900,572 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I generally like to keep one solution that contains executable's and all the projects for any library's they use. This way I can reference the library's project if an executable needs it and if I modify a library I can compile the solution and the executable's will get the updated library automatically.

My responsibilities have recently expanded from just supporting library's to include working on the companies flag ship product directly. This product gets released in modules that are configured to the customers needs. So every customers get the main components and then only the libraries that come with the modules they've ordered. The company has done this for two reasons. One is to make it harder to obtain our libraries to decompile and the second is to reduce the size of updates that are released periodically.

As a result almost all of are libraries are late bound through reflection. This has made it very difficult make sure you're working with the current version of every library. Is there a way to make a project-to-project reference in Visual Studio and still ship are product with only the required libraries?

Edit: In case I worded it in a way that is confusing or gave to much background information my questions way not about licenses or protecting are code from decompile. We are currently late binding with Reflection only to are own libraries and so we don't have to remove unneeded references and recompile for every configuration of the software. I'm want to know if there is a way that I can still make project-to-project references and still accomplish what were doing. I realize that there is probably a better approach over all, but this is the situation I'm in and thank you again for your help.

What I have tried:

Tried Googling, Code Project and Stack Overflow.
Posted
Updated 17-Jan-17 4:05am
v2

It depends if you can change your manual Plugin-mechanism (what I understand you achieve here with your "late-binding" assemblies) to a more managable plugin-structure. have you ever used MEF - it's part of .NET and quite easy to manage - So I have a similar feature for our customers where customer specific libs are loaded automatically by MEF + VS knows about it and can update them - I work with normal project references during Desing-Time and for quick Debugging (I set up the MEF "catalog" to find my assemblies in the Project Folders for DEBUG, and a configured "Plugin" Folder in RELEASE configuration - like on the target systems.) If you are interested in this approach I can share some more "insights" ;)
 
Share this answer
 
Comments
ryanba29 19-Jan-17 17:10pm    
Johannesnestler, sounds like the solution I needed. Give me a change to test it out before I accept your solution. Thank you for your suggestion.
Customers do not really care about the source code, or what tools you are using to write the software's source code. The main thing that must be provided is the dependency of the executable. If the executable needs something (such as a dll for a library), it must be made available. If you do not want to share the libraries, then make sure that the execute can run natively — without the need of a runtime or library, which in .NET framework is really very tough job and you also lose much of portability.

So, if your project is referencing a dll file, it must be shared, otherwise program won't even (start to) execute. If you really want to do this, you can try to embed those code snippets inside the executable; or use the resources and embed them there — I wonder if this is even possible.

If you want to make it harder to decompile (in .NET of course), you may want to use some other services, such as Dotfuscator[^], that would let you to make it difficult for the end user to decompile the libraries or other software packages that are delivered to their machines. But know this, they can still decompile maximum of the assemblies.

If the assemblies, that you wrote depend on other assemblies, then there are licenses applied to them as well. Make sure, you abide to follow those licenses as well — such as, share the software as-is. Finally, the user can still have his/her chance to break the code and see what is written there.

Reflection on other hand, does not guarantee that you can simply get away and not have the code decompiled. Reflection has other uses, and... Well, it was just not used properly in your case. :-)
 
Share this answer
 
Comments
ryanba29 17-Jan-17 9:43am    
Afzaal, maybe I worded it in a way that is confusing or gave to much background information and if so I apologize, but my questions way not about licenses or protecting are code from decompile. We are currently late binding with Reflection only to are own libraries and so we don't have to remove unneeded references and recompile for every configuration of the software. I'm want to know if there is a way that I can still make project-to-project references and still accomplish what were doing. I realize that there is probably a better approach over all, but this is the situation I'm in and thank you again for your help.

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