Visual Studio strange startup exception - visual-studio-2010

For some reason VS was not breaking on exception when running in debug mode, so I followed the advice given here to go to Debug -> Exceptions and enable the CLR exceptions. I now get this error:
System.Globalization.CultureNotFoundException occurred
Message=Culture is not supported.
Parameter name: name
uploads is an invalid culture identifier.
Source=mscorlib
ParamName=name
InvalidCultureName=uploads
StackTrace:
at System.Globalization.CultureInfo..ctor(String name, Boolean useUserOverride)
InnerException:
This error occurs on startup, but only some of the time.
The advice here then recommends that I do the exact opposite and uncheck the debug the CLR option, but I am then back to square one! A poster suggests that it is a bug, but the post is two years old, so surely that has been fixed by now.
I am not using globalisation.

Related

Unhandled exception in debugging

During debugging my project, i am getting the an unhandled exception. I am new in debugging using visual studio 2017 , Can anyone give me any approach or idea to remove this exception? Due to this my application crashes. I am attaching the exact exception statement below.
Unhandled exception at 0x76442552 in someprocess.exe: Microsoft C++ exception: std::runtime_error at memory location 0x1C00F258.
Unhandled exception in debugging
Usually, the issue is caused by your code.And from the description, the error is from info.hasException.
Please make sure that when you define info property, you should set a default value to it like NULL;
You should check very carefully and make sure that info has value and its type is right.
Also, please provide a small sample about your project to help us troubleshoot the issue more quickly.

Error in Visual Studio... Extension loading issue

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.

Visual studio 2010 first chance exception KernelBase.dll : 0x000006BA: Win32 exception

I am getting this on a build right after the line that says this:
Loaded 'c:\Windows\SysWOW64\msimg32.dll', Symbols loaded (source information striped).
That is the last thing I see when the program DOES NOT open in debug.
When it DOES open in debug I get the following after that line:
First-chance exception at 0x75f0c42d (KernelBase.dll) in xxx.exe: 0x000006BA: The RPC server is unavailable.
Most of the time I get the first case so I have to keep stopping the debug and starting it until the program comes up with the 2 case.
I have tried setting a break point for that exception from info I found on here already but even if i comment it out, i still get the first case with no program opening for debug.
I have tried using Microsoft Symbol Servers and without.
I am not sure what else to try as I am only getting the program running about 1 tries in 6.

ros::init(...) throws an error - Windows roscpp

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..

Why does Code Analysis not warn about NotImplementedException?

I'm pretty sure that previous versions of Visual Studio Code Analysis warned about the use of NotImplementedException, i.e. any member that contained this
throw new NotImplementedException();
would give a CA warning.
This doesn't seem to be the case with Visual Studio 2008.
Was that particular rule removed, or am I just imagining that it ever existed?
You are probably thinking about this FxCop warning that you get when throwing NotImplementedException from special methods such as a property getter, event accessor, Equals, GetHashCode, Dispose etcetera:
CA1065 : Microsoft.Design :
'SomeClass.SomeProperty.get()'
creates an exception of type
'NotImplementedException', an
exception type that should not be
raised in a property. If this
exception instance might be raised,
use a different exception type,
convert this property into a method,
or change this property's logic so
that it no longer raises an
exception.
However, it is not explicitly related to NotImplementedException. FxCop has white lists for the exceptions that may be (directly) thrown by these methods.
I don't recall ever seeing such a rule in the Microsoft-shipped rule set. It's one of the first custom rules I've created at the day job since at least the days of FxCop 1.35, so I'd have to guess that it harkens back to the days of FxCop 1.32 if it did ever exist...
I know this is an old question, but I'm getting this as a warning (12 Sep 2017), when running Code Analysis, using Visual Studio 2017. It is the "CA1065" code that Wim Coenen mentions, so it seems Microsoft must have ported FxCop rules to the Roslyn-based analysis platform.
Link provided in Error List window
Unfortunately, there isn't such a rule in the standard ruleset.
You can find my implementation of it in one of my other answers.

Resources