Vs update result in System.TypeLoadException
I am developing a windows phone 8.1 sdk
When I use vs 2013 update 3 the code works and I can run my demo.
but yesterday,, I update vs 2013 to version 4 and then throw System.TypeLoadException
below:
var swapChainPanel = new SwapChainPanel();
Children.Add(swapChainPanel);
var res = new CXMapResource("", "");
cxEngine = new CXMapEngine(res);
The CXMapResource type is a Windows Runtime Component type written in C ++
and the first winrt type loaded into my code
I set a breakpoint before this line, it goes here and then continue, then fail,
Exit:
A first chance exception of type 'System.TypeLoadException' occurred in Com.AMap.winmd
A first chance exception of type 'System.Exception' occurred in WP8.1Demo.ni.EXE
Update 2014 11 18 16:08
System.TypeLoadException was unhandled by user code
HResult=-2146233054
Message=Requested Windows Runtime type 'WinRTDXMapLib.CXMapResource' is not registered.
Source=mscorlib
TypeName=WinRTDXMapLib.CXMapResource
StackTrace:
at System.StubHelpers.StubHelpers.GetWinRTFactoryObject(IntPtr pCPCMD)
at WinRTDXMapLib.CXMapResource..ctor(String EngineResourcePath, String ShaderResourcePath)
at Com.AMap.Maps.Core.AmapSharpEngine..ctor()
at Com.AMap.Api.Maps.AMapControl..ctor()
at WP8._1Demo.MainPage..ctor()
at WP8._1Demo.WP8_1Demo_XamlTypeInfo.XamlTypeInfoProvider.Activate_0_MainPage()
at WP8._1Demo.WP8_1Demo_XamlTypeInfo.XamlUserType.ActivateInstance()
InnerException: System.Runtime.InteropServices.COMException
HResult=-2147221164
Message=Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG))
ErrorCode=-2147221164
InnerException:
I will let my college run the same code in a release update to September 2 and it works let me know what might be causing this issue, give me some hints, thanks!
Now it works!
source to share
Unfortunately we have the same issue with update 4, it has to do with referencing the winmd component (C ++). We have a problem with the SmoothStreaming SDK for Windows 8.1.
We got to Microsoft, but there is no answer yet.
The employee resolved this issue by reinstalling Windows and Visual Studio. It then upgraded to version 3. (Just uninstalling update 4 didn't work for it) I would rather avoid this "solution", but if there is no fix next week, I should probably take the next steps.
Update
Microsoft answered my issue that they will fix this issue in update 5. https://connect.microsoft.com/VisualStudio/Feedback/Details/1036072
source to share
Discussion of this issue:
Result of Vs update to System.TypeLoadException, was this a VS bug?
VS2013 Update 4: TypeLoad Exception when referencing a winmd component (C ++)
Connect: TypeLoadException when referencing WinMD C ++ component
I can reproduce this issue on Connect:
you cannot create constructor with parameter in winrt c ++ component
***** you can see my demo project here (app): *****
Result of Vs update in System.TypeLoadException
source to share