62

I have been working on a new solution all evening. Building without an issue, however all of a sudden I have started to get the following error when building:

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

Now, I have searched many threads, but I am yet to find a decent solution. I should also mention. I have restarted, tried to repair my VS 2015 Express install with no luck.

This is happening on EVERY solution, not just my new one, even if I close everything, start a brand new project and try and build.

Any suggestions would be welcome!

Ghasem
  • 14,455
  • 21
  • 138
  • 171
Harambe
  • 997
  • 2
  • 8
  • 17
  • 21
    Fixed this by always running as administrator. – Harambe Feb 11 '16 at 16:56
  • 2
    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:22
  • Check the solution from thread: http://stackoverflow.com/questions/9079466/visual-studio-popup-the-operation-could-not-be-completed – claudiu.nicola Aug 23 '16 at 10:12
  • 3
    This question mentions that restarting Visual Studio was tried, but for anyone landing here who hasn't tried that yet, do. See: http://stackoverflow.com/q/20407304/12484 – Jon Schneider Feb 06 '17 at 14:25
  • 2
    in my case, i have restarted VS and the issue is fixed. – Mustafa Tığ Jan 21 '19 at 09:08
  • For me, it's becaues I had adjusted the time zone and date (for testing time and dst problem.) – Zhang May 14 '20 at 06:59

16 Answers16

50

Dan (the original poster) mentioned in a comment above that running Visual Stuio as admin solved this for him.

Jon Schneider
  • 25,758
  • 23
  • 142
  • 170
38

This answer helped me: https://stackoverflow.com/a/9130257/6524796 It says to try deleting the .suo file. To find this file open the directory for your solution in File Explorer, make sure you can see "Hidden Items", and search for ".suo". Select and delete the one for the solution giving you issues building. Close Visual Studio and reopen solution.

Patience
  • 499
  • 5
  • 5
  • 4
    This worked for me after I closed the instance of visual studio and removed the .suo file – Samuel Sep 20 '17 at 22:55
  • 1
    My computer crashed from overheating while working in my problem solution, and I then received this error after restarting. Deleting the suo file fixed the issue, thanks! – Brian Boyd Jun 02 '22 at 20:42
  • 1
    Ran into this with VS2022 just trying to load a solution file. Deleted the entire .vs subfolder and then it loaded okay. – mark Nov 17 '22 at 14:24
  • @mark's solution solved my problem (mine started after a power outage while I was working with vs2022) – tomblue Jan 23 '23 at 19:03
10

Try checking your project references. I had this same problem and found that one of the reference was missing.

Look under: Debug > ProjectName Properties > References

MichaelDarkBlue
  • 129
  • 1
  • 6
7

I've had this happen in the scenario below and closing & reopening Visual Studio 2015 resolved it for me.

Even though OP mentions he already

even if I close everything, start a brand new project...

I'm posting this solution for others who hadn't tried this.

Reference - Thanks Jon Schneider

Scenario

We have a library we maintain in a private nuget repo. Instead of building betas, sometimes I'll just compile the library locally, drop the reference to the nuget package and add the reference to the local bin of the library. Upon rebuilding the project, sometimes I get this error. Closing and reopening the project resolves it and I'm able to build.

w00ngy
  • 1,646
  • 21
  • 25
5
  1. Close Visual Studio

  2. Go Into Solution Folder

  3. Remove .vs folder

  4. If .vs folder not found then show hidden files

  5. Open Project Again

Jameel Nazir
  • 134
  • 2
  • 7
2

If none of the above works: I discovered that my problem was that I had an empty environment variable, visible in the project properties (under Debug). Removing it fixed the problem:

enter image description here

C_Karlslund
  • 329
  • 3
  • 12
1

Go figure what I've found.... Building a 2015 project with vs2015 will succeed eventually... Let's say the project has 2 configurations (for this particular case): "Release MD|Win32" "Release MD|x64"

Calling

devenv myProject.vcxproj /build "Release MD|x64"

will work, but calling

devenv myProject.vcxproj /build "Release MD|Win32"

WILL NOT WORK

you have to simply call the devenv with x86 instead of Win32..... There is no reference what-so-ever in my project file to x86.... can't even find it as a comment...

ro0ter
  • 439
  • 2
  • 11
1

I tried all the options listed here and nothing worked for me. I found that another project folder had been dragged and dropped into the folder of my solution outside of visual studio. I put the folder back where it belonged and also had to delete the .suo file.

Just posting this in case anyone else runs into the dreaded drag and drop accidentally breaking the entire solution thing.

Keefe Higgins
  • 177
  • 2
  • 10
1

I got an identical error message running Microchip Studio (VS with bits taken out). the cause was two instances of the Microchip Studio application running together. Probably because both projects were configured to use an exclusive resource - a single Atmel-ICE connected to my system.

Solution: close both/all instances of Microchip Studio and restart with just one, the one you want to compile.

Programify
  • 21
  • 1
  • 6
0

I had same error when I tried to unload installer projects in solution folder. Trouble was in VS2017 and with extension Project Installer.

I had that error when tried unload projects at the time, when one installer project had unloaded already. If I reloaded it and then unloaded folder again all was good. Nevertheless I didn't found good solution. I tried to delete .suo file, it didn't help. I noticed that problem after updating VS from 15.8.3 to 15.8.4. Maybe trouble was in update.

0

None of the above worked for me. However restarting the computer fixed the issue.

0

In case this helps anyone, I also had this cryptic error - when I was in the VS Resource Editor, while trying to right click on a control and "Add Class".

Fixed by:

"Add or Remove Programs", Microsoft Visual Studio Installer, Modify, Modify. Add "Universal Windows Platform development". Add "C++ MFC for latest v142 build tools (x86 & x64)" (Under Individual Components).

Data_D
  • 11
  • 1
0

I know this is old but I solved it by opening the .sln file in a text editor and changing the project directory in the solution.

Octo
  • 26
  • 4
0

Had this issue in visual studio 2022, tired most of the recommendation and it didn't work for my case.

What worked for me was deleting the ".vs" folder.

To do this:

  1. Open your project folder and look for ".vs" folder. if you can't see this folder it's probably because your pc is set to hide hidden folders. so fix that using this link show hidden folders
  2. Delete the ".vs" folder. Don't worry visual studio will recreate this when you open the project again
  3. double click on the the project solution file to open the project in visual studio. the solution file is the file with the extension ".sln"
Ohien Stephen
  • 146
  • 1
  • 7
-1

Setting folder permissions for "C:\ProgramData\Microsoft\Crypto\RSA" so that it not only allows:

Read, Execute
Show Folder Contents 
Read

but also allow

Write

fixed the issue for me.

I did this for the group "Everyone" that is the base group for the others. You might want to only do this for the user or group that is using Visual Studio, or even use Visual Studio as admin to sign.

I did this for the RSA Folder because I wanted to sign with RSA. Tn the Crypto folder theres other folders too, and depending on your selected process you might want to do this for the whole Crypto folder or a different subfolder.

t0b4cc0
  • 319
  • 4
  • 19
-1

In my case, the solution was far less complicated. We had given the project name instead of the path to the project file as part of the /Project flag.

Arvindh Mani
  • 130
  • 3
  • 12