I am developping 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 my vs 2013 to update 4,then throw a System.TypeLoadException
code details below:
var swapChainPanel = new SwapChainPanel();
Children.Add(swapChainPanel);
var res = new CXMapResource("", "");
cxEngine = new CXMapEngine(res);
Type CXMapResource is a windows runtime component type written by c++
and it is the first winrt type I load in my code
I set a break point before this line,it goes here,and then continue,then crash,
output:
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 at 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 let my college run the same code in vs 2013 update 2,and it works
please tell me what might result in this problem,give me some advice,Thanks!!
It works now!
VS 2013 UPDATE5 CTP2
Unfortunately we have the same problem with Update 4, this is probaly caused by referencing a winmd (C++) component.
We have the problem with the SmoothStreaming SDK for Windows 8.1.
We have reached to Microsoft but no answer yet.
A colleague solved this problem by reinstalling Windows and Visual Studio. Then he updated to Update 3. (Just removing the update 4 didn't work for him)
I rather avoid this 'solution' but if there is no hotfix next week, I probaly have to do these steps.
Update
Microsoft answered my issue that they will fix this problem in Update 5.
https://connect.microsoft.com/VisualStudio/Feedback/Details/1036072
Discussion about this problem:
Vs update result in System.TypeLoadException,was it a bug of VS?
VS2013 Update 4: TypeLoad Exception when referencing a winmd (C++) component
Connect: TypeLoadException when referencing a winmd C++ component
I am able to reproduce this problem at Connect:
you can't create a constructor with param in c++ winrt component
*****you can see my demo project here(attachment):*****
Vs update result in System.TypeLoadException
Related
I open up VisualStudio 2017 (latest - just updated). I navigate to a type script file (this might just be coincedence that it's this type of file) and I get the following prompt:
---------------------------
Microsoft Visual Studio
---------------------------
An exception has been encountered. This may be caused by an extension.
You can get more information by examining the file
'C:\...\AppData\Roaming\Microsoft\VisualStudio\15.0_c4122470\ActivityLog.xml'
In my activity log, I get quite a few warnings about packages:
Unexpected system error mode before loading package <enter package name here>
The real kicker is at the end of the file I get an error:
System.NullReferenceException: Object reference not set to an instance of an object.
at
Microsoft.WindowsAzure.StreamAnalytics.UI.ViewModel.JavaScriptFunctionViewModel.GetJSFunctionInputsCount()
at
Microsoft.WindowsAzure.StreamAnalytics.UI.ViewModel.JavaScriptFunctionViewModel.Initialize(JSFunctionInfo configInfo)
at
Microsoft.WindowsAzure.StreamAnalytics.UI.ViewModel.JavaScriptFunctionViewModel.InitializeForEditor()
at
Microsoft.WindowsAzure.StreamAnalytics.UI.ViewModel.JavaScriptFunctionViewModel..ctor(String jsFilePath, Action saveJsFile, Action setJsFileDirty)
at
Microsoft.Cosmos.ScopeStudio.VsExtension.EditorMarginExtension.JavascriptEditorMargin..ctor(IWpfTextViewHost textViewHost)
at
Microsoft.Cosmos.ScopeStudio.VsExtension.EditorMarginExtension.JavascriptEditorMarginFactory.CreateMargin(IWpfTextViewHost wpfTextViewHost, IWpfTextViewMargin marginContainer)
at
Microsoft.VisualStudio.Text.Utilities.ContainerMargin.<AddMargins>b__25_1(IWpfTextViewMarginProvider mp)
at
Microsoft.VisualStudio.Text.Utilities.GuardedOperations.InstantiateExtension[TExtension,TMetadata,TExtensionInstance](Object errorSource, Lazy`2 provider, Func`2 getter)
--- End of stack trace from previous location where exception was thrown ---
at
Microsoft.VisualStudio.Telemetry.WindowsErrorReporting.WatsonReport.GetClrWatsonExceptionInfo(Exception exceptionObject)
I have tried:
Clearing the temp folder
Clearing the Model Cache inside the VS folder
Updating packages
Updating extensions
Nothing seems to help. Does anyone have a thought as to what would be causing this?
Error in Visual Studio… Extension loading issue
According to the error info "An exception has been encountered. This may be caused by an extension.", you can try to run the VS with safe mode using the command: devenv /safemode, if it works fine, that means the installed extensions caused this issue. Since I could not know which specified extension causes this issue based on the error log, you can try to remove/uninstall the installed extensions one by one to find the culprit.
Besides, you can also try to run visual studio as administrator and update the Visual Studio 2017 to latest version.
Hope this helps.
It appears the bug or issue is cause by the back ticks in your JS or TS code, which were present in the files I was working in.
` <- back tick
Here is a thread in the VS developer community describing the issue and a potential solution.
NullReferenceException after opening javascript file
Solution For Me:
I had to upgrade to VS version 15.8.1 (For me ,the bug was still in version 15.8.0, which is what I was using when I posted the question). This version just got released.
So far things are working properly.
I run into Visual Studio and I get an error and ask a question.
I installed POWERVRSDK_2017 and ran OGLESHelloAPI.sln which is a sample file after installation. After the execution, the program was terminated with no response because it was executed after the build without touching the code.
The error occurred in DynamicEgl.h when debugging was executed, and the error content was 'Unhandled exception at 0x760BB3E5 in OGLESHelloAPI.exe: 0xC0000005: Access violation executing location 0x00000000.'
"DynamicEgl.h"
inline EGLDisplay DYNAMICEGL_FUNCTION(GetDisplay)(EGLNativeDisplayType display_id){
typedef EGLDisplay(EGLAPIENTRY * PROC_EGL_GetDisplay)(EGLNativeDisplayType display_id);
static PROC_EGL_GetDisplay _GetDisplay = (PROC_EGL_GetDisplay)::egl::internal::getEglFunction(::egl::internal::EglFuncName::GetDisplay);
return _GetDisplay(display_id);
}
I attached the code. _GetDisplay seems to check for errors, but I do not understand.
How can we solve this problem? Thank for your advise
When I installed powerVR, I clicked Accept Path setting during the installation process and finally it worked normally. I used visual studio 2017.
We are utilizing Microsoft Fakes with Visual Studio 2013. After updating to Visual Studio 2013 Update-4 or Update-5, we are getting ShimNotImplementedException's in our tests.
We have followed instructions found in other SOF questions and turned off the SpecificVersion of our Microsoft.QualityTools.Testing.Fakes references. This allows a compile but the tests still fail when run.
The hint we needed to solve this was found in MSDN forums.
The underlying issue is that the legacy tests did not define specific methods
on the ShimXXX object that the code based is using. Under version 11
all is well; version 12 is a different matter.
The stack trace for the ShimNotImplementedException gave the needed information on the missing property/method:
Microsoft.QualityTools.Testing.Fakes.Shims.ShimNotImplementedException
at $Func`2NotImplementedf5b9281e-32b0-4bf3-9079-6a54470670de.Invoke(SiteContext arg1)
at Sitecore.Sites.SiteContext.get_Database() //THIS IS THE PROBLEM PROPERTY
at Sitecore.Ecommerce.ShopContext..ctor(SiteContext innerSite)
at ActiveCommerce.UnitTest.ProductStockManagerTests.get_MockShopContext()
at ActiveCommerce.UnitTest.ProductStockManagerTests.GetAvailability_AlwaysInStock()
Adding the missing property to our shim construction solved the issue:
return new Sitecore.Ecommerce.ShopContext(new ShimSiteContext
{
PropertiesGet = () => new NameValueCollection(),
DatabaseGet = () => null //ADDING THIS SOLVED THE ISSUE
});
I ran in to a similar problem after upgrading several of our projects from .NET 4 to .NET 4.5.2 using Visual Studio 2015. All the sudden several previously passing tests started failing. The common denominator was that all of the tests were using Shims to mock registry access.
What appears to have happened is that something changed in the handling of the Dispose method. Originally I had not implemented a Dispose method on the RegistryKey shims. That didn't seem to cause any trouble running under .NET 4. However after the switch to 4.5.2, it is implicitly being called all the time.
The solution was simple: I just added a stub for Dispose.
Microsoft.Win32.Fakes.ShimRegistryKey.AllInstances.Dispose = (key) => { };
The tests now pass again.
Note that setting it to NULL did not solve it for it. There has to be a method.
I'm trying to use ros in cpp with Visual Studio 2012. I wrote the publisher and subscriber tutorial (http://wiki.ros.org/ROS/Tutorials/WritingPublisherSubscriber%28c%2B%2B%29) and first, I configure the project as says in the guide (http://wiki.ros.org/win_ros/hydro/Msvc%20SDK%20Projects).
Then i compiled an linked the publisher, but when I tried to run it, ros::init(argc,argv,"talker") throws an exception... The console says that I ROS_MASTER_URI is not defined but I've got it defined
There are 2 images here:
https://www.dropbox.com/s/o12m0l38gaxiugi/error1.png -
https://www.dropbox.com/s/ocdmf0wj6rj0962/error.png
Can anyone helps me?
Thanks in advance
So, I had the same issue, although I didn't set the ROS_MASTER_URI globally.
I managed to get around this specific issue by adding
ROS_MASTER_URI=http://localhost:11311
to the debugging environment variables (Project->Properties->Configuration Properties->Debugging->Environment).
However, after implementing the above I got an uncaught exception (Unhandled exception at 0x768bc41f in ros_demo.exe: Microsoft C++ exception: std::bad_alloc at memory location 0x0028f0e4..).
That went away when I built, compiled and ran the project in release mode (which matched my ROS SDK build).
I got the idea for the release/debug build from here:
xstring isn't an OSG specific object, so the error is elsewhere in the
3rd party dependency chain. As I know nothing about your OS and
software setup I can't speculate what this might be.
In general though this type of error could well be a linking issue -
for instance Visual Studio is hopeless at handling different libs
being built debug and release and will crash randomly.
That was fun to discover..
Tools
jquery.maskedinput-1.3.min.js (DigitalBush)
Visual Studio 2012 SP1
.NET Framework 4.5
MVC Runtime v4.0.30319
Windows 7
IE 9 64-bit
jquery/1.7.1/jquery.min.js
The full panoply of References MS supplies with a new Web MVC project
Issue
I had been successfully using the maskedInput until very recently. Now I get the error:
0x800a01b6 - Microsoft JScript runtime error: Object doesn't support property or method 'mask'
I have two elements, one for 10 digits and one for 4, displaying and hiding them as needed. The error occurs during page initialization on the first line of the function under Pager initialization. Microsoft JS complains that 'mask' is undefined. Here is my code.
I don't know what has happened to cause the non-recognition of the mask. I have tried reordering the placement of the maskedInput among other scripts. I wonder if this plugin is now incompatible with the progressive, frenetic changes in nearly every aspect of web development. Does anyone have an idea of what might be going on and its resolution?
Thanks in advance for any help.
Never Mind! I had a Homer moment! I ported the app to VS 2012 , but neglected to update that reference link! Apologies!