Oslo, VS2010 CTP

Creating an “M” Project in VS 2010.

When you install “Oslo”, installation also adds one “Oslo” template in your Visual Studio.  It’s “M” Project. 

oslo_vs_plug-in

However, if you try to create a new “M” Project or open an existing one you probably will get the following error:

This method uses CAS policy, which has been obsoleted by the .NET Framework.  In order to enable CAS policy for compatibility reasons, please use the legacyCasPolicy configuration switch. Please see http://go2.microsoft.com/fwlink/?LinkId=131738 for more information.

English is not my first language, as you probably already realized that by reading my blog, but I thought that word obsolete is an adjective.  In this Microsoft error message it’s used like a verb “obsoleted”.

Well, enough about English.  I’m sure that you can take any of my posts and have a lot of fun criticizing my English.  If you want to do so, please do.  Your criticism probably will improve my English.

Let’s get back to the error.  You can follow the link in the message to read more about Security Changes in the .NET Framework 4.  One of the thing you can find there is that Code Access Security (CAS) policy got replaced by Windows Software Restriction Policies (SRP).

Historically, the .NET Framework has provided code access security (CAS) policy as a mechanism to tightly control and configure the capabilities of managed code. Although CAS policy is powerful, it can be complicated and restrictive. Furthermore, CAS policy does not apply to native applications, so its security guarantees are limited. System administrators should look to operating system-level solutions such as Windows Software Restriction Policies (SRP) as a replacement for CAS policy, because SRP policies provide simple trust mechanisms that apply to both managed and native code. As a security policy solution, SRP is simpler and provides better security guarantees than CAS.

However, it doesn’t tell us how we can fix our problem.  After some research, I got across documentation about legacyCasPolicy Element.

Next I open devenv.exe.config file that is in C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE folder and added following line:

   1: <legacyCasPolicy enabled="true"/>

You should add this line inside <runtime> element.

M_proj_error 

I understand that “Oslo” and VS 2010 are both Beta products so far.  I’m sure that Microsoft will resolve this problem in future releases. 

I realize that this is not the best solution.  However, it worked for me.  Please let me know if you can find a better solution.

kick it on DotNetKicks.com

Advertisements
Oslo

New May 2009 CTP for Microsoft “Oslo” is out.

Oslo_installIf you don’t know what “Oslo” is, it’s set of future Microsoft modeling technologies.  You can find out more at “Oslo” Developer Center.

In this release Microsoft finally is going to include “Quadrant”, a GUI tool for “Oslo”.

As for previous CTPs you need .NET Framework 3.5 SP1, SQL Server 2008, and VS 2008 or higher.  New install for “Oslo” allows to to customize the installation.  If you select “Install Now” instead of “Customize” option, all of “Oslo” is going to be installed.  It includes: “Quadrant, “Oslo” repository, and “Oslo” SDK.  You must to have administrator privileges in order to run installation.  You can find more details by reading Release Notes.

In case you have  a previous CTP installed on your machine, you must uninstall it before installing new CTP.  Also you must drops the ‘Repository’ from your SQL 2008 database. 

Microsoft also provides us with May CTP Samples.

After installing “Oslo” you can find template for “M” Project in your Visual Studio:

oslo_vs_plug-in

“Oslo” installation also is going to create Repository in your SQL 2008.

oslo_sql

kick it on DotNetKicks.com