Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ protected override Stream GetStreamCore(FileMode mode, FileAccess access)
// File name will be a path relative to the applications directory.
// - We do not want to use SiteOfOriginContainer.SiteOfOrigin because
// for deployed files the <Content> files are deployed with the application.
Uri codeBase = GetEntryAssemblyLocation();
string location = GetEntryAssemblyLocation();

string assemblyName, assemblyVersion, assemblyKey;
string filePath;
Expand All @@ -73,8 +73,7 @@ protected override Stream GetStreamCore(FileMode mode, FileAccess access)
BaseUriHelper.GetAssemblyNameAndPart(Uri, out filePath, out assemblyName, out assemblyVersion, out assemblyKey);

// filePath should not have leading slash. GetAssemblyNameAndPart( ) can guarantee it.
Uri file = new Uri(codeBase, filePath);
_fullPath = file.LocalPath;
_fullPath = System.IO.Path.Combine(System.IO.Path.GetDirectoryName(location), filePath);
}

stream = CriticalOpenFile(_fullPath);
Expand Down Expand Up @@ -103,15 +102,13 @@ protected override string GetContentTypeCore()
#region Private Methods


private Uri GetEntryAssemblyLocation()
private string GetEntryAssemblyLocation()
{
Uri entryLocation = null;
string entryLocation = null;

try
{
#pragma warning disable // Type or member is obsolete
entryLocation = new Uri(Application.ResourceAssembly.CodeBase);
#pragma warning restore // Type or member is obsolete
entryLocation = Application.ResourceAssembly.Location;
}
catch (Exception ex)
{
Expand Down