共用方式為


HOW TO:將豐富網際網路應用程式升級為 Visual Studio 2012

文件提供進行升級下列類型的功能豐富網際網路應用程式 (RIA) 的指示:

  • Silverlight 商務應用程式

  • Silverlight 應用程式或 Silverlight 使用自訂的 RIA 的巡覽應用程式的驗證服務。

  • Windows Communication Foundation (RIA) 服務類別程式庫。

  • ASP.NET Dynamic Data 實體 Web 應用程式 .

如果您在舊版 Visual Studio 建立 RIA,您必須升級應用程式,才能將它開啟在 Visual Studio 2012。

Silverlight 商務應用程式

如果您使用 Visual Studio 2012 開啟在 SP1 的 Visual Studio 2010 建立 C# 或 Visual Basic Silverlight 商務應用程式專案,您必須修改專案,因為它會取決於執行驗證的 Microsoft SQL Server 2008 Express 。 由於 SQL Server Express 永遠無法在 Visual Studio 2012,您必須更新專案以使用通用 ASP.NET 提供者。

在 Web.Config 檔中,修改下列部分使用通用提供者,範例程式碼所示:

連接字串區段:

  <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 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 區段:

  <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 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>

如果您使用 Visual Studio 2010 開啟在 SP1 的 Visual Studio 2012 建立 C# 或 Visual Basic Silverlight 商務應用程式專案,您必須修改專案,因為它會取決於執行驗證的全球提供者。 您必須更新該專案中使用 SQL Server Express。

在 Web.Config 檔中,修改下列部分使用 SQL Server Express,範例程式碼所示:

連接字串區段:

   <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 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 區段:

    <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 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>

Silverlight 應用程式或 Silverlight 使用自訂的 RIA 的巡覽應用程式的驗證服務。

除了在升級的在 SP1 的 Visual Studio 2010 建立的 Silverlight 商務應用程式的這個主題中列出的步驟以外,您也必須修改您的成員資格和角色提供者會在 System.Web.Providers.dll 的預設提供者所繼承。

警告

在 Visual Studio 2010 的 Web 程式開發伺服器不支援 Windows 驗證。如果您將 Visual Studio 2012 專案使用 Windows 驗證,您必須移除這些變更,在您將專案移轉至 Visual Studio 2010之前。或者,您可以將變更和使用 Internet Information Services (IIS) 而非 Web 程式開發伺服器就 Visual Studio 2010上。

Windows Communication Foundation (RIA) 服務類別程式庫。

您可以使用 Visual Studio 2012 開啟在 SP1 的 Visual Studio 2010 建立,而不需要修改的 C# 或 Visual Basic WCF RIA 服務類別庫專案。

您可以使用Visual Studio 2010與 SP1 來開啟一個在Visual Studio 2012建立並帶有下列修改的 C# or Visual Basic WCF RIA 服務類別程式庫專案: Visual Web Developer 2010 Express 不支援方案資料夾,使用 WCF RIA 服務在 Visual Studio Express 2012 for Web的類別庫專案。 因此,建議您先執行下列其中一個步驟,然後再遷移該類型的專案。

  • 移動 Silverlight 類別庫和 .NET 類別庫專案在方案資料夾外,然後刪除該資料夾。

  • 使用 Visual Studio 2010 版本的 Visual Web Developer 2010 Express 之外開啟在 Visual Studio Express 2012 for Web建立的專案。

ASP.NET Dynamic Data 實體 Web 應用程式

您可以在 Visual Studio 2012不需要修改 C# 或 Visual Basic ASP.NET Dynamic Data 實體在 SP1 的 Visual Studio 2010 建立的 Web 應用程式專案開啟這些檔案。

請參閱

概念

Visual Studio 2012 相容性