Visual Studio: The Operation could not be completed. The parameter is incorrect
C#Visual StudioBuildVisual Studio-2015C# Problem Overview
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!
C# Solutions
Solution 1 - C#
Dan (the original poster) mentioned in a comment above that running Visual Stuio as admin solved this for him.
Solution 2 - C#
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.
Solution 3 - C#
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
Solution 4 - C#
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.
Solution 5 - C#
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...
Solution 6 - C#
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.
Solution 7 - C#
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:
Solution 8 - C#
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.
Solution 9 - C#
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.
Solution 10 - C#
None of the above worked for me. However restarting the computer fixed the issue.
Solution 11 - C#
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 sogn 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.
Solution 12 - C#
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.
Solution 13 - C#
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).