简体   繁体   中英

Use Of Same dll file in all .Net Applications

I have ConsoleApplication01, ConsoleApplication02, ConsoleApplication03 and using "Mydll.dll" for accessing database.

I want to keep all "exes" of all Console Applications in one folder to run using windows service. So problem is that, Its asking to replace "Introp.Mydll.dll" into my destination folder.

Will it work by Replacing this file "Introp.Mydll.dll".

If its exactly the same dll (same binary) than there is no problem.

If you are using different versions for each application (and there is a good chance you should, or at least be able to, to allow upgrading the version only for a single service), you can use GAC mechanism.

GAC is sort of a centralized storage of a lot of dll's used by .net, and its uniqueness is that you can publish a lot of dll's with the same name that will have different versions or different globalization culture. That way your C# services will find the dlls and load them automatically from GAC, and if you will require to upgrade the dll just for one service, you will only change this reference to point to the new specific version.

You can read about GAC here: https://msdn.microsoft.com/en-us/library/yf1d93sz(v=vs.110).aspx

and how to install assembly (dll) into GAC here: https://msdn.microsoft.com/en-us/library/dkkx7f79(v=vs.110).aspx

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM