Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VS 2012 Error on build of Hello World: "The operation could not be completed. The parameter is incorrect"

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.

like image 955
Stephan G Avatar asked Dec 05 '13 17:12

Stephan G


4 Answers

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

like image 63
Matthias Avatar answered Nov 10 '22 20:11

Matthias


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.

like image 45
Stephan Schielke Avatar answered Nov 10 '22 20:11

Stephan Schielke


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.

like image 8
David d C e Freitas Avatar answered Nov 10 '22 21:11

David d C e Freitas


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.

like image 7
nthpixel Avatar answered Nov 10 '22 19:11

nthpixel