VS 2010 is broken - visual-studio-2010

Today i was working on a project when a broken HDD froze my computer. I took out the offending hardware and restarted. After that I discovered that the file i was working on was corrupted, neither VS or notepad could make sense of it. Annoying but meh, it would take me 10 mins to rewrite i figured.
Then a few hours later I went out, saved my work and closed VS. When i came back VS threw me an error when loading up, something about an exception and that i should check the log file(which I did, I'll add the error below). And again there was corruption, this time 2 files. This is really lame.
The error is as follows:
System.IO.IOException: The directory name is invalid. at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) at System.IO.__Error.WinIOError() at System.IO.Path.InternalGetTempFileName(Boolean checkHost) at System.Windows.Input.Cursor.LoadFromStream(Stream cursorStream) at System.Windows.Input.Cursor..ctor(Stream cursorStream) at Microsoft.VisualStudio.Text.Editor.Implementation.LeftSelectionMargin.get_RightArrowCursor() at Microsoft.VisualStudio.Text.Editor.Implementation.LeftSelectionMarginProvider.CreateMargin(IWpfTextViewHost textViewHost, IWpfTextViewMargin containerMargin) at Microsoft.VisualStudio.Text.Utilities.ContainerMargin.b__2(IWpfTextViewMarginProvider mp) at Microsoft.VisualStudio.Text.Utilities.GuardedOperations.InstantiateExtension[TExtension,TMetadata,TExtensionInstance](Object errorSource, Lazy2 provider, Func2 getter)"
It makes no sense to me.. Anybody know how to fix things?

Related

Fixing the "Failed to save" error in Visual Studio Code?

I recently installed Visual Studio Code 1.72.2 on a Windows 10 OS.
Since I started using it, I had a hard time when saving source files in VS Code, with the error message very frequently appearing and saying "Failed to save 'Test.py': Unable to write file '[file_path]' (Unknown (FileSystemError): Error: UNKNOWN: unknown error, open '[file_path]')"
When I create a workspace and the first source file, it actually saves without a problem. Then, after about 5-10 minutes of editing and debugging, the aforementioned error message suddenly pops up and I can't save the file from there on.
After searching Google many times, I could only find one post written by someone who was probably in an identical situation as mine (identical problems like files becoming corrupted after experiencing this "Failed to save" error), but the post was closed without any useful information.
I could find some posts about having "Failed to save" type of errors like File Permission error, but since my error exclusively says "UNKNOWN" I can't even guess what went wrong.
I already have tried disabling the installed extensions, but still no luck. This error happens regardless of the language of the source files, hence it shouldn't be a problem with a particular extension.
One last note, the file system I am using for source files and workspaces is D:, which is a 256GB external USB Mass Storage Device.
Any suggestions would be appreciated.

How to quickly clear thousands of CS0234 errors in Visual Studio 2019

This is a shared project that was working for me until today. It still compiles without errors in our CI system and for all of my teammates, but my computer started getting more than 3000 CS0234 errors when I compile this solution.
I tried cleaning the solution, I manually deleted the bin and obj folders, I deleted the packages folder and got all the NuGet packages again from the package source, I even rebooted my machine. Nothing helps.
These are not real errors, if I double click an error message, the source file opens initially with red ink, but this quickly disappears, then the error is removed from the error list.
I can fix my problem by simply double clicking each error and waiting a few seconds, but there are over 3000 error messages. My question is, is there a faster way to get Visual Studio back in sync. Since this only affects my machine there must be some kind of cache somewhere that's broken and if I could find it and delete it, maybe this situation would be resolved quickly.

VS 2010: TFS throws pathLength exceeded on ALL files even though path length is less than 260

