views:

13

answers:

1

Hi,

I'm creating the software for a course. What with exercise start points and worked solutions and both C# and VB I have about 100 VS2010 solutions.

During development I reopen these as neccessary and they get a lot of tweaking. When I'm done I want to leave the solutions with NO documents open. That way when the student opens the solution it's a very clean view, not littered with the files I was last looking at.

Up to VS2008 this was was easy. I simply deleted all the *.suo files - that seems to be where VS stores the window layout. When a solution was opened VS happily created a new SUO file. This approach was suggested in http://stackoverflow.com/questions/648803/close-all-files-in-visual-studio-on-exit

With VS2010 this causes an annoying dialog...

Security warning for You should only open projects from a trustworthy source

This is completely reproducible. 1) Open one of the solutions, for which there is no SUO file 2) VS gives a trust warning. User accepts it. SUO file is created. 3) Subsequent opening of the SLN don’t report trust problems. 4) Delete the SUO file. 5) Reopen the SLN and the trust errors reoccurs.

How can I achieve my ambition of having VS open up with no document windows open, and no security dialog? I really want it to be automated from OUTSIDE VS. Opening all of 100 solutions and manually closing the windows is NOT what I'm looking for.

It's pretty easy to create a macro that will close all windows, but I cannot see a way of starting VS from the command line and getting it to run a macro on startup.

A: 

This sounds like you downloaded the project file from an untrusted source. Scott Hanselman wrote a blog post about it. The short story is that if you go to the properties page for the project file (windows explorer -> right click project file -> properties), you can unblock the file with the button at the bottom: Properties page for a "blocked" file

Noah Richards
Hi - thanks for the response. I've been researching on the web and you are correct. I discovered Brad Abrams http://www.sys-con.com/node/1253270 and Jouni Heikniemi's http://www.heikniemi.net/hardcoded/2009/12/security-problems-with-downloaded-net-assemblies/ notes. Really useful. I downloaded Mark Russinovich's Streams (http://technet.microsoft.com/en-us/sysinternals/bb897440.aspx) program to strip out the "Came from the Web" marker.Now VS2010 is behaving just like 2008 did. I can delete the *.suo files and they are automatically recreated.
RichardHowells