The Demo example of RocketMQ in .NET SDK throwing System.TypeInitializationException exception - rocketmq

I am running the Demo Example given for .NET SDK RocketMQ. https://help.aliyun.com/document_detail/29561.html?spm=5176.doc29561.3.3.nIAzgT
But it is throwing the below exception.
An unhandled exception of type 'System.TypeInitializationException'
Additional information: The type initializer for 'ons.ONSClient4CPPPINVOKE' threw an exception.
I am not getting any solution for the issue.Can anyone please give a solution for the exception.

Make sure ONSClient4CPP.dll and ONSClient4CPP.lib in bin folder and vc++ 2015 is installed.

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.

AdobeGlyphList.txt loading error: The type initializer for 'iText.IO.Util.ResourceUtil' threw an exception

I use the iText7 component for extracting text from PDF on dotnet core 3, but for no apparent reason I started to receive the following error message: AdobeGlyphList.txt loading error: The type initializer for 'iText.IO.Util.ResourceUtil' threw an exception.
The error occurs on the highlighted line.
This worked for me. Before you get to that line of code you first need to enable the
Common Language Runtime Exception
in visual studio as shown
This will throw the actual error message causing this. In my case it was a library that was being referenced by itext that was missing. I guess because of .Net core or some other reason not sure why.
I searched for the dll and referenced it in my solution and it worked
Installing NuGet Microsoft.DotNet.PlatformAbstractions worked for me.

Vs update result in System.TypeLoadException

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

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

Visual Studio strange startup exception

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.

Resources