I have an infuriating problem that occurred recently.
Whenever I try to add or rename a file in any of the projects in my solution, or even the solution name itself, I get the following:
Error
TF10210: Source control encountered an error during move
operation: Unable to rename
C:\xxxxxxxxvisualstudio.com\xxxxxxxx -
Rigg\src\xxxxxxxx.Rigg.Domain\Area.cs to
C:\xxxxxxxxvisualstudio.com\xxxxxxxx -
Rigg\src\xxxxxxxx.Rigg.Domain\Area2.cs
Specified argument was out of the range of valid values.
Parameter name: pathLength
(I've replaced the names of mine and the client's company with x'es.)
The thing is, up to last Friday I never had this problem, I've been working on the solution for more than 6 months.
I have not renamed or restructured the solution folder recently.
I've tried deleting the solution folder and getting an earlier checkin from before this happened, with no luck.
I do not get the message if I open the solution in VS2013, which leads me to believe the problem is related to VS2010, and maybe doesn't have anything to do with path length. Unfortunately I can't work on the project in VS2013, as it is MVC3.
Any suggestions?
EDIT:
Solved. I changed the solution's mapping, and it worked. Then I changed it back to the original, and it still worked! I have no idea why this happened, but apparently fiddling with the mapping solved it.
Here we have Dynamics AX 2013 R3 CU8 with the same error:
Team Foundation Server nonfatal error
Specified argument was out of the range of valid values.
Parameter name: pathLength
Can you please describe a bit more detailed how you have fixed the error?
We inadvertently broke VS2010 compatibility in our latest update. We rolled out a fix over night. Let me know is you still hit it. Sorry for the trouble!

VS2013 is suddenly not working

I have a MVC5 app using Entity Framework code-first. It has been fine, working for months while I develop it. This morning it worked fine too. Then suddenly I run it for the 10th time of the day, and it won't run. I'm getting a crazy set of errors that aren't consistent.
First off it said it couldn't find mscorlib.pdb. I researched that and downloaded the latest symbols (first place didn't have it, second place did), and now I have the pdb. But I continue to get errors whenever I try to access the DB.
I have seen entityframework.dll and mscorlib.dll mentioned, but very little info is given because it usually just says:
An unhandled exception of type 'System.StackOverflowException' occurred in mscorlib.dll
{Cannot evaluate expression because the current thread is in a stack overflow state.}
I did try to turn on stepping and then I get this file box that is asking me to find files, that I have no idea where they are. The first time, it asked me for enumerable.cs, the second was RType.cs, and the third was IPipelineRuntime.cs. It tries to look in a very obscure folder structure (f:\dd\ndp\clr\src\BCL\System\RtType.cs) but I don't have these files on my machine.
Suddenly none of my projects are working that need EF. I even created a brand new project, with a simple code-first model to try it out and got the same issue.
Please help!
Answer found.
I kept reading on other issues where a lot of people were saying that it was due to someone's own code and not a system issue.
I used the datemodified stamp of the files to determine all the files I had worked on in the few days leading up to the issue.
I went back through and began removing them one by one, and discovered the issue. It was my own recursive code.

Nuget in Vs2010 throws a 'Arithmetic operation resulted in an overflow.' exception when I open my project

If I open Vs2010 and then open the Package Manager Console host V 2.0 and 2.2 (tried both)
The console starts fine,
If I then open my soloution this error appears in the console
Arithmetic operation resulted in an overflow.
If I open my soloutionfirst, and then open the console I get the same error.
Any time I run a command I get the same error instantly.
If I load a different project, which my current project is a copy of, it loads fine.
Bad soloution Name
SpamisDataMigrationTestingTool
Good soloution Name
SAAS3G
The only obvious difference is the lenght of the soloution name... the bad sln is a copy of the good sln with the names changed, some files deleted and some new unit/integration tests added..
Does anyoe have any idea what might be causing this?
Any help is greatly appreicated.
The Nuget.Config got altered on copying and renaming the path "JCDCHelper.project" got changed to
"JcdcHelper.project"... this caused the arithmetic over flow exception
(Nuget.config pointed to a non existant path)

Resources