Visual Studio, VS2010 CTP

Visual Studio 2010 RC is out.

Finally VS 2010 RC is out.  It’s available to MSDN subscribers today, February 8th.  Everybody else will be able to download it on February 10th.

Advertisements
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

Tips And Tricks, Visual Studio, VS2010 CTP

Copy & Paste is broken in Visual Studio 2010 CTP

I was astonished when I realized that copying & pasting a line in VS 2010 doesn’t works the same as in previous versions of Visual Studio.  I wasC_Key blogging more than a year ago about wonderful feature how to copy and paste in Visual Studio.

In previous versions you can copy a line by moving cursor anywhere on a line you want to copy and without selecting anything press Ctrl-C.  Then you can paste that  line anywhere by pressing Ctrl-V.  The line will be inserted above the line where the cursor is without breaking that line.

However, in VS 2010 CTP the same technique will not work despite that option to turn this feature on/off exists in Options dialog.  Just open this dialog by selecting Tools/Options and then select Text Editor/All Languages.  ‘Apply Cut or Copy commands to blank lines when there is no selection’ check box should be checked by default.

2010_Option_Copy_Paste

Actually in previous VS version I notice the same broken behavior with XAML files.

I really hope that Microsoft will make copy & paste work as before.  I’m so used to move line up or down with Ctrl-C and Ctrl-V keys.

kick it on DotNetKicks.com