C# update DLL without recompiling the project

2019-04-21 07:07发布

问题:

i have written a small program with a reference to a dll file that will be included in the setup file.

what i still need is a way to update the dll (in case i change some functions), without the need to redownload the whole program again, just replace the dll file ...

is this possible ?

i just read somewhere that i have to update the xml file with the new dll version, but i really need the full steps to update the dll sucessfully ..

any help is really appreciated.. thanks a lot


Update

i really dont know what to say... both ways are really great... thanks a lot for the help... i will test them tongiht and write the answer here ...

thanks again :)

回答1:

If you already distributed your application, you can redirect the assembly binding by configuration.

You can redirect an assembly binding reference to another version of an assembly by using entries in the application or machine configuration files. You can redirect references to .NET Framework assemblies, third-party assemblies, or assemblies of your own application.

http://msdn.microsoft.com/en-us/library/2fc472t2%28VS.71%29.aspx

Another article about Configuring Assembly Binding Redirection.



回答2:

When you add a reference to a DLL, the visual studio takes binds it to the specific version (in case of 'Copy local' is true). Go to visual studio project, select the reference and view properties. You will see a property as 'Specific version'. The value will be true, set it to false. You have got what you wished.



标签: c# dll