49

I have started up VS 2012. I created a new solution/project, and made the project a console app. In the provided "Program" class, in the "Main" method, I have added a single line, namely:

Console.WriteLine("Hello World");

This is the ONLY thing I have done.

I right-click on the solution name, and select "Build".

Immediately, a dialog/alert pops up with the title "Microsoft Visual Studio", containing the silver "X" in the red circle, followed by the enormously useful error text that reads:

The operation could not be completed. The parameter is incorrect.

I have done extensive searching on this very informative error, and have come to the conclusion that it pops up in many different circumstances. In my case, I started experiencing it some days ago (on a much more complex MVC app) and it seems intermittent. Sometimes I get the error, sometimes not. Sometimes I can close VS entirely and re-open and it will still be there, sometimes it will be gone for several hours. Rebooting the system (ick) usually makes it go away.

Any help out there? This is now driving me crazy. Many thanks in advance.

ADDITIONAL INFO: If I kill all Visual Studio applications in the task manager (rather than just closing the Visual Studio the more conventional way) it seems to always fix the problem on restarting Visual Studio. Still baffled.

Stephan Schielke
  • 2,744
  • 7
  • 34
  • 40
Stephan G
  • 3,289
  • 4
  • 30
  • 49
  • There are so many things that could cause this to happen that it will be hard to pin down with this information. Probably the best next step to take is wait for this to happen again, then attach a debugger, set it to break on first chance exceptions, and try building again and hope that a more useful message / stack trace pops up – JaredPar Dec 05 '13 at 18:05
  • Disable precompiled headers:http://stackoverflow.com/questions/1293538/precompiled-headers. – Micromega Dec 05 '13 at 18:24
  • Possible duplicate of [Visual Studio popup: "the operation could not be completed"](http://stackoverflow.com/questions/9079466/visual-studio-popup-the-operation-could-not-be-completed) – Michael Freidgeim Jul 26 '16 at 02:02
  • Please consider trying to raise the visibility of this problem with Microsoft. See https://visualstudio.uservoice.com/forums/121579-visual-studio-2015/suggestions/9561930-improve-the-the-parameter-is-incorrect-feature – Richard Logwood Aug 14 '16 at 18:21
  • You might have a look at my answer regarding to this problem on **[Visual Studio Hosting Process and “The operation could not be completed”](https://stackoverflow.com/questions/33338/visual-studio-hosting-process-and-the-operation-could-not-be-completed/50497064#50497064)**. – Murat Yıldız May 23 '18 at 20:37

6 Answers6

52

Simply turning VS off and on again removed this error for me.

Matthias
  • 3,160
  • 2
  • 24
  • 38
14

I tried to solve this by deleting the *.suo files, bin and obj folder, with no success. I tried to restart VS(2015) and reload the solution. All project references were fine.

I then killed all processes related to Visual Studio.

After that I was able to rebuild the solution.

Stephan Schielke
  • 2,744
  • 7
  • 34
  • 40
8

For me this happened when I removed a project from the solution that wasn't at the same path anymore. Weird, it was a greyed out project, but was still needed for the build somehow?!

I found out where it was referenced, in my .sln file I had a References entry pointing to the guid of a missing or deleted project in the solution. This would cause an error.

You can also check the properties pages of the solution, one of them gives a message about a project with the name "" that doesn't exist.

So basically, cleanup the References section in your .sln until it builds.

David d C e Freitas
  • 7,481
  • 4
  • 58
  • 67
  • I had this happen on other references even, like Entity Framework, after changing version of VS and Source control solution. – Greg Jan 20 '16 at 16:35
6

This happened to me in a new web project in VS 2015. I got the error when I tried to build or clean the solution. Closing down VS and deleting everything in the bin folder worked for me.

nthpixel
  • 3,041
  • 3
  • 30
  • 42
1

For me what helped was to delete all bin obj folders and rebuild the solution. I was moving an mvc project from 2013 to 2015. Strange as it is - happened to 2 solutions, but not for every other I had.

Alexander Taran
  • 6,655
  • 2
  • 39
  • 60
1

For me, my project was not opening on VS 2022 ,i tried this and it worked!

Directory: Your project folder/.vs/SolutionName/.suo

Solution: Delete All .suo files from above directory

Note: If you cant find , just search '.suo' on project folder.

Run the project.

Developer
  • 89
  • 1
  • 14