Visual Studio Lags when application starts up - c#

I'm using XNA create a game, recently Visual Studios started lagging when I start the application. It wasn't like this early today which is surprising.
I was wondering if there was a cache that I might need to delete or something that might need to be cleared in order for it to run more smoothly

Earlier I faced a similar problem with very long loading times, resetting all Visual Studio settings helped.
I still haven't found out what exactly my problem was caused by, but I suspect it was one of my Visual Studio extensions.
Have you installed any extensions, plugins or something unusual?
If it is the content compilation that causes such a lag, you could disable compilation of compiled content, since you've already done that and it hasn't been changed.

Related

Visual Studio Code Won't auto complete my C# code

SOLVED
Just to clarify this is about VS code not just VS
I've had the worst 3 hours looking for anything that could possibly fix my Visual studio code. I'm using the program to develop a game on unity but I can't seem to get the auto complete thing (I think its Intellisense) to auto complete my code causing spelling mistakes and making coding 10x longer than it needs to take.
Heres a list of things I have tried:
Install .Net Framework v4.7.1 (which is what the console says to do)
Fix the Assembly file made by unity multiple time
Reinstall Visual studio, C# plugin and .Netframework
Change the OmniSharp to the latest version
I will add that when ever I type anything it comes up with "[info]: OmniSharp.Roslyn.CSharp.Services.Completion.CompletionService Could not find document for file c:\Users\Bruhman\Grinder\Assets\Scripts\PlayerMovement.cs"
and when I open visual studios and write anything in the script it'll come up with an error that states "Some Projects have trouble loading. "Source: C# (Extension)" "
Below is a screen shot of what comes up in the console (It's the same every time)
Console
Never Mind I found out the issue, apparently I need to install Visual Studios Community version and then the .Net developer packs from visual studios and not just online, I'm assuming that it doesn't get detected or something when installed through the exe file...
I don't really know much, but I use it every day : have you tried the unity tools extension ?
It features a lot and also the c# auto completion.
If it still bugs, have you installed the .Net for the EXACT version. I also struggled because I had the upper version and not the exact.
Finally is it linked with unity (I don't know if it could interfere if not done)
Sorry I don't know anything else if this don't work.

Intellisense no longer works

I've been using Visual Studio Code with unity for around 2 months now without problems, but since last week I suddenly get no more Intellisense (no code completion for C# or Unity). I don't recall changing anything and I have no idea why it suddenly stopped working.
I was using Unity 5.4 with this recommended plugin to enable VSCode integration when Intellisense stopped working.
I've already reinstalled VSCode and updated Unity to version 5.5. Unity 5.5 has built in support for VSCode, so I've removed the editor plugin from my project. I can indeed open Unity scripts in VSCode without the plugin now, but I'm still not getting any code completion.
I saw there was an update for the C# VSCode extension today, but updating that didn't help either. I've attached a screenshot of the log during this update:
As you can see there's no flame icon and the code completion is missing. The Omnisharp log is either empty or completely missing (not sure why this behaviour is not always the same).
Does anyone have any idea what I can do to fix this? Thanks.
So in my experience, whenever something weird like this happens in Visual Studio, the first thing you should do is kill all instances of VS and restart. For good measure, you could even reboot your computer, though this is often not necessary. If that still doesn't help, the next best thing is to reset your VS settings which can be done by going to
Tools -> Import and Export Settings -> Reset All Settings
A backup of the current settings are recommended, but not required.
After checking that VS is the default editor in Preferences, open your Unity project with Explorer. See if you can find a .sln file, and open it with VS. Then, go to your solution manger inside VS and try and open any of your Unity project's scripts from the manager. After doing this, your Intellisense should be working.
This worked for me when I had a similar issue side time ago.

Visual Studio 2015 slow while editing and debugging

I'm having trouble with Visual Studio 2015 Pro for one specific solution. The solution is a ASP.Net Web Forms application with 10 projects. The following problems only appear in this solution:
Closing the solution takes 20-30s
Opening the solution takes 1min
VS becomes completely unresponsive while opening/closing the solution
Typing has a small lag (~200ms)
IntelliSense for c#-Code also lags
IntelliSense for JavaScript does not work at all (might be an unrelated issue though)
Opening an .aspx file in designer takes 5-10s
Stopping a debugging session takes 15-30s and VS becomes completely unresponsive during that. Staring the debugging session is actually faster than stopping it.
When I was using VS 2012, these problems did not appear. I got the described problems under Windows 7 Pro and Windows 10 Pro. Reinstalling Windows and Visual Studio did not help either.
For other solutions (Windows Forms, WPF), these problems do not appear. I have also tried to delete the project's *suo file, which is known to cause perfomance issues when it gets too big. Strange thing now is that VS does not create a new *suo file in the project directory. My development machine is surely fast enough to handle the project (a few 100k LOC). I'm not using any 3rd-party plugings like ReSharper. Other things I did while troubleshooting:
Disable code lens
Install all available updates
Cache debugging symbols
I have tried several possible fixes found via Googling, but nothing helped so far. Does anybody have another suggestion what the cause of the problems might be?
Update:
Deleting all breakpoints using the function provided for that fixed some of ther problems. I can now open/close the solution within <5s and starting/stopping debugging now goes smoothly. However, input lag, designer lag and problematic IntelliSense still persist. Deleting contents in "AppData\Local\Microsoft\VisualStudio\14.0" did not help.
I think that many issues can cause this type of problem & you can never give up enough details to help identify these types of issues ...
it could be because of a million difrent things ....
I googled it and found some interesting solutions ....
have a look Here
be sure to check out the comments !
you can try the following to resolve issues in java-script and .aspx files a bit:
Remove unnecessary contents from _references.js file. it should be present in Scripts folder.
Right click on the file and uncheck "Auto Sync Java-script References"
Hope it helps

Visual Studio 2013 or 2015 EditorPackage did not load correctly constantly

When starting Visual Studio 2013 Pro (Update 4 installed) I very often get this error message (several times a day now) for the past about two weeks:
The 'Microsoft.VisualStudio.Editor.Implementation.EditorPackage' package did not load correctly.
I know I can correct this problem by closing Visual Studio and deleting:
%LocalAppData%\Microsoft\VisualStudio\12.0\ComponentModelCache
I have never seen it before that time and as far as I found out in the Internet it was possibly introduced with Update 3.
Well, the problem is that it is annoying to restart Visual Studio several times a day, and I was wondering if anyone else is experiencing this and knows how to solve it for good or what the cause is.
I noticed that it happens extremely often if I work in more than one instance of Visual Studio in parallel. This one is a killer. But still I suspect a third-party component to be involved or it is the size of one of the solutions (about 70 projects). I tried to deactivate some extensions I newly installed and need for the big project, but to no avail.
Just as information: I am working with C#. When working in parallel with projects open in several instances of Visual Studio I never had problems before.
Does anyone have the same problem to this extend or possibly have a better solution than deleting the folder and restarting?
This has become a popular question so I thought I add an explicit answer how to (at least) temporarily fix the problem as already stated in the question:
I stop Visual Studio and delete the following folder (completely, not just contents)
%LocalAppData%\Microsoft\VisualStudio\12.0\ComponentModelCache
If you are using VS2015, then the path should be:
%LocalAppData%\Microsoft\VisualStudio\14.0\ComponentModelCache
If you are using VS2017, then the path should be:
%LocalAppData%\Microsoft\VisualStudio\15.0\ComponentModelCache
I don't keep a backup of the folder. It is created automatically again when starting Visual Studio.
I have never found a solution how to permanently fix the problem in that working environment. In my new developing environment (new projects and new workplace) the problem never happens.
This is what helped me... seemed to happen after Windows Server 2012 SP install...
https://connect.microsoft.com/VisualStudio/feedback/details/1123745/setsite-failed-for-package-microsoft-visualstudio-editor-implementation-editorpackage
devenv /clearcache
devenv /updateconfiguration
In that case you can start Visual Studio setup again and choose the option showing two options, Repair and Uninstall. Then click Repair and when repair is done, restart the computer. Then the issue has been resolved.

VS 2008 suddenly can't start debugging session

I am having great problems running the application in the debugger from Visual Studio 2008.
When I'm using vshost.exe, it says:
And when vshost.exe is turned of, it simply states:
Interesting thing about it is that when i do use vshost, debugger is actually started and breakpoint is hit on the first line of the Main().
I tried:
rebuilding the project(s)
removing .ncb, .suo, .user for the projects
repairing Visual Studio 2008
changing the build architecture for the project
... no help there...
Any experience in (trouble)shooting that?
More info: some projects DO work, and one that I have to work on, does not.
I have some ideas such as:
trying to create NEW project, add thing by thing to it and see at what point it will start to miss behave
work it other way around, delete project by item by item to see when it will (if it will) be working OK again.
EDIT (for google, as I see that there are many similar questions on the web):
Errors:
Error while trying to run project: Unable to start debugging.
and
Error while trying to run project: Unable to start program '....\PlayKontrol.exe'
Try upgrading your Visual Studio to Service pack 1, if you haven't already.
Did you restarted your computer? You never know how windows will react to that :).
Also be sure there aren't any keys stuck, like the ctrl or windows key.
Note that the key does not have to be visually stuck, it can be stuck for visual studio and not for the explorer.
The most common source of sudden problems like this is corruption of one of the data files that vs uses to cache information between builds.
You've tried a clean build, but this won't delete everything. A real clean build is: quit vs, delete bin, obj, debug, release folders, delete all generated files in the root - primarily ncb. Do the same for any locally built libraries that you're project references.
The easiest way to do this is if you have the code in source control, as you can rename away your entire code folder and then force a get of all the source.
You often need to do all of these things in one hit to clear the problem.
Less frequently, a reinstall of vs will sort things out (although this sounds unlikely in your case if it is only one project that breaks)
Also think carefully about anything you might have installed just prior to it failing... And remember that some install effects may not occur until the next reboot so it could be days ago. A particular cause of this are automatic windows updates and trial versions of things like the vs 11 beta.
You might try running the application from outside of VS, but have a line of code that looks like this: Debugger.Launch(); where you want your first breakpoint.

Categories

Resources