I have following requirement,
- I have C#/.Net console application, which refers to ‘System.Data.Sqlite.dll’
- ‘System.Data.Sqlite.dll’ is not registerd in GAC (i don’t want to)
-
I don’t want to keep it in the directory where the Executable(.exe) is kept.
-
How can i keep the ‘System.Data.Sqlite.dll’ file at some other directory , and load it safely at runtime, before its getting referenced in application code ?
you can use manual assembly resolution to do this.
You need to provide a delegate to the AssemblyResolve event in the current AppDomain
when the application has any assembly references that it can’t resolve it will call this delegate to get the assembly resolved.
You can then simply return the assembly requested from the delegate:
hope this helps