开发者

Path to *.dll files in app.config

开发者 https://www.devze.com 2023-03-17 05:06 出处:网络
How can I define the path to *.dll files in .NET application in app.config file? My application use *.dll files stored in ano开发者_Python百科ther computer in local network. Copying these *.dll to my

How can I define the path to *.dll files in .NET application in app.config file? My application use *.dll files stored in ano开发者_Python百科ther computer in local network. Copying these *.dll to my machine isn't good way.


You're going to have problems referencing files across the network in .net as network resources are untrusted.

I think there's a way to specify a machine as a trusted source, but you're going to have to do the configuration changes on every single machine which runs your app.

You're honestly better off writing a wrapper app that copies the dlls to the local folder then launches the main app. You can have it always copy the newest version to the local directory and have that serve as a poor man's distribution service.

Also, you might want to look at click once as it sounds like you're in a controlled environment. I use it on several projects and it works great.


I'm assuming Windows, so it should suffice to add the folder to the PATH variable. For dll search order see also here.

If that doesn't work you can always load the assemblies dynamically via Assembly.Load()

0

精彩评论

暂无评论...
验证码 换一张
取 消