Skip to content

Commit 9cdfdc3

Browse files
authored
Fix GetEntryAssemblyLocation Uri (#4799)
We do not escape the path string in GetEntryAssemblyLocation method. And it will break when the application in the special path, such as the path contains a `#`. See #4781
1 parent 4267c95 commit 9cdfdc3

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/Microsoft.DotNet.Wpf/src/PresentationFramework/MS/Internal/AppModel/ContentFilePart.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,7 @@ protected override Stream GetStreamCore(FileMode mode, FileAccess access)
7373
BaseUriHelper.GetAssemblyNameAndPart(Uri, out filePath, out assemblyName, out assemblyVersion, out assemblyKey);
7474

7575
// filePath should not have leading slash. GetAssemblyNameAndPart( ) can guarantee it.
76-
Uri file = new Uri(codeBase, filePath);
77-
_fullPath = file.LocalPath;
76+
_fullPath = System.IO.Path.Combine(codeBase.LocalPath, filePath);
7877
}
7978

8079
stream = CriticalOpenFile(_fullPath);

0 commit comments

Comments
 (0)