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.
From http://support.microsoft.com/?id=320268
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
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: .Net 3.5, Silverlight, VisualStudio 2010
Saturday, May 01, 2010
Silverlight & ASP.NET Framework Versioning
Below describes how to create a silverlight app that uses a specific .NET framework version for Silverlight with a separate and also specific ASP.NET framework version that your web host will support. After doing this once it's a trivial thing to repeat.
1. Create Silverlight project using your preferred framework version
1.1 Uncheck "Host the Silverlight application in a new Web site". Checking this will not let you pick the framework version of the new website.
2. Right click Solution and select "Add/New Project". If you want the default New Web project type (ASP.NET Web Application Project" do NOT select "Add/Web Site..."
3. Select "ASP.NET Web Application".
3.1 Change the .NET Framework version (at the top) to what your web host supports.
3.2 Change the name (at the bottom) to have a ".web" at the end.
3.3 Double check the location is the same as your Silverlight app.
3.4 Click ok
4. Right click the ".web" project you just added and select "Set as Startup Project".
5. Right click the ".web" project again and click "Properties"
5.1 Select Silverlight Applications
5.2 Click "Add..."
5.3 ensure it shows the correct Silverlight project.
5.4 Click "Add"
5.5 Click "ok"
6. right click to "Set as Start Page" or copy code from the "(SilverlightProjName)TestPage.aspx" to Default.aspx
Your Silverlight application (Of your chosen framework version) should now be visible in the ASP.NET site you created.
1. Create Silverlight project using your preferred framework version
1.1 Uncheck "Host the Silverlight application in a new Web site". Checking this will not let you pick the framework version of the new website.
2. Right click Solution and select "Add/New Project". If you want the default New Web project type (ASP.NET Web Application Project" do NOT select "Add/Web Site..."
3. Select "ASP.NET Web Application".
3.1 Change the .NET Framework version (at the top) to what your web host supports.
3.2 Change the name (at the bottom) to have a ".web" at the end.
3.3 Double check the location is the same as your Silverlight app.
3.4 Click ok
4. Right click the ".web" project you just added and select "Set as Startup Project".
5. Right click the ".web" project again and click "Properties"
5.1 Select Silverlight Applications
5.2 Click "Add..."
5.3 ensure it shows the correct Silverlight project.
5.4 Click "Add"
5.5 Click "ok"
6. right click to "Set as Start Page" or copy code from the "(SilverlightProjName)TestPage.aspx" to Default.aspx
Your Silverlight application (Of your chosen framework version) should now be visible in the ASP.NET site you created.
Labels: .NET Framework version, Silverlight
Subscribe to Posts [Atom]