Search code examples
c#visual-studiosteambot

Cannot open SteamTrade.dll for writing. Access to the path is denied


I get the following error:

Severity    Code    Description Project File    Line
Error       Cannot open 'D:\Programming\SteamBot\SteamTrade\obj\Debug\SteamTrade.dll' for writing -- 'Access to the path 'D:\Programming\SteamBot\SteamTrade\obj\Debug\SteamTrade.dll' is denied.'  SteamTrade  D:\Programming\SteamBot\SteamTrade\CSC  

I'm unable to compile the source with Visual Studio 2015 Community Edition on Windows 10.

After searching the internet the majority of the answer was to disable malware protection. I'm using Bitdefender Total Security 2016. First I tried to add an exception to the folder, after that even tried to disable the product, but still nothing. I can't get the project to build, failing with the same exact error.

Any idea?

Edit 1:

Still no idea. If I would be on Linux or on Drive C, I could imagine that I have actually no permission to write, but on Windows on drive D, there is no such thing. Today I'll be trying to compile it on a Virtual Machine to be sure that it's not my antivirus program. Still any suggestion is welcomed.


Solution

  • Alright, so after trying out everything I decided to try it on a virtual machine and it work from start. Then I tried it on a new source on my computer then it worked.

    I was quite surprised why, so I removed the exception in the anti virus software, then it didn't work anymore. So I added the exception again, but it still didn't worked. So what I did next is downloaded the source in a new folder and added to the exception before I tried to build it then it worked.

    Solution: So the short answer is if you want to make it work, you get the source from git, then add it to the exception in your anti-virus software and only then you try to build it, because if you build it beforehand it won't work no matter what. This is probably related to Bitdefender Total Security 2016, but at least it started working.