[Mono-aspnet-list] Error deserializing configuration section compilation: Unrecognized attribute 'targetFramework'

cwb124 cwb124 at yahoo.com
Fri Feb 21 16:43:39 UTC 2014


Using CentOS 6.1 and Mono 3.2.6 on Apache, no xsp installed.

Trying to host a NuGet gallery on Mono.  I create an empty web application
in VS2010 and add nuget.server.  I build the project and when I test it in
VS2010 it works.  It's a very basic .NET 4.0 web app.

I installed mono and configured apache goingt through all the docs so I
think things are in order.  When I copy the contents of the web site to the
CentOS box and browse to it, I get the dreaded:

Error deserializing configuration section compilation: Unrecognized
attribute 'targetFramework'. (/app/www/nugetsrus.sys.company.net/Web.config
line 1)

I've seen multiple posts around here and stackflow on it, but none of the
solutions work for me.  Removing the targetFramework - 4.0 from the
web.config gives me an internal server error when browsing after restarting
httpd.  I REALLY need some help, as we are trying to implement this in an
enterprise network for hosting nuget/chocolatey packages.  But I can't even
seem to get off the ground with mono and a .NET app.

*Here is the relevant portion of my httpd.conf:*
User apache
Group apache
Include conf.d/*.conf
Include /etc/httpd/conf/mod_mono.conf

*Relevant portion of the mod_mono.conf*
<IfModule !mod_mono.c>
    LoadModule mono_module /usr/lib64/httpd/modules/mod_mono.so
</IfModule>

<IfModule mod_headers.c>
    Header set X-Powered-By "Mono"
</IfModule>

AddType application/x-asp-net .aspx
AddType application/x-asp-net .asmx
AddType application/x-asp-net .ashx
AddType application/x-asp-net .asax
AddType application/x-asp-net .ascx
AddType application/x-asp-net .soap
AddType application/x-asp-net .rem
AddType application/x-asp-net .axd
AddType application/x-asp-net .cs
AddType application/x-asp-net .vb
AddType application/x-asp-net .master
AddType application/x-asp-net .sitemap
AddType application/x-asp-net .resources
AddType application/x-asp-net .skin
AddType application/x-asp-net .browser
AddType application/x-asp-net .webinfo
AddType application/x-asp-net .resx
AddType application/x-asp-net .licx
AddType application/x-asp-net .csproj
AddType application/x-asp-net .vbproj
AddType application/x-asp-net .config
AddType application/x-asp-net .Config
AddType application/x-asp-net .dll
AddType application/x-asp-net .svc
DirectoryIndex Default.aspx
MonoServerPath default "/opt/mono/bin/mod-mono-server4"
AddHandler mono .aspx .ascx .asax .ashx .config .cs .asmx .axd
MonoApplications "/:/app/www/nugetsrus.sys.company.net"

*Nuget.conf file:*
<VirtualHost *:80>
  DocumentRoot /app/www/nugetsrus.sys.company.net
  MonoDebug nugetsrus.sys.company.net true

  MonoSetEnv nugetsrus.sys.company.net MONO_IOMAP=all
  MonoApplications nugetsrus.sys.company.net
"/:/app/www/nugetsrus.sys.company.net"

  <Location "/">
    Allow from all
    Order allow,deny
    MonoSetServerAlias nugetsrus.sys.company.net
    SetHandler mono
    SetOutputFilter DEFLATE
    SetEnvIfNoCase Request_URI "\.(?:gif|jpe?g|png)$" no-gzip dont-vary
  </Location>
  <IfModule mod_deflate.c>
    AddOutputFilterByType DEFLATE text/html text/plain text/xml
text/javascript
  </IfModule>
</VirtualHost>


*When I browse to the site, I get the following info*
System.Configuration.ConfigurationErrorsException
Error deserializing configuration section compilation: Unrecognized
attribute 'targetFramework'. (/app/www/nugetsrus.sys.company.net/Web.config
line 1)

Description: HTTP 500.Error processing request.

Details: Non-web exception. Exception origin (name of application or
object): System.Configuration.
Exception stack trace:

Version Information: 3.2.6 (tarball Sat Jan 18 15:27:07 UTC 2014); ASP.NET
Version: 2.0.50727.1433

Can anyone throw be a bone here and point me in the right direction? 
Unfortunately I'm not a *nix guy by trade but I've had some help in getting
everything setup.  

*Web.config*
<?xml version="1.0" encoding="utf-8"?>



<configuration>
  <configSections>
    <sectionGroup name="elmah">
      <section name="security" requirePermission="false"
type="Elmah.SecuritySectionHandler, Elmah"/>
      <section name="errorLog" requirePermission="false"
type="Elmah.ErrorLogSectionHandler, Elmah"/>
      <section name="errorMail" requirePermission="false"
type="Elmah.ErrorMailSectionHandler, Elmah"/>
      <section name="errorFilter" requirePermission="false"
type="Elmah.ErrorFilterSectionHandler, Elmah"/>
    </sectionGroup>
  </configSections>
    <system.web>
      <compilation targetFramework="4.0"/>
      <customErrors mode="Off"/>
    <httpModules>
      <add name="ErrorLog" type="Elmah.ErrorLogModule, Elmah"/>
      <add name="ErrorMail" type="Elmah.ErrorMailModule, Elmah"/>
      <add name="ErrorFilter" type="Elmah.ErrorFilterModule, Elmah"/>
    </httpModules><httpRuntime maxRequestLength="31457280"/></system.web>

<system.webServer>
    <validation validateIntegratedModeConfiguration="false"/>
    <modules runAllManagedModulesForAllRequests="true">
      <add name="ErrorLog" type="Elmah.ErrorLogModule, Elmah"
preCondition="managedHandler"/>
      <add name="ErrorMail" type="Elmah.ErrorMailModule, Elmah"
preCondition="managedHandler"/>
      <add name="ErrorFilter" type="Elmah.ErrorFilterModule, Elmah"
preCondition="managedHandler"/>
    </modules>
  <staticContent>
      <mimeMap fileExtension=".nupkg" mimeType="application/zip"/>
    </staticContent></system.webServer><elmah>
    
    <security allowRemoteAccess="false"/>
  <errorLog type="Elmah.XmlFileErrorLog, Elmah"
logPath="~/App_Data"/></elmah><location path="elmah.axd"
inheritInChildApplications="false">
    <system.web>



Under what circumstances is targetFramework an unrecognized attribute and
how do I fix it?  Is it a problem with the web site I created or with my
apache/mod_mono config?  Desperate here, been at this for 2 days straight
and have gotten nowhere. 



--
View this message in context: http://mono.1490590.n4.nabble.com/Error-deserializing-configuration-section-compilation-Unrecognized-attribute-targetFramework-tp4661986.html
Sent from the Mono - ASP.NET mailing list archive at Nabble.com.


More information about the Mono-aspnet-list mailing list