Skip to content
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

[5.0.100-rc.2.20464.10] Single File launch failed for MultiRPC app after retarget .NET5 #42363

Closed
jiangzeng01 opened this issue Sep 17, 2020 · 5 comments
Assignees
Milestone

Comments

@jiangzeng01
Copy link
Contributor

Application Name: MultiRPC
OS: Windows 10 RS5
CPU: X64
.NET Build Number: 5.0.100-rc.2.20464.10
App Location: \appcompatsrv\Appcompat\DotNetCore\AppSource\SingleFileP0AppsTarget5\Apps\MultiRPC
App Source: \appcompatsrv\Appcompat\DotNetCore\AppSource\SingleFileP0AppsTarget5\AppSources\MultiRPC
DevDiv bug: https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1215391

Repro steps:
Target .NET5
Single File exe was created by
dotnet publish MultiRPCCore.csproj -r win-x64 -p:PublishSingleFile=true --self-contained true
using 5.0.100-rc.2.20464.10 SDK

Copy '\appcompatsrv\Appcompat\DotNetCore\AppSource\SingleFileP0AppsTarget5\Apps\MultiRPC' to local machine.
Double-click on MultiRPC.exe

Expected Result:
Open MultiRPC successful.

Actual Result:
The MultiRPC cannot be launched successful.

Findings :
The Self-contained and Framework-Dependency app can be launched. Only the Single file unable to launch.

Exception from Event View :

Application: MultiRPC.exe
CoreCLR Version: 5.0.20.46205
.NET Version: 5.0.0-rc.2.20462.5
Description: The process was terminated due to an unhandled exception.
Exception Info: System.Windows.Markup.XamlParseException: 'Set property 'System.Windows.ResourceDictionary.Source' threw an exception.' Line number '9' and line position '18'.
 ---> System.ArgumentNullException: Value cannot be null. (Parameter 'baseUri')
   at System.Uri..ctor(Uri baseUri, String relativeUri)
   at MS.Internal.AppModel.ContentFilePart.GetStreamCore(FileMode mode, FileAccess access)
   at System.IO.Packaging.PackagePart.GetStream(FileMode mode, FileAccess access)
   at MS.Internal.IO.Packaging.PackagePartExtensions.GetSeekableStream(PackagePart packPart, FileMode mode, FileAccess access)
   at System.IO.Packaging.PackWebResponse.CachedResponse.GetResponseStream()
   at System.IO.Packaging.PackWebResponse.GetResponseStream()
   at System.IO.Packaging.PackWebResponse.get_ContentType()
   at MS.Internal.WpfWebRequestHelper.GetContentType(WebResponse response)
   at MS.Internal.WpfWebRequestHelper.GetResponseStream(WebRequest request, ContentType& contentType)
   at System.Windows.ResourceDictionary.set_Source(Uri value)
   at System.Windows.Baml2006.WpfSharedBamlSchemaContext.<>c.<Create_BamlProperty_ResourceDictionary_Source>b__342_0(Object target, Object value)
   at System.Windows.Baml2006.WpfKnownMemberInvoker.SetValue(Object instance, Object value)
   at MS.Internal.Xaml.Runtime.ClrObjectRuntime.SetValue(XamlMember member, Object obj, Object value)
   at MS.Internal.Xaml.Runtime.ClrObjectRuntime.SetValue(Object inst, XamlMember property, Object value)
   --- End of inner exception stack trace ---
   at System.Windows.Markup.XamlReader.RewrapException(Exception e, IXamlLineInfo lineInfo, Uri baseUri)
   at System.Windows.Markup.WpfXamlLoader.Load(XamlReader xamlReader, IXamlObjectWriterFactory writerFactory, Boolean skipJournaledProperties, Object rootObject, XamlObjectWriterSettings settings, Uri baseUri)
   at System.Windows.Markup.WpfXamlLoader.LoadBaml(XamlReader xamlReader, Boolean skipJournaledProperties, Object rootObject, XamlAccessLevel accessLevel, Uri baseUri)
   at System.Windows.Markup.XamlReader.LoadBaml(Stream stream, ParserContext parserContext, Object parent, Boolean closeStream)
   at System.Windows.Application.LoadComponent(Object component, Uri resourceLocator)
   at MultiRPC.App.InitializeComponent()
   at MultiRPC.App.Main()

cc @dotnet-actwx-bot

@Dotnet-GitSync-Bot Dotnet-GitSync-Bot added the untriaged New issue has not been triaged by the area owner label Sep 17, 2020
@ghost
Copy link

ghost commented Sep 17, 2020

Tagging subscribers to this area: @agocke
See info in area-owners.md if you want to be subscribed.

@jiangzeng01
Copy link
Contributor Author

There is another issue for this app when target default 3.x.
Which is different with this issue:
#41091

@LakshanF
Copy link
Contributor

LakshanF commented Sep 17, 2020

This issue is also by design for SingleFile.

As shown in the exception stack above, (at System.Uri..ctor(Uri baseUri, String relativeUri)),

the baseUri parameter is null due to Assembly.Codebase being called to create a Uri which we throw for SingleFile here since the Assembly is loaded from memory. The Uri file is created at ContentFilePart here, where the exception is swallowed unfortunately.

@LakshanF LakshanF removed the untriaged New issue has not been triaged by the area owner label Sep 21, 2020
@LakshanF LakshanF added this to the 6.0.0 milestone Sep 21, 2020
@Sewer56
Copy link
Contributor

Sewer56 commented Sep 21, 2020

Seems to be a duplicate of dotnet/wpf#3516

@LakshanF LakshanF assigned VSadov and unassigned LakshanF Jul 21, 2021
@VSadov
Copy link
Member

VSadov commented Jul 22, 2021

Yes, this is a duplicate of dotnet/wpf#3516

@VSadov VSadov closed this as completed Jul 22, 2021
@ghost ghost locked as resolved and limited conversation to collaborators Aug 21, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants