Saturday, May 08, 2010

 

FullTrust network share for .Net 3.5 in VS2010

Running a .NET 3.5 WCF based Silverlight application in Visual Studio 2010 stored in a network share (despite VS2010 supposably being nice to local shares) still gives me the following error: request for the permission of type 'system.web.aspnethostingpermission' failed

Running the same application locally produces no error at all.

This is because of what ShawnFa explains on his blog: http://blogs.msdn.com/shawnfa/archive/2008/05/12/fulltrust-on-the-localintranet.aspx#9968863

The Fix I found for this is to do the same CasPol that was necessary in VS2008. I ran both of these, not sure which one took because it did not work until VS 2010 was restarted. "S:" is a drive letter mapped to a network share.
CasPol.exe -m -ag 1.2 -url file://S:\FilePath\* FullTrust

From http://support.microsoft.com/?id=320268
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727>CasPol.exe -m -ag 1 -url file://S:\FilePath\* FullTrust -exclusive on

I also read about an option for installing the Framework SDK option. I didn't bother pursuing this since the CasPol did the trick.
So First the .NET Framework SDK needs to be installed so that I can grant fullTrust rights to the remote share: http://support.microsoft.com/?id=320268

the .NET Framework SDK can be found here: http://www.microsoft.com/downloads/details.aspx?FamilyID=e6e1c3df-a74f-4207-8586-711ebe331cdc&displaylang=en

http://www.15seconds.com/issue/040121.htm

Labels: , ,


Monday, April 12, 2010

 

VS 2008 FullTrust Network Share in VS 2010

I installed the release version of VS(Visual Studio) 2010 that came out yesterday. My old VS 2008 was setup to run projects with FullTrust on a network share, described in my Sept. 23rd, 2009 post. This wasn't supposed to be an issue with VS 2010. Yet, I recieved the following error:

System.IO.FileLoadException: Could not load file or assembly
...
System.NotSupportedException: An attempt was made to load an assembly from a network location which would have caused the assembly to be sandboxed in previous versions of the .NET Framework. This release of the .NET Framework does not enable CAS policy by default, so this load may be dangerous. If this load is not intended to sandbox the assembly, please enable the loadFromRemoteSources switch. See http://go.microsoft.com/fwlink/?LinkId=155569 for more information.


That link didn't offer much help. Running CasPol from C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319 was not supposed to do anything in VS 2010.

I came across the following post, http://social.msdn.microsoft.com/Forums/en-US/webdevelopmentprerelease/thread/ea9b9cab-cbfd-496d-8a81-7b3dd06e8c23

Closing VS 2010, then opening the %ProgramFiles%\Microsoft Visual Studio 10.0\Common7\IDE\devenv.exe.config file and adding the loadFromRemoteSources element as follows:
<runtime>
<loadFromRemoteSources enabled="true" />
</runtime>

Worked wonders. My VS 2008 projects now run without a hitch in VS 2010.

Labels: , ,


This page is powered by Blogger. Isn't yours?

Subscribe to Posts [Atom]