Recently, a message with this caption started popping up when I open some of my projects with Visual Studio 2008.
The detailed text of the message is:
The <Project Name> project file has been customized and could present a security risk by executing custom build steps when opened in Microsoft Visual Studio. If this project came from an untrustworthy source, it could cause damage to your computer or compromise your private information.
- Load Project for Browsing
- Load Project Normally
A “More Details” button follows. When I press it I get a message box with:
An item referring to the file "" was found in the project file <Project File Path>. Since this file is located in a system directory, root directory or network share it could be harmful to write to this file.
Needless to say, I haven’t (knowingly) added custom build steps to these projects, nor had I knowingly add references to a file named “”.
The most annoying thing about this warning is that there seems to be no way to turn it off for next time. It appears everytime I open the project.
I googled this and there are many complaints, but no answers that I could find. (Some developers reinstalled Visual Studio 2008 and the problem didnt go away.)
I managed to work around the problem in every case I encountered it, and here is how. But beware, I dont know real cause of the problem or what side effects this change may have, so take my tip at your own risk : )
Workaround
- Open the project.
- When the Security Dialog comes up, press OK to load the project.
- In Solution Explorer right click on the project and select “Unload Project”
- Right click again on the project and select “Edit <Project Name>.csproj”
- In the first PropertyGroup element under the root element, delete the <ProjectGuid> element.
- Save the project file.
- In Solution Explorer, right click again on the project and select “Reload Project”
Hey Presto, the security dialog box doesn’t appear any more.
To Undo
The ProjectGuid is still stored in your solution file for the project.
An easy way to get it back into your project is as follows.
- Follow steps 1-4 in the Workaround.
- Add an empty <ProjectGuid></ProjectGuid> element anywhere (XML valid) in the first PropertyGroup element.
- Load the project again.
- Select Save All (or press OK on the prompt to save the project when you close the solution).
This restores the original ProjectGuid value inside the element you added (and with it, the annoying security dialog).
Afterword
As I cant explain this workaround, it is not a solution as far as I am concerned. I will continue looking out for a proper one, and if you know or find one meanwhile, please comment and share it !