-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for auto loading UNC paths #794
Support for auto loading UNC paths #794
Conversation
…th Uri.LocalPath in order to support UNC paths.
Hi, thanks for this PR. But I have to check this, AFAIK the LocalPath gave issues with ASP.Net (it would return the cached files path), so we can't use it. See mikeobrien@9032367 |
Is the issue not resolved by removing |
Unless I'm totally missing something, I'm not seeing how
In both implementations the path passed in is
A quick test (passing in the path directly instead of the assembly): GetNLogAssemblyLocation("file://c:/folder/")
.ShouldEqual(@"c:\folder"); <-- Succeeds
GetNLogAssemblyLocation("file://server/share/")
.ShouldEqual(@"\\server\share"); <-- Fails: Returns \share
new Uri("file://c:/folder/").LocalPath
.ShouldEqual(@"c:\folder\");
new Uri("file://server/share/").LocalPath
.ShouldEqual(@"\\server\share\"); I did a manual test under IIS where the site was under a UNC path to verify and it worked a treat. |
Yes you are right. I had to check this (difficult on mobile) - and I looks good. So this is a good change 👍 |
Support for auto loading UNC paths
It's work fine on win7 now, but I still got exception on my winxp. On line 275
got exception
It's seem Assembly.LoadFrom will add "file://" on winxp. |
Winxp.... |
I found the solution.
with
There may be not because of winxp, but security permission settings of SMB/CIFS. |
But did you get a securityException before? |
Actually I didn't get securityException.
|
Re. #793, the
GetNLogAssemblyLocation
method does not support UNC paths. This can simply be replaced withUri.LocalPath
which does.