Question

I have an ASP.NET application that uses a custom .NET library (a .DLL file). That .DLL file is strongly named. The library has frequent small updates, and I would like to be able to update this .DLL without recompiling the application. The application has to be precompiled because I do not want to give the source of it to my customers (not that it can't be decompiled, but that's besides the point).

Can this be done somehow? Currently I just get an error that the .DLL is of the wrong version.

Was it helpful?

Solution

You can supply them with an updated config file to go with the new dll. This config needs to have a custom version policy redirecting requests from one dll to the other. See this article for more information.


Actually this article has more information on the whole process and the different levels that you can define a version policy at.

OTHER TIPS

You could use reflection to dinamically load the assembly at runtime. Activator.CreateInstance should do the trick.

IMyInterface myObject = (IMyInterface)Activator.CreateInstance( "TheAssemblyName",
                                            "TheTypeName",
                                            null )

If you are using .Net 3.5 you can use the Add-ins and Extensibility. Take a look here: http://msdn.microsoft.com/en-us/library/bb384241.aspx

Maybe you can just put the strongly typed dll's in the gac, end do dll versioning, so the older version will be always available and the new one's will only be used by the new compiled apps, and the older apps will be used their old dll version until they are compiled and deployed again.

Hope this maybe helps.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top