Unable to debug .NET after VS 2019 upgrade - c#

I was using the VS 2019 to debug a SQL Server CLR C# .NET code. I got an upgrade notification from VS which I did and rebooted. I now get the error when trying to debug
Unable to debug .NET code. Could not attach to SQL Server on '....'. The 64 bit version of the Visual Studio Remote Debugger (MSVSMON.EXE) can not be used to debug 32-bit process or 32-bit dumps. Please use the 32-bit version instead.
Now my SQL Server (2019) is 64-bit and the SQLCLR Platform target is x64, so what is going on to make it think that a 32 bit process is involved?
Also the SQL Server and the VS 2019 are on the same machine do it not a remote machine issue.

I needed to run VS 2019 as an administrator - that fixed the issue. The error message is very misleading.
I tried changing the firewall settings but did not work.

Looks like you are trying to debug using the 64 bit remote debugger tools instead of the 32 remote bit debugger tools.
The connection component to SQL is likely 32 bit that's why it is crapping out.
https://visualstudio.microsoft.com/downloads/#remote-tools-for-visual-studio-2019

Related

Using RemoteDebugger to debug C# mono program on Raspberry Pi 3

I'm trying to debug my C#-mono program on a Pi 3 using the latest MonoRemoteDebugger (1.0.10).
The program compiles on both the build machine (a windows 10 64 bit laptop) as well as on the target (Pi 3). The binary also runs on the target machine.
But when i try to remote debug using Visual studio 2015 Community with the MonoRemoteDebug extention it fails.
The debug server that runs on the target machine is found by the extention client.
When i select the server and press connect then it connects.
But when it tries to start the binary it fails, it returns with the message that the .exe cannot be found.
It seems that is tries to find it in the directory of the development machine (C:\users\user\projects\project\Program.exe).
I have followed this tutorial:
https://mmkaram.wordpress.com/2015/04/18/run-and-debug-c-net-on-a-raspberry-pi/
and also read the following post Mono remote debugging from Visual Studio
But i can't seem to get it to work, can anyone help me?
I would suggest you to use Xamarin Studio.
Remote-Debugging from Windows to Linux (for me on a Beaglebone) works without any problems.
https://store.xamarin.com/account/my/subscription/downloads#all-versions
https://eladnava.com/debug-remote-mono-apps-via-xamarin-studio/
I also tried to get the debugging running from within VS. It is "possible", but only very basic and awkward to use.
Xamarin Studio is also free and fully compatible to the VS Solutions. So if you want you can use VS to write your code and then load the solution in Xamarin Studio to do your debugging.

Compiled C# application 0xC0000142 error

I met a highly disturbing issue. I wrote a C# application in Visual Studio Community which uses a local .mdf database file.
My computer's operating system is Windows 10 Home, 64 bit. My problem is that I cannot run the compiled EXE file on certain computers. Previously I used it on a computer running 32-bit Windows 7 Professional, with no problems.
After upgrading it to Windows 10 Pro, 32 bit, the application starts, but it crashes when it comes to an SQL command:
"The application was unable to start correctly. 0xC0000142".
I reinstalled the Microsoft SQL Server 2014 Express Local database, performed a system cleaning but the problem persists. My setting in Visual Studio is 'Any CPU'. I tried to run the EXE in the debug folder and also the one in the release folder. On 64-bit Windows Home everything is just fine with either of the .exe files. On 32 bit Professional, on the other hand, 0xC0000142 error again.
I tried another computer with 64-bit Windows 10 Home and Microsoft SQL Server 2014 Express Local DB: the application runs without problem. I guess some DLL files cause the problem, but neither can I track the source of the problem nor fix it. Does anybody have any suggestions?

c# visual studio 2013 unable to connect to oracle database

I have visual studio 2013 and oracle 11g
When I try to connect to the database I get the next errror:
"Attempt to load Oracle client libraries threw BadImageFormatException.
This problem will occur when running in 64 bit mode with the 32 bit
Oracle client compoonents installed."
I know there is an issue between the 64 bit visual studio and 32 bit Oracle client. But I am looking for a solution the whole day now and I can only find outdated posts on the internet about older versions.
I already tried to select "platform target: x86" in the build settings.
I also looked for a 64 bit version of the oracle client but that also failed a couple of times.
I Appreciate every help because I need this connection for a very important school project.
Thanks for your time!
you need install 64 bit oracle client
link: Instant Client Downloads for Microsoft Windows (x64)
instantclient-basiclite-windows.x64-11.2.0.4.0.zip (23,504,640 bytes)
as they said about installation
Installation Steps:
Download the appropriate Instant Client packages for your platform. All installations REQUIRE the Basic package.
Unzip the packages into a single directory such as "instantclient".
Set the library loading path in your environment to the directory in Step 2 ("instantclient"). On many UNIX platforms, LD_LIBRARY_PATH
is the appropriate environment variable. On Windows, PATH should be
used.
Start your application and enjoy.

How to force Asp.net development server to run as a 32-bit process?

I am having problem getting the MS Visual Studio Remote Debugger to connect to my local IE instance as it is running as a 64-bit rather than a 32-bit process.
Every time I try to run it currently in Visual Studio I get the
The 32-bit version of the Visual Studio Remote Debugging Monitor (MSVSMON.EXE) cannot be used to debug 64-bit processes or 64-bit dumps".
error.
Investigating a bit, I think I have narrowed it down to the web asp service being run as a x64 process rather than a x86 (which both Visual Studio, and the silver light application are running as). I confirmed it as running as a 64-bit process by trying to "attach" visual studio to the process when the application was running in the ASP.Net Development Server.
In short: Is there a setting I am missing somewhere to force Visual Studio to run the ASP.Net service as a 32-bit process? I have read about using a variable in the web.config application pool to use 32-bit (via the enable32BitAppOnWin64 config option), but it seems to only work in IIS, not ASP.net Dev server.
Any thoughts?
Edit For Clarity:
I am running Windows 7 64-bit, Visual Studio 2010 (which is running as a 32-bit process). Currently it is launching ASP.NET Development Server (not IIS) to host the back end web service. I am hoping I can simply "fix" this via a setting, but if not my backup would be to run IIS Express.
If I'm understanding you correctly you should do this:
IIS Manager/Application Pools-> choose the correct pool for your application/Advanced Settings/Enable 32-Bit Applications->set it to true !
I had problem like this in the past which cost me 1-2 days, hope this helps !
Check also Project/Properties/Build/Platform target->this should be Any CPU

Running in 64 bit mode with the 32 bit Oracle client installed

I have Developed an Applicatoin in ASP.NET with C# and I have used oracle database.
my prob is when I am running this application from visual studio 2012 it will throw error like
Attempt to load Oracle client libraries threw BadImageFormatException. This problem will occur when running in 64
bit mode with the 32 bit Oracle client components installed.
but when I host this application in my local iis and make application pool enable 32bit is true then it's working fine.
can anyone please guid me how can I run this from visual studio.
If it is just the ODP use the managed driver from Oracle.
http://www.nuget.org/packages/odp.net.managed/

Categories