Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disable "You should only open projects from a trustworthy source" message in VS 2015

I am opening the project from a network share and it keeps prompting me for this. Anyone know how to stop the warning?

This is in Visual Studio 2015 blend.

https://social.msdn.microsoft.com/Forums/vstudio/en-US/7cf8f449-6f6c-42d4-bc41-ddf55142d8f1/how-to-disable-security-warning-you-should-only-open-projects-from-a-trustworthy-source?forum=vseditor

like image 941
Rob Avatar asked Jul 02 '15 14:07

Rob


2 Answers

Just uncheck the following option:

  • Tools > Options > Projects and Solutions > Warn user when project location is not trusted
like image 131
Lars Bilke Avatar answered Nov 20 '22 13:11

Lars Bilke


Rather than completely disabling the warning, you can remove the information that Windows uses to identify that the solution/project came from an untrustworthy source (but only for projects e.g. downloaded from the internet -- if you're opening them from a network location it considers non-trustworthy, such as a share that's not on Local Intranet, this doesn't apply). It stores this in an "Alternate Data Stream" (ADS) which you can view by running the following from the command prompt:

C:\devs\MyProject>dir /r
 Directory of C:\devs\MyProject

09/29/2016  03:43 PM    <DIR>          .
09/29/2016  03:43 PM    <DIR>          ..
09/29/2016  03:42 PM    <DIR>          API
09/29/2016  03:42 PM    <DIR>          bin
10/17/2016  10:32 AM             3,078 Project1.csproj
                                    26 Project1.csproj:Zone.Identifier:$DATA

The Zone.Identifier:$DATA ADS file is what's causing VS to identify it as untrusted. You can remove the data just for that project by right-clicking the csproj file, clicking Properties, and choosing "Unblock" on the General tab.

Unblock in Explorer

Or, to remove the ADS recursively for all files in a directory, download the streams tool from SysInternals, cd to the directory and type:

streams -s -d .

Note that you can actually view the ADS file, which is just a regular text file, by typing e.g.

notepad Project1.csproj:Zone.Identifier:$DATA

In this case, it will have contents such as:

[ZoneTransfer]
ZoneId=3
like image 34
Tobias J Avatar answered Nov 20 '22 15:11

Tobias J