Visual Studio: The Operation could not be completed. The parameter is incorrect
Asked Answered
P

16

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!

Pliocene answered 9/2, 2016 at 1:39 Comment(6)
Fixed this by always running as administrator.Pliocene
Please consider trying to raise the visibility of this problem with Microsoft. See visualstudio.uservoice.com/forums/121579-visual-studio-2015/…Sector
Check the solution from thread: #9079966Symphony
This question mentions that restarting Visual Studio was tried, but for anyone landing here who hasn't tried that yet, do. See: https://mcmap.net/q/323590/-vs-2012-error-on-build-of-hello-world-quot-the-operation-could-not-be-completed-the-parameter-is-incorrect-quot/12484Am
in my case, i have restarted VS and the issue is fixed.Heeling
For me, it's becaues I had adjusted the time zone and date (for testing time and dst problem.)Tieck
A
50

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

Am answered 9/2, 2016 at 1:39 Comment(5)
If an admin login is required for VS to run, you are facing other issues.Apples
Running as admin could help you to see more detail but it could not be the solution.Egypt
Already running as admin when the problem started. Deleting .suo was what fixed it for me.Anthodium
I already had it running as admin as well, simply restarting VS did the trick for me.Leonidaleonidas
Run as Admin fixed this error for me. I did not have a .suo file in the folder.Helbona
O
39

This answer helped me: https://mcmap.net/q/117601/-visual-studio-popup-quot-the-operation-could-not-be-completed-quot 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.

Outport answered 15/9, 2017 at 17:48 Comment(4)
This worked for me after I closed the instance of visual studio and removed the .suo fileNovena
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!Leclair
Ran into this with VS2022 just trying to load a solution file. Deleted the entire .vs subfolder and then it loaded okay.Fulgurite
@mark's solution solved my problem (mine started after a power outage while I was working with vs2022)Hypochondriasis
D
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

Dorton answered 4/12, 2016 at 22:33 Comment(2)
What reference?Savoy
This happened to me in VS2017 following a code merge operation where AutoMerge had removed a project from the solution file. Simply adding the project back into the solution solved the issue.Alarise
P
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.

Phenylalanine answered 22/12, 2017 at 16:13 Comment(0)
C
6
  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

Conventioneer answered 21/9, 2022 at 6:53 Comment(0)
O
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

Optional answered 11/1, 2019 at 14:29 Comment(0)
G
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...

Glenoid answered 21/5, 2018 at 4:0 Comment(0)
D
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.

Dasilva answered 16/7, 2018 at 11:20 Comment(0)
O
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.

Operation answered 6/7, 2021 at 16:14 Comment(0)
D
1

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"
Dougald answered 9/8, 2023 at 8:42 Comment(0)
A
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.

Aharon answered 20/9, 2018 at 5:50 Comment(0)
A
0

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

Absorptivity answered 12/6, 2019 at 13:43 Comment(1)
In my case I removed and re-added the folder mapping on the workspace and that seems to have cleared it up.Yardstick
N
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).

Niklaus answered 26/12, 2020 at 7:45 Comment(0)
S
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.

Saccharate answered 23/5, 2022 at 14:28 Comment(0)
C
-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.

Coparcenary answered 20/5, 2020 at 10:54 Comment(0)
D
-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.

Diagnostics answered 5/6, 2020 at 14:11 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.