Reputation: 11
I am using Visual studio 2015 Community.
When I first start without debugging (CTRL + F5) it works fine. After I click X (close the windows) and click again (CTRL + F5). I get this error:
Upvotes: 0
Views: 4413
Reputation: 49
I faced a similar issue.This is because VS locks your file before building, and sometimes the application does not close properly. So, the lock that's been provided to help build locks itself, showing build errors.
The simplest way would be to restart your Visual Studio/system to close all the threads. OR Build the application in Release mode(make sure you set your configurations right before building as per your requirement) OR Close all the Designer Windows and try again.
Upvotes: 1
Reputation: 1387
It looks like your application hasn't terminated fully and your assembly is still running.
When you build your project, msbuild cannot remove/copy your assembly into the build target folder because it is still occupied.
Upvotes: 1