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

Error when publishing wpf project using NativeAOT #913

Closed
aianlinb opened this issue Apr 4, 2021 · 2 comments
Closed

Error when publishing wpf project using NativeAOT #913

aianlinb opened this issue Apr 4, 2021 · 2 comments

Comments

@aianlinb
Copy link

aianlinb commented Apr 4, 2021

Output:

1>Failed to load type 'System.Windows.Threading.DispatcherObject' from assembly 'WindowsBase, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'
1>Internal.TypeSystem.TypeSystemException+TypeLoadException: Failed to load type 'System.Windows.Threading.DispatcherObject' from assembly 'WindowsBase, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'
1>   at Internal.TypeSystem.ThrowHelper.ThrowTypeLoadException(ExceptionStringID id, String typeName, String assemblyName)
1>   at Internal.TypeSystem.ResolutionFailure.Throw()
1>   at Internal.TypeSystem.Ecma.EcmaModule.GetObject(EntityHandle handle, NotFoundBehavior notFoundBehavior)
1>   at Internal.TypeSystem.Ecma.EcmaModule.GetType(EntityHandle handle)
1>   at Internal.TypeSystem.Ecma.EcmaType.InitializeBaseType()
1>   at Internal.TypeSystem.Ecma.EcmaType.ComputeTypeFlags(TypeFlags mask)
1>   at Internal.TypeSystem.TypeDesc.InitializeTypeFlags(TypeFlags mask)
1>   at ILCompiler.Metadata.Transform`1.HandleType(TypeDesc type)
1>   at ILCompiler.Metadata.Transform`1.InitializeTypeDef(MetadataType entity, TypeDefinition record)
1>   at ILCompiler.Metadata.EntityMap`2.Create[TConcreteEntity,TConcreteRecord](TConcreteEntity entity, Action`2 initializer)
1>   at ILCompiler.Metadata.Transform`1.HandleType(TypeDesc type)
1>   at ILCompiler.Metadata.MetadataTransform.Run[TPolicy](TPolicy policy, IEnumerable`1 modules)
1>   at ILCompiler.GeneratingMetadataManager.ComputeMetadata[TPolicy](TPolicy policy, NodeFactory factory, Byte[]& metadataBlob, List`1& typeMappings, List`1& methodMappings, List`1& fieldMappings, List`1& stackTraceMapping)
1>   at ILCompiler.UsageBasedMetadataManager.ComputeMetadata(NodeFactory factory, Byte[]& metadataBlob, List`1& typeMappings, List`1& methodMappings, List`1& fieldMappings, List`1& stackTraceMapping)
1>   at ILCompiler.DependencyAnalysis.MetadataNode.GetData(NodeFactory factory, Boolean relocsOnly)
1>   at ILCompiler.DependencyAnalysis.ObjectWriter.EmitObject(String objectFilePath, IEnumerable`1 nodes, NodeFactory factory, ObjectWritingOptions options, IObjectDumper dumper)
1>   at ILCompiler.RyuJitCompilation.CompileInternal(String outputFile, ObjectDumper dumper)
1>   at ILCompiler.Compilation.ILCompiler.ICompilation.Compile(String outputFile, ObjectDumper dumper)
1>   at ILCompiler.Program.Run(String[] args)
1>   at ILCompiler.Program.Main(String[] args)
1>""C:\Users\ianli\.nuget\packages\runtime.win-x64.microsoft.dotnet.ilcompiler\6.0.0-preview.4.21203.1\tools\ilc" @"obj\x64\Debug\net5.0-windows\win-x64\native\VisualGGPK2.ilc.rsp"" 命令以返回碼 1 結束。
@hez2010
Copy link

hez2010 commented Apr 5, 2021

NativeAOT compiler doesn't support COM interop yet so WPF project won't get compiled currently. See #306.

@MichalStrehovsky
Copy link
Member

Yes, what @hez2010 says. This compilation failure is because the WindowsBase reference ends up being mismatched, but even if we were to fix that, it's going to hit the missing COM at runtime.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants