unrecognized element

Topics: User Forum
May 30, 2012 at 1:33 AM

Hi,

I try to document an existing web site project but always get the error "unrecognized element." in Visual Studio 2010. I tried it with a new empty web site project. Created it by "File -> New Web Site ..." and add the <System.CodeDom> section into the web.config (see below).

But I can't get it running. The error "unrecognized Element" don't disappear.

Kind Regards,

Tobi

 

<?xml version="1.0"?>

<!--
  For more information on how to configure your ASP.NET application, please visit
  http://go.microsoft.com/fwlink/?LinkId=169433
  -->

<configuration>
  <connectionStrings>
    <add name="ApplicationServices"
         connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\aspnetdb.mdf;User Instance=true"
         providerName="System.Data.SqlClient" />
  </connectionStrings>

  <system.web>
    <compilation debug="false" strict="false" explicit="true" targetFramework="4.0" />

    <authentication mode="Forms">
      <forms loginUrl="~/Account/Login.aspx" timeout="2880" />
    </authentication>

    <membership>
      <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="/" />
      </providers>
    </membership>

    <profile>
      <providers>
        <clear/>
        <add name="AspNetSqlProfileProvider" type="System.Web.Profile.SqlProfileProvider" connectionStringName="ApplicationServices" applicationName="/"/>
      </providers>
    </profile>

    <roleManager enabled="false">
      <providers>
        <clear/>
        <add name="AspNetSqlRoleProvider" type="System.Web.Security.SqlRoleProvider" connectionStringName="ApplicationServices" applicationName="/" />
        <add name="AspNetWindowsTokenRoleProvider" type="System.Web.Security.WindowsTokenRoleProvider" applicationName="/" />
      </providers>
    </roleManager>

  </system.web>

  <system.webServer>
     <modules runAllManagedModulesForAllRequests="true"/>
  </system.webServer>

  <system.codedom>
  <compilers>
    

    <!-- For VB.NET -->
    <compiler language="vb;vbs;visualbasic;vbscript" extension=".vb"
      compilerOptions="/docpath:C:\Publish\Docs"
      type="EWSoftware.CodeDom.VBCodeProviderWithDocs,
              EWSoftware.CodeDom, Version=1.1.0.0, Culture=neutral,
              PublicKeyToken=d633d7d5b41cbb65">
      <!-- NOTE: Change value to "v3.5" for .NET 3.5 projects -->
      <providerOption name="CompilerVersion" value="v2.0"/>
    </compiler>
  </compilers>
  </system.codedom>

</configuration>

May 30, 2012 at 1:54 AM

Changing the configuration section in the web.config file fix it. Important was to remove the comment before the providerOption Element.

 

  <system.codedom>
  <compilers>
    

    <!-- For VB.NET -->
    <compiler language="vb;vbs;visualbasic;vbscript" extension=".vb"
      compilerOptions="/docpath:C:\Publish\Docs /imports:System,System.Web.Security"
      type="EWSoftware.CodeDom.VBCodeProviderWithDocs,
              EWSoftware.CodeDom, Version=1.1.0.0, Culture=neutral,
              PublicKeyToken=d633d7d5b41cbb65">
      <providerOption name="CompilerVersion" value="v4.0"/>
    </compiler>
  </compilers>
  </system.codedom>