locked
ProfileCommon Ambiguous RRS feed

  • Question

  • User170084455 posted

    I'm creating a multi-language web site using ASP.NET and Framework 3.5. So far no login required. Everything has been working fine. But when I update my windows 7 and software and compile the site the follow error appear

     ----------------------------------------------------------

    Server Error in '/' Application.

    Compilation Error

    Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

    Compiler Error Message: BC30554: 'ProfileCommon' is ambiguous.

    This are my codes:

    web.config

    <connectionStrings>
      </connectionStrings>
      <system.net>
        <mailSettings>
          <smtp from="jose.figueroa12@gmail">
            <network host="smtp.gmail.com" port="587" />
          </smtp>
        </mailSettings>
      </system.net>
      <system.web>
        <anonymousIdentification enabled="true"/>
        <authorization>
          <allow users="*" />
        </authorization>
        <!--profile inherits="System.Web.Profile.ProfileBase"-->
        <profile defaultProvider="AspNetSqlProfileProvider" inherits="System.Web.Profile.ProfileBase">
          <properties>
            <add name="UICulture" allowAnonymous="true" defaultValue="es-PR"/>
            <add name="Culture" allowAnonymous="true" defaultValue="es-PR" />
            <add name="PreferredCulture" allowAnonymous="true" defaultValue="es-PR"/>
          </properties>
        </profile>
        <globalization culture="es-ES" uiCulture="es-ES"/>
        <!--
                Set compilation debug="true" to insert debugging
                symbols into the compiled page. Because this
                affects performance, set this value to true only
                during development.
            -->
        <compilation debug="true">
          <assemblies>
            <add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
            <add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
            <add assembly="System.Data.DataSetExtensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
            <add assembly="System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
          </assemblies>
        </compilation>
        <!--
                The <authentication> section enables configuration
                of the security authentication mode used by
                ASP.NET to identify an incoming user.
            -->
        <authentication mode="Windows"/>


    default.aspx

    <script runat="server">
        Protected Overrides Sub InitializeCulture()
            Dim CurrentContext As HttpContext = HttpContext.Current
            Dim UserCulture As String = CurrentContext.Profile.GetPropertyValue("PreferredCulture").ToString()
            If UserCulture <> "" Then
                Thread.CurrentThread.CurrentUICulture = New CultureInfo(UserCulture)
                Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture(UserCulture)
            End If
        End Sub

       Private Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Load
            If Not IsPostBack Or CStr(Session("CultureName")) <> CultureInfo.CurrentCulture.Name Then
                Session("CultureName") = CultureInfo.CurrentCulture.Name
            End If

       End Sub 'Page_Load
        
        Protected Sub SetLanguage(ByVal sender As Object, ByVal e As EventArgs)
            'Save selected user language in profile
            Profile.SetPropertyValue("PreferredCulture", "es-PR")
            'Force re-initialization of the page to fire InitializeCulture()
            Response.Redirect(Request.Url.LocalPath)
        End Sub
        
        Protected Sub SetLanguageEn(ByVal sender As Object, ByVal e As EventArgs)
            'Save selected user language in profile
            Profile.SetPropertyValue("PreferredCulture", "en")
            'Force re-initialization of the page to fire InitializeCulture()
            Response.Redirect(Request.Url.LocalPath)
        End Sub

    </script>



    If I run the olds files with the precompiled file this work. Frown

    Thursday, March 11, 2010 7:17 PM

Answers

  • User170084455 posted

    I resolve this error when delete the bin folder. Tongue out Thank.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, March 15, 2010 3:28 PM