Visual Studio Solution freezes when I try to compile - c#

I have no idea how to even approach debugging this issue. I have a solution with four projects in it and all of a sudden it has stopped functioning properly.
When I open the solution and click on anything, it freezes up and it says that 'Visual Studio is busy waiting for an internal operation to complete". It gives the same message when I try to build the project, although it never actually opens the file or builds - I have to end the process in order to escape.

To troubleshoot this you could start visual studio in safemode, by running: devenv.exe /SafeMode. It loads only default settings and services. If it works then the culprit is something like an extension or a third party package.
You can also start Visual Studio with logging:
http://msdn.microsoft.com/en-us/library/ms241272.aspx
For a list of other command line switches you can use, like /ResetSettings, you can follow this link:
http://msdn.microsoft.com/en-us/library/xee0c8y7(v=vs.100).aspx

Perhaps you should install the Visual Studio 2010 Diagnostic Extension, to try and capture some data that can be sent to MS for analysis.

What works for me is opening VS, opening a working project and then opening the one that is experiencing the problem. Everything works fine after that.

Related

Need to restart Visual Studio 2017 for IIS to work

I'm developing a site with .NET and C# in Visual Studio 2017. When I first load the project, I can press the green arrow IIS Express button and it opens a new browser window and everything is fine. However if I stop it or exit from the browser tab, the next time it doesn't load the page. It opens the browser window, but says it cannot connect, and the IIS Express button doesn't stay grey and goes back to white. This started happening only recently, and I've not made considerable changes to the codebase; I don't know why this is happening now.
All I have to do is exit Visual Studio and open it up again, then I can run IIS Express for one time before it stops working again.
I don't see any errors, I've tried running in Administrator mode, and I've assured that it's not trying to use a port that's already in use. I've also tried updating VS 2017.
Where do I start looking into this problem?
According to your description, I guess you may install some third-party extension in your visual stuido that casuing this issue.
I suggest you could try to ​​​​​​run VS with safe mode to check if this is working well or not.
About how to run VS in safe mode, you could refe to below way:
open CMD and go to C:\Program Files (x86)\Microsoft Visual Studio\2019\version name\Common7\IDE folder, run the command: devenv /safemode
Besides, I suggest you could try to reset all the VS setting to defauly.
Details, you could refer to this article.

Program doesn't work outside Visual Studio

I use unmanaged dll with P/Invoke in this app, and I always tested it inside Visual Studio (with debug mode on x86 CPU because the dlls are only x86), and it works just fine. But when I just start the exe manually after some time (probably at the first operation with those dlls, but I don't know exactly) it says the exe has stopped working, and it starts checking for solution (I use Visual Studio 2013 on Windows 8.1, if that matters). I tried to add the dlls to the project as existing item, but that doesn't help. Also I know, that it's not because it can't find those dlls, cause if I delete them, it doesn't crash, just freeze without any error message. Shouldn't it work the same from Visual Studio as manually started?
There is also a weird bug when I run from Visual Studio: everything's work fine, but sometimes Visual Studio just suddenly stops debugging, as if the program were closed and the GUI of my app freezes, and I can only close it by closing Visual Studio (as I close it, the GUI disappears). Maybe it's a totally different problem, but it can be connected.
Edit:
Here's the project on github, if somebody could check it:
https://github.com/geiszla/CycriptGUI
Some news: If I run it with Ctrl+F5 it also crashes. What's the difference between F5 and Ctrl+F5, that can cause this problem?
Searched all over Google with no real simple answers. Here it is folks(at least it worked for me and is simple):
When you run the console app in Visual Studio, look at the output window at the bottom, get the location of the ..\bin\Debug\*.exe
Copy the *.exe and the *.config to your desired folder, run it, it should work the same way in Visual Studio.
Thanks for every help, my problem was solved: I called an unmanaged function with only 2 parameters, while it had 3. However I still don't understand why it worked with debugging mode, and not without debugging.

Install Sheild LE -4340 Internal Build Error Visual Studio 2012

I have an issue with building an MSI with Install Shield LE in Visual Studio. The error says "-4340: Internal Build Error", but the link to Flexera is worthless. I tried the suggestion in another post to add the installer project to a fresh solution and then my .Net projects after, but that did not help. That suggestion can be found here.
I have not found a single repeatable cause of the issue, it does not seem to happen because of any one thing. I'm trying to build an installer for a Windows Service.
I got that error too. In order to fix it i rebuild my solution in Release configuration instead of Debug one.
All I did is restart Visual Studio. For some reason that worked for me.
My solution is slightly different:
Close and launch Visual Studio, open solution then
Rebuild with Release configuration AND
Unload/load InstallShield
Setup:
Visual Studio 2015, Windows 10, Visual C#
When I had this error, it was because I added an executable for extra dialogs to be run after the install. I told install shield to run the executable, but I didn't add it to the list of files to deploy.
When I added it to the files, the error went away.
It could be that when users switch to "debug" that they have a build of the executable in debug mode, but they never built it in release mode.
It would be nice if flexera produced a normal error message for my case at least. i.e. "You said to run XYZ, but XYZ is not found in the file list"
I had the same issue and solved it by deleting a previous build. It looks like Visual Studio wasn't able to delete the previous version.
I am quite late to this post... but I will post the solution in case others run into the problem. I worked with Flexera on this problem and they provided a fix for it. Download and install IS 2016 SP1 or newer and the problem is solved! Read all about it at
https://community.flexerasoftware.com/showthread.php?220123-ISDEV-error-4340-Internal-build-error&p=509912
I just had this again for the x-thousandth time. Normally the rebuild approach works, or failing that restarting VS, but this time I actually had to restart Windows to get it working again. Hope that helps someone, I was starting to really think it wasn't going to work again this time.
I had to unload/reload the InstallShield project in order for it to build.
I'm getting this error when I forget to start Visual Studio with Administrator privileges.

Visual Studio keeps crashing

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

Debug Techniques: Visual Studio 2008 Process fatal crash after debug of WPF application

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.

Categories