I just converted a project from MVC 4 to ASP.NET Core 1.0. This project does some pinvoke on a 32bit dll and when I try to debug it, I get that bad image exception.
If I deploy it using dotnet publish -c Release -r win7-x86
it works perfectly fine, but I can't debug it or run through visual studio.
NETCore means squat to programmers that have access to VS2013, they have been able to use it for a long time. It was open-sourced so programmers that don't use Microsoft tools and runtime environments can take advantage of it.
Install Visual StudioNET Core 2.1 and . NET Core 3.1 is having long term support. Visual Studio 2017 supports . NET Core 2.1, whereas Visual Studio 2019 supports both the versions.
NET Core SDK and runtimes. In almost all cases the right version of the SDK to download and is the 64 bit version unless you are running on 32 bit Windows version (hopefully not).
You need to either publish the app as standalone app 32bit or, if it's a shared framework app, then you need to start it with a 32 bit dotnet.
If you already have the app running in 32 bit mode, then you can attach VS to it.
If you want VS to always use the 32 bit dotnet then you have to uninstall the dotnet in program files (or just remove it from the system PATH) and then install a dotnet that's 32 bit, making sure it's on the PATH. It's important to note that system PATH takes priority in Windows so adding something to the user's PATH will not work unless you remove the old one.
PS: I assume you're running on a 64 bit OS. Otherwise, you get the 32 bit dotnet by default.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With