CS2012 Cannot Open .exe for writing - Access to path is denied - visual-studio-2017

I am trying to create a WPF project for the first time using VS2017 v15.8.
I am getting the error message consistently, although there are times I have been able to get it to run. When I go to run it again though I receive the error message. I have read all of the proposed solutions and nothing has worked including the following:
Restart computer
Rebuild the solution/project. (tried deleting .exe file before doing this also)
Confirmed the Output path is correct
Kill the MSBuild process tree
I also tried different combinations.
Any help in finding a solution to this is greatly appreciated.

That typically happens to me, when i forget to stop my running program. As the executable is running, it is open and hence should not be overwritten.

I have been able to work around this. The issues I was having occurred when I was trying to save the project to a network drive or to the default location in my user profile on the local drive. I tried creating it again and saved it in a root folder on the local drive it worked.

Related

Why shows error message when generating application release

I have the following problem, when generating the release of my application, it shows me this message, even though I add the libraries you need, that message still appears, also try using the windeployqt.exe and it does not work, any suggestion would be appreciated .
I am using version 5.15.2 of qt
I was able to solve my problem, I was checking in the advanced configuration of the system and it happened that it had several values, in the PATH variable with paths to the Qt installation folder, so I deleted them all and with that I could solve my problem, thanks for your answers.
now the problem is with respect to the database, I managed to generate the executable, add all the libraries you need, it happens that it does not show anything when I run it.
The application is already running, but the data is not displayed, which it queries from the DB.

How to compile/migrate a Visual Studio solution from a machine to another?

Recently I obtained a solution which has been created on another person's machine. I have been banging my head into the monitor in the past 2 days trying to fully migrate the solution to my machine. I have been manually changing the directory addresses of the solution and have not been able to compile the solution although I think I have corrected more than 100 paths as of now. Here's my first attempts to migrate the solution to my machine and resolve the issue of not being able to open any of the files.
Now I can open all the files in each project on my machine (after manually changing their paths). However, I am still getting the same errors and I'm not able to compile the project. Below is a picture of the errors I'm getting:
And here's the output log when trying to compile the project. So I wonder, can someone give me some advise on how I should go about doing the whole process automatically? In the output log I see there is a F:\Virtual ... path which indicates the solution been created on a virtual machine. However, I am not using a virtual machine and am not able to find the file file containing that path (F:...) so that I can change it to the correct one (I even do not know what the correct one should be since I am not using a VM).
If you are not able to help me through the description I gave or the output log file, you can download the whole solution from here and then give me some instructions on how I should go about compiling and using it. I really appreciate your help.
Chances are that someone went rogue on the project file, because normally all paths are defined in a way that is relative to the project or solution, making them portable.
In order to fix this, I see two options, either set up the project files from scratch or keep on hacking on them until they compile. Whichever path you take, keep in mind that VS supports placeholders like $(SolutionDir) you can refer to when setting up paths. If that doesn't work, please try to extract a minimal example.
Also, make sure you have a version control system set up, so you can retrace your steps. This should be standard in any software development, but considering the state of the project I wouldn't be surprised to find other, hairy places there.

VS2008 Build C++ Project on Network Drive

The short of it is, I have VMs for building different scenarios of software. I do not wish to snapshot the code as it is backup elsewhere so I am storing all my code on the host PC and only building/testing in VMs to save space. Unfortunately I am receiving program database update errors when I try to build from a location mapped to the host hdd.
I know there is nothing wrong with the C++ projects as they build fine if moved inside the VM.
I have tried:
-cleaning/rebuilding
-removing the debug/release folders entirely
-checking out a copy of the source onto the host drive from within the VM
*Even when the idb and pdb files that the compiler complains about are created by VS, the problem persists.
How can I stop these C2471 errors when building from a non-local drive?
Perhaps, problem in the files that was created by compiler at previus build. Try to remove Debug (or Release) folder and build project again.
I'm not entirely sure as to why, but the issue seems to be related to using shared folders in VirtualBox. If the folders are referenced via a direct UNC path to the host machine it appears to work fine, but accessing through a shared folder (mapped or unmapped to a drive letter) doesn't appear to have the correct permissions.

VS Community 2013 can't debug project in solution, even though solution builds and runs without issue?

A point to note:
I recently switched to a computer that has a hybrid SSD and HDD setup, since the SSD is small enough that it is best kept for the OS alone.
The Windows partition has 60 GB of space, and access to a 500 GB partition on the HDD.
The problem:
I cloned the project files to a directory using the GitHub windows GUI (I do all version control through the GitHub GUI, rather than using the built in VS functionality).
I was able to build the solution successfully. Then, upon pressing the "Start Debugging (F5)" button, I get the following error:
Here are the relevant project properties for the project in question:
What it looks like: it looks like \.\ isn't being parsed properly as "current directory". However, this is very weird given that I don't have any issues with the same project settings on other computers. EDIT: From further explorations (see below), I later found out that its not a parsing error, since VS cannot find the file in general. So, I wonder if it has anything to do with the recent switch to a new computer, and the way hard drives are set up? I think it is unlikely to be a problem with my GitHub workflow, since GitHub does not care about the Debug directory (it is ignored).
What could the issue be?
Things I have made sure of so far:
There are no errors in the CodeChain project (i.e. the build is successful without any weird errors):
I thought this might be an issue based on some other "Unable to start program" hits I got on Google, but I am able to rule it out.
I reverted changes by deleting the new branch I was working on, and completely cleaning the project from the disk in case it was an obscure error. I then recloned to its earlier last known working state, and got the following. I still get the same error.
I know for a fact that the file exists, and I also tried using a different variable to denote the directory where the output is located:
I still get the same error:
Maybe the double slashes are a problem (but they shouldn't be, right?). So I take out the superfluous slash: $(ProjectDir)Debug\. No luck:
Surprisingly, the solution as a whole does run, when I select the main project as the startup project!
The project I am trying to open creates a static *.lib file. This cannot be opened and run.
There is no way the project I was trying to debug was opening on other computers. Rather, I probably had a different startup project selected.
Indeed, this was the issue. I had forgotten which startup project I needed, and thus was not opening the right one.

EXE stops working if containing folder is renamed. MSVCP90.dll

This popup comes up as soon as the app is started:
The program can't start because MSVCP90.dll is missing from your computer.
Before anyone says "install the VC++ runtimes", wait! If I rename the folder containing my .EXE then the app runs. If I rename it back, it breaks. The app has been running for weeks without any changes to my system/VS installation (2008 SP1), we suddenly spotted this error a few days ago.
Lost as to why the name of the dir is causing issues... again this has not changed in months and all our resource paths are relative anyway, e.g "../someOtherDir/...."
It doesn't just do this on my PC, we have the /bin dir (the one containing EXE) in SVN and suddenly everyone started seeing the same issue, even though the binaries themselves seem just fine. Is it possible some additional data got put into SVN and that's the cause? Since it's not just one PC, there must be something either in SVN or the EXE itself...
Note this popup comes before our code even gets to run.
It seems that there is a .exe.manifest file lying around, specifying some other version of MSVCP90.dll. Removing this file should do the trick (In theory the manifest is the solution against dll hell, but in reality it is just a new PITA).
Try rolling back to some earlier SVN revisions and see if you can identify a change which made it stop working. A binary search will be most efficient for this. PATH settings might also be an issue?