I have a solution with multiple projects.
Its build in .NET Core 2.2 and uses for example .NET EF.
When calling a async method the debugger stops, no exception, try.. catch around it doesn't catch the error, debugger goes direct to the end of the console application. Cleaned up all bin/obj folders, removed .vs folder, checked all nuget packages for updates.
The code where it stopped it this moment is where I query EF async.
But before this I got the same error while executing other async functions of web-requests. All thirdparty libraries from Microsoft. After adding .wait() or .result the problem is solved and I can contine.
tRepository.Queryable().Where(q => q.Tenant.Guid == iBaseTenant.Guid).ToListAsync();
The program '[17052] dotnet.exe' has exited with code 0 (0x0).
The program '[17052] dotnet.exe: Program Trace' has exited with code 0 (0x0).
Found the solution, I forgot to add a await on a higher level. This function itself had the await, but the function calling this function was executed via a foreach loop where this did't wait for the result of all those items.
So when you have the same issue, please check if ALL levels have the await.
Related
I am using OpenCvSharp4 4.1.0.20190416 and function for deep neural networks.
...
mDnn.SetInput(blob, "data");
// get output layer name
var outNames = mDnn.GetUnconnectedOutLayersNames();
// create mats for output layer
Mat[] outs = outNames.Select(_ => new Mat()).ToArray();
// Run dnn
mDnn.Forward(outs, outNames);
...
When during debugging step over the mDnn.Forward row, after while application crashed with access violation. But calling mDnn.Forward returns results without any problem. I don't have any idea, where could be problem.
Program Trace' has exited with code 0 (0x0).
has exited with code -1073741819 (0xc0000005) 'Access violation'.
Ok, I have found solution. It seems that everything can be solved by enabling
"Enable native code debugging" property in project properties at debug tab.
UPDATE
After enabling this property, application crash on different error.
Finally the problem was in Intel Graphic driver version:24
I have to uninstall the driver and everything is ok.
Uninstallation process
When a client hits PUT endpoint on my Web API, and that endpoint produces any kind of exception, the whole Kestrel breaks down.
Visual Studio prints out:
The application is in break mode
Your app has entered a break state, but there is no code to show because all threads were executing external code (typically system or framework code).
After I click on Continue Execution Application shuts down with message:
The program '[5364] dotnet.exe' has exited with code 0 (0x0).
The interesting thing is if I do the same thing with POST endpoint the exception gets caught in my ExceptionFilter or my ErrorHandlingMiddleware (as I've tried both with same success) and the application continues running as expected.
So this gets caught:
[HttpPost]
public async void Post(SomeModel model)
{
throw new Exception();
}
While this shuts down the application:
[HttpPut]
public async void Put(SomeModel model)
{
throw new Exception();
}
I've tried clearing Nuget cache, deleting bin folder, running the application on Mac and on Windows, updating .net Core SDK and Runtime and probably few other things I found online for vaguely similar issues but without any success.
My application was running on Kestrel, .NET Core SDK 2.1.302, Runtime 2.1.2. I've since upgraded to .NET Core SDK 2.1.401, Runtime 2.1.3 but it made no difference. Same story running it on IIS Express
I have developed an C#.Net console application using Telegram Bot API.
The ProcessUpdates.cs file is now approximately 2.11Mb and has around 30500 line of code.
I am getting the following error, when I trying build the project:
unexpected error writing debug information -- insufficient memory to continue to execution of the program.
I've found only one instance of this error in This Link, But I did not get any results of its response.
Using Visual Studio 2015 Update-2 in Windows 10 x64 with 8Gb of memory.
I used the 'Release' Instead 'Debug' the problem is solved now, but I'm not sure again later cause problems or not.
I had a 77k Lines program source within VS2017 which caused the same error.
The offending source was generated using a program that I wrote.
I solved the issue in splitting up a 50k lines C# method the source contained, by adding these 6 lines around a 23K lines code block within the method:
#if DEBUG
void myOffendingCodeBlock() {
#endif
... // the original code
#if DEBUG
} myOffendingCodeBlock();
#endif
Clearly, this will only work when there are no goto's that jump out of the code block.
I have built a web app which suddenly stops while running. I could see the following in output window in my VS
The program '[29000] iisexpress.exe: Managed (v4.0.30319)' has exited with code -1073741819 (0xc0000005) 'Access Violation'
The program '[20648] iexplore.exe' has exited with code -1 (0xffffffff).
I have tried to debug to find the line where it fails. But it did not fail anywhere. The page was successfully loaded and it stops running after few seconds.
Check out the answers for this question.
You can try cleaning the solution/project and making sure you delete ASP.NET temporary files.
I noticed your error includes detail regarding IExplore.exe; makes me wonder if the debug process is unable to launch Internet Explorer due to something blocking that invocation. Try temporarily turning off Windows Firewall or any Anti-Virus program and make sure User Account Control (or LUA if on Windows Server) is disabled.
I try to install Async CTP and it says that installation was completed successfully, but nothing installs into "My Documents" and i cant find the samples. What can be done to see the samples with libraries and try them?
Do you have another machine you can install on at all?
My netbook didn't accept the CTP installation properly, but it did do enough magic to the C# compiler to make that part work. I then just copied AsyncCtpLibrary.dll from another machine where the installation had worked, and all was fine. If you want to copy the samples as well, I'm sure they'd work too.
If this turns out to be a common problem, I suggest we ask for permission to publish a zip file with the samples and library.
Here's a short program to let you see if you've got the C# compiler bits installed:
public class Test
{
static async void Main() {}
}
That should fail with an error like this:
Test.cs(4,22): error CS0656: Missing compiler required member
'System.Runtime.CompilerServices.VoidAsyncMethodBuilder.Create'
Test.cs(4,22): error CS1993: Cannot find Task-related types. Are you missing a
reference to 'AsyncCtpLibrary.dll' ?
Test.cs(4,22): warning CS1998: This async method lacks 'await' operators and
will run synchronously. Consider using the 'await' operator to await
non-blocking API calls, or 'await TaskEx.Run(...)' to do CPU-bound work
on a background thread
What worked for me is to extract the contents of the setup program with Universal Extractor then run VS10-KB0000001.msp. It installs the samples, documentation, and patch.
Here's a short program to let you see if you've got the C# compiler bits installed:
Test.cs(4,22): error CS0656: Missing compiler required member 'System.Runtime.CompilerServices.VoidAsyncMethodBuilder.Create'
Thats exactly what I got a, after the CTP refresh, and MVC3 install. Tried removing MVC3 again and un/install the CTP, but the problem remains. Why would the install not correctly update the compiler?
Tnx