英文:
Xamarin UWP Failure has occurred while loading a type only on release build
问题
I try to build my Xamarin UWP app but i get the error
在尝试构建我的Xamarin UWP应用程序时,我遇到了错误:
Failure has occurred while loading a type only on release build
仅在发布版本构建时发生了类型加载失败。
I do not know what is the problem, i have a similar UWP app in the Solution and this is work. Both has the same cpl project.
我不知道问题是什么,我的解决方案中有一个类似的UWP应用程序,它可以正常工作。两者都使用相同的cpl项目。
I check also all package versions to rule out mismatches as described here:
Link
我还检查了所有包的版本,以排除与此处描述的不匹配:
the stacktrace in the appcenter doesn't really say anything:
在AppCenter中的堆栈跟踪实际上没有提供任何信息:
System.Runtime.InteropServices
McgMarshal.ThrowOnExternalCallFailed (Int32, RuntimeTypeHandle)
__Interop
ComCallHelpers.Call (__ComObject, RuntimeTypeHandle, Int32, Type__Impl.UnsafeType,
Void*, Void*)
Windows.UI.Xaml.Controls.IFrame__Impl
Stubs.Navigate (__ComObject, Type, Object)
__Interop
Intrinsics.HasThisCall__31[TArg0] (Object, IntPtr, Object, TArg0)
ch.mycompany.myapp.windows!<BaseAddress>+0x3f1b790
和
System.Runtime.InteropServices
McgMarshal.ThrowOnExternalCallFailed (Int32, RuntimeTypeHandle)
__Interop
ComCallHelpers.Call (__ComObject, RuntimeTypeHandle, Int32, Type__Impl.UnsafeType,
Void*, Void*)
Windows.UI.Xaml.Controls.IFrame__Impl
Stubs.Navigate (__ComObject, Type, Object)
MyCompany.App.ProjectUWP
App.OnLaunched (LaunchActivatedEventArgs)
System.Collections.ObjectModel.ReadOnlyObservableCollection 1.System.Collections.Specialized INotifyCollectionChanged.add_CollectionChanged (NotifyCollectionChangedEventHandler) ch.mycompany.myapp.windows!<BaseAddress>+0x3f5af8e System.Runtime.InteropServices McgMarshal.ThrowOnExternalCallFailed (Int32, RuntimeTypeHandle) __Interop ComCallHelpers.Call (__ComObject, RuntimeTypeHandle, Int32) __Interop ForwardComStubs.Stub_15[TThis] (__ComObject, Int32) Microsoft.AppCenter.Utils ApplicationLifecycleHelper.<ctor>b__17_1 (Object, UnhandledErrorDetectedEventArgs) System.Runtime.ExceptionServices ExceptionDispatchInfo.Throw () Microsoft.AppCenter.Utils ApplicationLifecycleHelper.<ctor>b__17_1 (Object, UnhandledErrorDetectedEventArgs) System EventHandler
1.Invoke (Object, TEventArgs)
__Interop
Intrinsics.HasThisCall__31[TArg0] (Object, IntPtr, Object, TArg0)
ch.mycompany.myapp.windows!<BaseAddress>+0x3f1b790
EDIT:
After a few hours of research I found that 2 assemblys are missing in Properties/Default.rd.xml file.
经过几个小时的研究,我发现在Properties/Default.rd.xml文件中缺少2个程序集。
<Assembly Name="Microsoft.Extensions.Options" Dynamic="Required All" />
<Assembly Name="Microsoft.Extensions.Logging" Dynamic="Required All" />
I suspect these were cached locally and were missing during the build on Azure. However, there were no compilation errors.
我怀疑这些程序集在本地缓存,但在Azure上构建时丢失了。但是,没有编译错误。
英文:
I try to build my Xamarin UWP app but i get the error
Failure has occurred while loading a type only on release build
I do not know what is the problem, i have a similar UWP app in the Solution and this is work. Both has the same cpl project.
I check also all package versions to rule out mismatches as described here:
Link
the stacktrace in the appcenter doesn't really say anything:
System.Runtime.InteropServices
McgMarshal.ThrowOnExternalCallFailed (Int32, RuntimeTypeHandle)
__Interop
ComCallHelpers.Call (__ComObject, RuntimeTypeHandle, Int32, Type__Impl.UnsafeType,
Void*, Void*)
Windows.UI.Xaml.Controls.IFrame__Impl
Stubs.Navigate (__ComObject, Type, Object)
__Interop
Intrinsics.HasThisCall__31[TArg0] (Object, IntPtr, Object, TArg0)
ch.mycompany.myapp.windows!<BaseAddress>+0x3f1b790
and
System.Runtime.InteropServices
McgMarshal.ThrowOnExternalCallFailed (Int32, RuntimeTypeHandle)
__Interop
ComCallHelpers.Call (__ComObject, RuntimeTypeHandle, Int32, Type__Impl.UnsafeType,
Void*, Void*)
Windows.UI.Xaml.Controls.IFrame__Impl
Stubs.Navigate (__ComObject, Type, Object)
MyCompany.App.ProjectUWP
App.OnLaunched (LaunchActivatedEventArgs)
System.Collections.ObjectModel.ReadOnlyObservableCollection`
1.System.Collections.Specialized
INotifyCollectionChanged.add_CollectionChanged (NotifyCollectionChangedEventHandler)
ch.mycompany.myapp.windows!<BaseAddress>+0x3f5af8e
System.Runtime.InteropServices
McgMarshal.ThrowOnExternalCallFailed (Int32, RuntimeTypeHandle)
__Interop
ComCallHelpers.Call (__ComObject, RuntimeTypeHandle, Int32)
__Interop
ForwardComStubs.Stub_15[TThis] (__ComObject, Int32)
Microsoft.AppCenter.Utils
ApplicationLifecycleHelper.<ctor>b__17_1 (Object, UnhandledErrorDetectedEventArgs)
System.Runtime.ExceptionServices
ExceptionDispatchInfo.Throw ()
Microsoft.AppCenter.Utils
ApplicationLifecycleHelper.<ctor>b__17_1 (Object, UnhandledErrorDetectedEventArgs)
System
EventHandler`1.Invoke (Object, TEventArgs)
__Interop
Intrinsics.HasThisCall__31[TArg0] (Object, IntPtr, Object, TArg0)
ch.mycompany.myapp.windows!<BaseAddress>+0x3f1b790
EDIT:
After a few hours of research I found that 2 assemblys are missing in Properties/Default.rd.xml file.
<Assembly Name="Microsoft.Extensions.Options" Dynamic="Required All" />
<Assembly Name="Microsoft.Extensions.Logging" Dynamic="Required All" />
I suspect these were cached locally and were missing during the build on Azure. However, there were no compilation errors.
答案1
得分: 0
2个程序集在Properties/Default.rd.xml文件中缺失导致了错误。
<Assembly Name="Microsoft.Extensions.Options" Dynamic="Required All" />
<Assembly Name="Microsoft.Extensions.Logging" Dynamic="Required All" />
可能在Azure上构建时丢失。
英文:
Accoring to your Edit, as an answer:
2 assemblys missing in Properties/Default.rd.xml file caused the error.
<Assembly Name="Microsoft.Extensions.Options" Dynamic="Required All" />
<Assembly Name="Microsoft.Extensions.Logging" Dynamic="Required All" />
It may miss during the build on Azure.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论