.net core console application throws System.ExecutionEngineException - visual-studio

I have absolutely no idea what's going on. I create a new project of type .net core console application, hit run and get that exception:
System.ExecutionEngineException
Your app has entered a break state, but no code is currently executing
that is supported by the selected debug engine (e.g. only native
runtime code is executing).
It's quite a while ago when I last ran a .net core project on this machine.
More Information:
It happens only in visual studio. If I run the console via cmd everything works fine. Any idea how to find out what is causing this? I suspect maybe a visual studio extension like Roslynator is causing this exception.

After repairing Visual Studio everything works again.

I was using .net core 2.2 on visual studio 2017 when i had this error.
So I tried .net core 3.0 on visual studio 2019 preview.....
voila, it worked... can't explain it, i guess .net core is constantly improving to support legacy code

Related

Jetbrains rider fails to run azure function project, which runs fine in Visual Studio for Mac

I'm trying out Rider but failing at the first hurdle. I have a solution with 2 azure function .Net 6 projects and these run fine in visual studio for Mac, when I load them in rider and try and run one I get:
A fatal error was encountered. The library 'libhostpolicy.dylib' required to execute the application was not found in ...
Of course I could go and try and find libhostpolicy.dylib but I'm reluctant as this runs fine in Visual studio for Mac and I need it to continue to do so. I can't understand why it runs fine in VS but not in Rider. I don't really want to be changing config when it runs in vs for Mac.
Any ideas?
Thanks

Difference between building/running a .Net Core app using Visual Studio and CLI/VS Code

I'm trying to figure out the differences between running/building a .Net core project using Visual Studio and the CLI, i.e. what process does Visual Studio follow when running the project?
I spent half a day yesterday debugging an issue where a static web resource could not be found (404) when I ran the project (both F5 and Ctrl+F5) using Visual Studio - both Debug and Release configs using both IIS Express and Project launch options - only to discover that the problem does not occur when I run the exact same project using VS Code's debugger (F5 or Ctrl+F5) or the CLI (dotnet run) directly. And today I wasted yet another 3 hours when I received a new build error message when building using VS, but the same project built and ran 100% using the CLI and VS Code...
I have a clean development environment with only one SDK that was installed along with VS, so they are both using the same SDK.
Given, I am playing around with .net5.0, so I'm using the latest preview build of VS (Version 16.8.0 Preview 2.0), but as far as I'm concerned, there should not be ANY differences when running a project using VS and the CLI. Unfortunately I cannot replicate the same issue using the stable build since both the problems are related to .net5.0 features (Scoped Styles and Blazor WASM).
Could someone please enlighten me on the steps that VS takes when running a .Net Core Web project? I KNOW it is not simpy using dotnet run as one would expect, so I would like to get as much info before I log yet another tooling issue with the dotnet people...
Any reply would be appreciated.

Can't create a UWP app

I recently, upgraded to Windows 10 and got Visual Studio 2015 Community hoping to build UWP apps and ASP.Net 5 apps. At first, I installed everything, but ended up skipping / canceling the Windows 8.1 / 10 mobile emulators (my PC can't even run them). After everything was installed, I went to create a new UWP app (C#), and got this error:
Next, I try the same thing, but with JavaScript. It works perfectly! on the same UAP 10.0.0.0 that is supposedly missing. The link it provides is completely useless (it sends me to http:/microsoft.com/en-us) -_-. Oddly, this only happens when I try to use C# or VB.Net, JavaScript UWP apps seem to work fine. What is going on here? Where can I find the real link to the SDK I need?
UPDATE
JavaScript UWP apps will be create just fine, but when I attempt to build, I get:
Error "10.0.0.0" is not a supported value forTargetPlatformVersion.
Please change it on the Project Property page. Test
C:\Program Files (x86) \MSBuild\Microsoft\VisualStudio\v14.\JavaScript\Microsoft.VisualStudio.JavaScript.UAP.targets
This is the download link for the standalone SDK, maybe reinstalling the sdk will fix the problem.
https://dev.windows.com/en-us/downloads/windows-10-sdk
Normally you don't always have to reinstall visual studio when something goes wrong because it takes a lot of time to reinstall again. From your question you skipped/cancel that feature, the first thing to do is go to the control panel and double click on visual studio under programs to Modify the software and enable those features.
In the case, visual studio was working properly before but due to some updates it stopped, go to control panel right click the visual studio version you have under programs to repair.
If the above doesn't work try to reinstall it again. I hope this helps.

Visual Studio 2010 + XNA 4.0 Debug error

I have Visual Studio 2010 Ultimate for Windows 7 installed along with the Windows Phone Developer Tools (XNA 4.0). The installations went smoothly (no errors reported during install), but when I start debugging I get an error saying: "Attaching the ProteusDebugEngine debugger to process '[XXXX] projectname.exe' on machine 'MYCOMP' failed. Invalid Pointer"
However when I go to the debug menu and I choose start without debugging the program launches just fine. How can I fix this error? (Also everything works fine if I try debugging a Windows Phone Game... But when I try to debug an XNA 4.0 Windows Game I get the error message...)
EDIT:
When I start Visual Studio 2010 in safe mode and try to open a project it gives me an error and says that the project type is not supported by this installation...
Check the extended error message, there's usually a hint about which module crashed or isn't found, and it'll tell you to manually register it. Then try starting in safe mode to see if it works, because plugins that haven't been updated for XNA debugging can cause crashes. (Old versions of Resharper, for one.)
Reinstalling visual studio did not help.
Just reimaged then reinstalled and it fixed the problem.

Sequential workflow console application template missing in VS2010 Ultimate Beta2

I am using VS2010 ultimate Beta2 and under Visual C# -> Workflow -> I don't see the Sequential workflow console application or state machine console application
Could someone please advise why these are missing in VS2010. I am able to see them on VS2008 ->Workflow.
Thank you
In VS2010 Pro RC1 the sequential workflow console app and state machine workflow console application are only available if you choose .Net Framework 3.5 in the combobox above the project types.
But why worry about beta 2, now that RC1 is out?
I would think that if this is a true and serious error, a bug report is probably better than a SO question.
As Guge says this is by design (It's the same in Beta/RC or RTM). In Visual Studio 2010 you have 2 different versions of Windows Workflow. The new one (4.0) uses a new runtime under the hood and has a WPF look and feel. The designer/activities are different.
The old one (3.5) -also called Legacy- can only be created in Visual Studio 2010 if you change the target framework to 3.5 or 3.0. After you do that you will have the option of State Machine/Sequential WF Console App.
Note however that after you have created the 3.5 workflow you can retarget to 4.0. This will keep the same designer/runtime but it will be running under the 4.0 Framework. Everything will work as expected.
If you try to upgrade and existing VS2008 project you will get the option of doing this.

Resources