The situation is as follows:
I have a Windows 10 Machine with Visual Studio 2019, and created a c# .NET project in debug mode there and it Works.
The program happens to throw an unhandled exception with a meaningless/ambiguous message on a different Windows 7 machine. On that machine, Visual Studio 2008 happens to be installed. I get asked whether to use it for debugging, and I'd love to do so, to get the code which caused the exception. After copying over all the source files onto the Windows 7 machine I find that I cannot load the project using Visual Studio 2008, since VS 2008 refuses to load project files created with newer versions of Visual Studio.
I do, however, get an offer to use the Visual Studio 2008 debugger upon the crash, but if I use it, all I get is rather useless assembler code and a meaningless crash location address, since the debugger is not connected to the source code, and Visual Studio is not, AFAIK, capable to link that address to the source code. So the situation is, that I have all the source and symbol files available on the target machine, but the debugger does not load them, I don't know whether I can somehow show them to the debugger outside Visual Studio, and starting the project from Visual Studio 2008 is not possible because it won't load the project source files.
Is there any way I get a meaningful debugging, I mean with all the files in place it should be possible to debug with source display, even if the Visual Studio versions don't match.
Framework version is 4.x (most recent, think is 4.7). The message says that a service hasn't been started or is missing on the W7 machine, unfortunately no hint which of the 1000 possible services is meant. If I load the VS 2008 debugger, I get the fairly useless hint that the crash happened at address $..... (very, very long hex address). If I knew which part of the program caused the exception I could find out with ease. The question isn't targetet to to resolve the exception, but solely how to use the debugger to find out where the exception comes from, under the described circumstances.
You can use tools like dnSpy and my Runtime Flow for light weight debugging to find which part of the program caused the exception.
Is there any way I get a meaningful debugging, I mean with all the
files in place it should be possible to debug with source display,
even if the Visual Studio versions don't match.
I think you could use Remote Debugger just as Pavel said. It will use the local VS2019 to debug the source files on the remote computer without VS2008.
First, you should install the remote tool or just copy the Remote Debugger folder into the remote computer and then config as this document said, run it as Administrator on the remote computer.
Then, use IIS to run your asp net source files(you have the whole project source files and output files) on the remote computer
And on your local computer, open VS2019, use Attach to Process to catch the process of your project from the remote machine.
More info you can see this official document about it.
Besides, you can also use Debugging Tools for Windows-----WinDbg.
Related
I'm using a fresh install of Visual Studio Community 2017 for Mac, but can't seem to get errors to display in the errors pad without running my program; on my Windows PC, design-time error checking with VS is automatic. I just updated to Mojave, but was having this issue in my previous Mac operating system.
To be clear, typing incorrect code in a simple console app file (or in a Unity project file, or in a number of other sample solutions that I tried), like string name = 23.45;, does not cause an error to be logged in the errors pad unless I run the program.
Is it possible to enable live error checking on VS for Mac, or does this feature only exist on Windows?
I have a relatively large WinForms application that has been developed under Visual Studio 2013. I recently upgraded to Visual Studio 2015 on another computer and have been trying to get the project working under it.
My first issue/concern is that when I open the project for the first time in Visual Studio 2015 it does not ask me to "upgrade" the solution to Visual Studio 2015, it happily just opens the solution. I am used to having Visual Studio ask to "upgrade" the solution and create a new .sln file that is recognized as a, for example, Visual Studio 2013 solution instead of the old VS10 solution.
The actual issue I am facing is ~10 errors that seem to deal with cryptography. From what I can guess this has to do with the solution itself and what microsoft does with it in the background seeing as the most cryptography I use in the project is generating Guid.
An image of the errors
The one other issue I have is that, as I am not used to, I cannot double click on the errors them self to be lead to where Visual Studio thinks they are occurring. Thus I am not sure what is generating them or where to go from here.
Any suggestions?
This is a Windows 7 installation on an older model Lenovo Thinkpad. I do not have admin privileges on this computer either.
EDIT: So far I have tried to add <enforceFIPSPolicy enabled="false"/> to the file Visual Studio 15 settings at C\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Devenv.exe.config, though whenever I try to edit it (even after a fresh restart) the file is "always" opened by another program. So it seems I cannot edit the file to turn off FIPS for Visual Studio 15.
I am still open to suggestions or clues.
EDIT2: I have managed to get <enforceFIPSPolicy enabled="false"/> into the IDE settings with the help of IT (Using this article). Though this seems to do absolutely nothing, it seems that it is being ignored.
Another issue/clue here is that even if I create a brand new C# project in Visual Studio, when I try to compile I receive the same errors. So I have to assume that Visual Studio is using the SHA256 class somewhere "in the background". If I did have control over its usage I would try to implement #Kevin 's answer below.
I have found another possible solution on the web though I am not sure of its validity
VS 2012 now builds C# projects in a separate process that runs
msbuild. The entry you added to devenv.exe.config (that worked for VS
2010) won't be seen by this process. You should add the same entry,
namely
to the config file for msbuild; typically that's found at
c:\Windows\Microsoft.Net\Framework\v4.0.30319\msbuild.exe.config"
I will try to get this done when I have time for the .NET 4.5+ msbuild.exe.config files and report back.
The solution I went with is outline here.
<enforceFIPSPolicy enabled="false"/> was added to a few files, namely
C:\Program Files (x86)\MSBuild\12.0\Bin\msbuild.exe.config
C:\Windows\Microsoft.Net\Framework\v4.0.30319\msbuild.exe.config
C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Devenv.exe.config
Though I think the one that actually made it work was the first file.
You can't double click on the error and have it go to where the error is being thrown because it is being thrown inside the SHA256 class. If the FIPS compliance bit is set, any non-FIPS compliant .NET cryptography classes throw this error.
You have two choices to fix this...
First, you can just turn off the FIPS compliance bit on the machine where you are trying to run the app (not recommended).
Otherwise, you can update the code to use the FIPS compliant version of SHA256 (SHA256CryptoServiceProvider). This will require .NET Framework 3.5 or greater.
Visual studio team system 2008 keeps crashing on me. Sometimes it just freezes, or certain parts of the UI get messed up or a weird popup box saying something about unable to load parameters or saying something else about memory or any other number of things.
it usually happens when I do a "complex" task like go into debug mode or do a search across of whole solution or run a unit tests or something like that.
I rebooted my machine countless time, reinstalled it VS, changed my virtual memory settings, flush my page file on every reboot and anything else i could think of.
It seems like VS runs out memory or something.
I have a powerfully machine with lots of RAM so that's not the issue
any suggestions?
You can always try some standard Visual Studio troubleshooting steps:
Clean the solution
Delete / rename all files in your solution created by VS, i.e. all .ncb, .suo, .user files
Launch Visual Studio with all add-ins disabled: devenv.exe /SafeMode
Reset All Settings: Tools -> Import / Export Settings -> Reset All Settings
Delete HKCU:\Software\Micosoft\VisualStudio\9.0 and then restart Visual Studio
Repair the Visual Studio installation through Add/Remove Programs
You might also check whether there is a hotfix available addressing your issue (e.g. KB960075 sounds like a good candidate for you), or whether you find your problem already reported on the Connect website.
The first step is to uninstall all 3rd party add-ins on Visual Studio. In particular if you have multiple add-ins as they can interfere with each other in unexpected ways and cause crashes. After uninstalling repeat your scenarios and see if this fixes the issue.
If not then it's best to consult the application log and find out why Visual Studio is crashing. The log will contain at least the error code of the crash which can searched on google or reposted here for us to take a look at.
Assuming this occurs with VS up to date with all service packs installed, you might try some of these suggestions. If you haven't tried with service packs, do that first.
What version of Windows are you using? If it is Windows 7, try launching Visual Studio with a compatibility mode and see if that resolves the issue. To do this, make a copy of the normal launch shortcut and go into the Properties dialog and set it to run as Windows Vista.
If this doesn't fix it, then you might also consider:
Checking your PATH environment for any weird settings which might be confusing it, e.g. paths pointing to other SDKs
Any 3rd party VS extensions such as source control, refactoring plugins, wizards etc.
Old versions of .NET or SQL server
Also test if the issue occurs for every kind of project or just certain kinds, e.g. does it happen for all projects? Does it happen in C++, C#, VB.NET projects etc.
You can also attach a debugger to Visual Studio, to see what it's doing. Sometimes a particular .sln will trigger bad behavior or more likely, some third-party add-on.
If you believe that you've gotten VS into a wired state, you can try the following command line switches
devenv.exe /ResetSettings (This will reset the visual studio settings to the defaults)
If that doesn't help, as a last resort, you can try
devenv.exe /ResetUserData
I'm having some problems (as some of you will see from another question I asked) with getting a program I made in Visual Studio 2010 to run on another computer.
My computer is Windows 7 x64
The destination computer is Windows XP x86 (SP2)
I've already checked to see that I'm compiling for x86.
Anyway, my question is: Is there a debugger I can install that will tell me what errors the program is having? Like a .NET Debugger that does not involve me installing Visual Studio 2010 on the destination computer?
If you have access to the client computer when it is running the program, the easiest thing would probably be to deploy the remote debugger, and debug the program on your own machine, while it is running on the client PC.
Otherwise, you can use DbgClr, which is distrubted with the .NET framework SDK.
One option is to use WinDbg + the SOS extension. This is a much lighter weight debugger that is easily installable but has a steeper learning curve than Visual Studio. I often use it though when I need a light weight debugging experience
WinDbg http://www.microsoft.com/whdc/devtools/debugging/installx86.Mspx
SOS: http://msdn.microsoft.com/en-us/library/bb190764.aspx
Another option is to use a program like ProcDump to take several snapshot dumps of your program on the remote computer and USB copy them to debug back at your workstation.
http://technet.microsoft.com/en-us/sysinternals/dd996900.aspx
You can save a dump at various triggers like an Unhandled exception. Visual Studio can open the dump back at your workstation and 2010 supports mixed mode debugging.
I have a relatively large C#/WPF Visual Studio 2008 solution that I am trying to test and synchronize across 2 developer's computers. On my computer, I am able to build and debug (run) the project successfully without errors.
On the second computer, I am able to build the solution without any errors. When I attempt to run the solution, Visual Studio starts the process but about 3 seconds later the entire development platform exits. Before it exits I briefly see one of our .xaml files opened by visual studio with a yellow 'unhandled exception' box pop-up on a certain line number. I'm currently contacting the part of my company who is responsible for implementing the functionality of that xaml file.
This raised a bigger issue in my mind: How can you troubleshoot an issue when Visual Studio is immediately exiting after attempting to run a program?
The Visual Studio 2008 crashes when starting to debug post may also be helpful. I'm trying those solutions now.
We found that executing the three following commands helped to fix our problem:
devenv.exe /ResetSettings
devenv.exe /ResetSkipPkgs
devenv.exe /Setup
This was suggested in another stackoverflow post here helped us to determine that it was a plugin, AccuRev's Visual Studio plugin, that was causing the issue.
The issue also appears to be a "known issue" with a hotfix from Microsoft, documented here.
VS2008 SP1: In Visual Studio 2008 SP1, having windows in non-default locations, for example after docking and undocking windows, when switching between debugging and designing or switching to/from full screen, can result in a crash of the Visual Studio IDE.
Thanks for your help!
Run devenv/debugexe to debug your exe. When an unhandled exception occurs, in the debug menu, select "save as dump", then visit http://connect.microsoft.com/visualstudio to open a bug report and attach the dump file after creating the report.