How to: Upgrade Rich Internet Applications to Visual Studio 2012

This document provides instructions for upgrading the following types of Rich Internet Applications (RIA):

If you created a RIA in a previous version of Visual Studio, you must upgrade that application before you can open it in Visual Studio 2012.

If you are using Visual Studio 2012 to open a C# or Visual Basic Silverlight Business Application project that was created in Visual Studio 2010 with SP1, you must modify the project because it depends on an instance of Microsoft SQL Server 2008 Express for authentication. Because SQL Server Express isn’t always available in Visual Studio 2012, you must update your project to use ASP.NET universal providers instead.

In the Web.Config file, modify the following sections to use universal providers, as the sample code shows:

Connection String section:

  <connectionStrings>
    <!--<add name="ApplicationServices"
         connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\aspnetdb.mdf;User Instance=true"
         providerName="System.Data.SqlClient" />-->
    <add name="DefaultConnection" connectionString="Data Source=(LocalDB)\v11.0;Initial Catalog=aspnet-BusinessApplication1.Web-20111129040955;Integrated Security=True;MultipleActiveResultSets=True" providerName="System.Data.SqlClient"/>
  </connectionStrings>

Membership section:

  <membership defaultProvider="DefaultMembershipProvider">
      <providers>
        <clear/>
        <!--<add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider" connectionStringName="ApplicationServices"
             enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="false"
             maxInvalidPasswordAttempts="5" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10"
             applicationName="/" />-->
        <add name="DefaultMembershipProvider" type="System.Web.Providers.DefaultMembershipProvider, System.Web.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" connectionStringName="DefaultConnection" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="false" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10" applicationName="/"/>
      </providers>
  </membership>

roleManager section:

  <roleManager enabled="true" defaultProvider="DefaultRoleProvider">
      <providers>
        <clear/>
        <!--<add name="AspNetSqlRoleProvider" type="System.Web.Security.SqlRoleProvider" connectionStringName="ApplicationServices" applicationName="/" /> -->
        <add name="DefaultRoleProvider" type="System.Web.Providers.DefaultRoleProvider, System.Web.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" connectionStringName="DefaultConnection" applicationName="/"/>
        <add name="AspNetWindowsTokenRoleProvider" type="System.Web.Security.WindowsTokenRoleProvider" applicationName="/"/>
      </providers>
  </roleManager>

profile section

  <profile defaultProvider="DefaultProfileProvider">
      <providers>
        <clear/>
        <!--<add name="AspNetSqlProfileProvider" type="System.Web.Profile.SqlProfileProvider" connectionStringName="ApplicationServices" applicationName="/"/>-->
        <add name="DefaultProfileProvider" type="System.Web.Providers.DefaultProfileProvider, System.Web.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" connectionStringName="DefaultConnection" applicationName="/"/>
      </providers>
      <properties>
        <add name="FriendlyName"/>
      </properties>
  </profile>

If you are using Visual Studio 2010 with SP1 to open a C# or Visual Basic Silverlight Business Application project that was created in Visual Studio 2012, you must modify the project because it depends on universal providers for authentication. You must update that project to use SQL Server Express.

In the Web.Config file, modify the following sections to use SQL Server Express, as the sample code shows:

Connection String section:

   <connectionStrings>
    <add name="ApplicationServices"
         connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\aspnetdb.mdf;User Instance=true"
         providerName="System.Data.SqlClient" />
    <!--<add name="DefaultConnection" connectionString="Data Source=(LocalDB)\v11.0;Initial Catalog=aspnet-BusinessApplication1.Web-20111129040955;Integrated Security=True;MultipleActiveResultSets=True" providerName="System.Data.SqlClient"/>-->
   </connectionStrings>

Membership section:

   <membership defaultProvider="AspNetSqlMembershipProvider">
      <providers>
        <clear/>
        <add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider" connectionStringName="ApplicationServices"
             enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="false"
             maxInvalidPasswordAttempts="5" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10"
             applicationName="/" />
        <!--<add name="DefaultMembershipProvider" type="System.Web.Providers.DefaultMembershipProvider, System.Web.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" connectionStringName="DefaultConnection" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="false" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10" applicationName="/"/>-->
      </providers>
   </membership>

roleManager section:

    <roleManager enabled="true" defaultProvider="AspNetSqlRoleProvider">
      <providers>
        <clear/>
        <add name="AspNetSqlRoleProvider" type="System.Web.Security.SqlRoleProvider" connectionStringName="ApplicationServices" applicationName="/" /> 
        <!--<add name="DefaultRoleProvider" type="System.Web.Providers.DefaultRoleProvider, System.Web.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" connectionStringName="DefaultConnection" applicationName="/"/>-->
        <add name="AspNetWindowsTokenRoleProvider" type="System.Web.Security.WindowsTokenRoleProvider" applicationName="/"/>
      </providers>
   </roleManager>

profile section:

   <profile defaultProvider="AspNetSqlProfileProvider">
      <providers>
        <clear/>
        <add name="AspNetSqlProfileProvider" type="System.Web.Profile.SqlProfileProvider" connectionStringName="ApplicationServices" applicationName="/"/>
        <!--<add name="DefaultProfileProvider" type="System.Web.Providers.DefaultProfileProvider, System.Web.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" connectionStringName="DefaultConnection" applicationName="/"/>-->
      </providers>
      <properties>
        <add name="FriendlyName"/>
      </properties>
   </profile>

In addition to the steps listed earlier in this topic for upgrading a Silverlight business application that was created in Visual Studio 2010 with SP1, you must modify your own membership and role providers to inherit from default providers in the System.Web.Providers.dll.

Caution note Caution

The web development server in Visual Studio 2010 doesn’t support Windows Authentication. If you configure your Visual Studio 2012 project to use Windows Authentication, you must remove those changes before you migrate the project to Visual Studio 2010. As an alternative, you could keep the changes and use Internet Information Services (IIS) instead of the web development server in Visual Studio 2010.

You can use Visual Studio 2012 to open a C# or Visual Basic WCF RIA Services Class Library project that was created in Visual Studio 2010 with SP1 without any modification.

You can use Visual Studio 2010 with SP1 to open a C# or Visual Basic WCF RIA Services Class Library project that was created in Visual Studio 2012 with the following modifications. Visual Web Developer 2010 Express doesn’t support solution folders, which are used in WCF RIA Services Class Library projects in Visual Studio Express 2012 for Web. Therefore, we recommend that you perform one of the following steps before you migrate that kind of project.

  • Move the Silverlight Class Library and .NET Class Library projects out of the solution folder, and then delete that folder.

  • Use a version of Visual Studio 2010 other than Visual Web Developer 2010 Express to open projects that were created in Visual Studio Express 2012 for Web.

You don't need to modify C# or Visual Basic ASP.NET Dynamic Data Entities Web Application projects created in Visual Studio 2010 with SP1 to open them in Visual Studio 2012.

Show: