7 Replies - 4909 Views - Last Post: 04 February 2013 - 01:54 PM Rate Topic: -----

#1 Blasterman007  Icon User is offline

  • New D.I.C Head

Reputation: 2
  • View blog
  • Posts: 42
  • Joined: 15-September 09

Compile / Parser Errors with WebConfig and Inherit Code

Posted 04 February 2013 - 08:18 AM

I am really stuck and looking for some insight and suggestions. I built an ASPX project that works perfectly on my workstation in Dev environment. When I transferred into production, it fails.

In a nutshell, I created an ASPX project that uses the reporting features. We wanted it viewable on the extranet so I published into a folder on the extranet project project. I copied in the compiled code into the Bin folder. Both projects are using namespace so they shouldn't conflict. In IIS, we built a virtual directory so when you go to www.mycompany.com\virtualdirectory it would launch my default.aspx page.

Primary failure: The value for the 'compilerVersion' attribute in the provider options must be 'v4.0' or later if you are compiling for version 4.0 or later of the .NET Framework. To compile this Web application for version 3.5 or earlier of the .NET Framework, remove the 'targetFramework' attribute from the <compilation> element of the Web.config file.

Don't understand the problem because I do not have targetFramework in my web.config. When I add it, my visual studio 2008 does not like it saying it is not declared. Below is the WebConfig minus connection strings:
<?xml version="1.0"?> 
<configuration> 
         
  <configSections> 
                <sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"> 
                        <sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"> 
                                <section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/> 
                                <sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"> 
                                        <section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="Everywhere"/> 
                                        <section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/> 
                                        <section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/> 
                                        <section name="roleService" type="System.Web.Configuration.ScriptingRoleServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/> 
        </sectionGroup> 
      </sectionGroup> 
    </sectionGroup> 
  </configSections><appSettings/> 
         
  <connectionStrings></connectionStrings> 
         
  <system.web> 
                 
    <!-- 
            Set compilation debug="true" to insert debugging 
            symbols into the compiled page. Because this 
            affects performance, set this value to true only 
            during development. 
 
            Visual Basic options: 
            Set strict="true" to disallow all data type conversions 
            where data loss can occur. 
            Set explicit="true" to force declaration of all variables. 
        --> 
                 
    <customErrors mode="Off"></customErrors> 
     
    <compilation debug="true" strict="false" explicit="true"> 
      <assemblies> 
                                <add assembly="Microsoft.ReportViewer.WebForms, Version=9.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/> 
                                <add assembly="Microsoft.ReportViewer.Common, Version=9.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/> 
                                <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.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/> 
                                <add assembly="System.Data.DataSetExtensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/></assemblies> 
                        <buildProviders> 
                                <add extension=".rdlc" type="Microsoft.Reporting.RdlBuildProvider, Microsoft.ReportViewer.Common, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/> 
                        </buildProviders> 
                </compilation> 
                 
    <pages> 
                        <namespaces> 
                                <clear/> 
                                <add namespace="System"/> 
                                <add namespace="System.Collections"/> 
                                <add namespace="System.Collections.Generic"/> 
                                <add namespace="System.Collections.Specialized"/> 
                                <add namespace="System.Configuration"/> 
                                <add namespace="System.Text"/> 
                                <add namespace="System.Text.RegularExpressions"/> 
                                <add namespace="System.Linq"/> 
                                <add namespace="System.Xml.Linq"/> 
                                <add namespace="System.Web"/> 
                                <add namespace="System.Web.Caching"/> 
                                <add namespace="System.Web.SessionState"/> 
                                <add namespace="System.Web.Security"/> 
                                <add namespace="System.Web.Profile"/> 
                                <add namespace="System.Web.UI"/> 
                                <add namespace="System.Web.UI.WebControls"/> 
                                <add namespace="System.Web.UI.WebControls.WebParts"/> 
                                <add namespace="System.Web.UI.HtmlControls"/> 
      </namespaces> 
                        <controls> 
                                <add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> 
                                <add tagPrefix="asp" namespace="System.Web.UI.WebControls" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> 
      </controls> 
    </pages> 
                 
    <!-- 
            The <authentication> section enables configuration 
            of the security authentication mode used by 
            ASP.NET to identify an incoming user. 
        --> 
                 
    <authentication mode="Windows"/> 
                 
    <!-- 
            The <customErrors> section enables configuration 
            of what to do if/when an unhandled error occurs 
            during the execution of a request. Specifically, 
            it enables developers to configure html error pages 
            to be displayed in place of a error stack trace. 
 
        <customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm"> 
            <error statusCode="403" redirect="NoAccess.htm" /> 
            <error statusCode="404" redirect="FileNotFound.htm" /> 
        </customErrors> 
        --> 
     
    <httpHandlers> 
                        <add verb="*" path="Reserved.ReportViewerWebControl.axd" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/> 
                        <remove verb="*" path="*.asmx"/> 
                        <add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> 
                        <add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> 
                        <add verb="GET,HEAD" path="ScriptResource.axd" validate="false" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> 
    </httpHandlers> 
                <httpModules> 
                        <add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> 
    </httpModules> 
  </system.web> 
   
  <system.codedom> 
                        <compilers> 
                                <compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" type="Microsoft.VisualBasic.VBCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" warningLevel="4"> 
                                        <providerOption name="CompilerVersion" value="v3.5"/> 
                                        <providerOption name="OptionInfer" value="true"/> 
                                        <providerOption name="WarnAsError" value="false"/> 
        </compiler> 
      </compilers> 
  </system.codedom> 
         
  <!-- 
        The system.webServer section is required for running ASP.NET AJAX under Internet 
        Information Services 7.0.  It is not necessary for previous version of IIS. 
    --> 
         
  <system.webServer> 
                        <validation validateIntegratedModeConfiguration="false"/> 
                <modules> 
                        <remove name="ScriptModule"/> 
                        <add name="ScriptModule" preCondition="managedHandler" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/></modules> 
                <handlers> 
                        <remove name="WebServiceHandlerFactory-Integrated"/> 
                        <remove name="ScriptHandlerFactory"/> 
                        <remove name="ScriptHandlerFactoryAppServices"/> 
                        <remove name="ScriptResource"/> 
                        <add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> 
                        <add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> 
                        <add name="ScriptResource" verb="GET,HEAD" path="ScriptResource.axd" preCondition="integratedMode" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> 
      <add name="Reserved-ReportViewerWebControl-axd" path="Reserved.ReportViewerWebControl.axd" verb="*" type="Microsoft.Reporting.WebForms.HttpHandler" resourceType="Unspecified"/> 
    </handlers> 
  </system.webServer> 
 
 
  <runtime> 
                <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> 
                         
      <dependentAssembly> 
                                <assemblyIdentity name="System.Web.Extensions" publicKeyToken="31bf3856ad364e35"/> 
                                <bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/> 
      </dependentAssembly> 
                         
      <dependentAssembly> 
                                <assemblyIdentity name="System.Web.Extensions.Design" publicKeyToken="31bf3856ad364e35"/> 
                                <bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/> 
      </dependentAssembly> 
    </assemblyBinding> 
  </runtime> 
 
</configuration>


I followed some blog suggestions and I added the targetFramework = "4.0" and changed compiler from v3.5 to v4.0 even though VS2008 didn't like it. When I ran the web pages, I no longer get the error above but get a whole new error:

I get a server error, parser error, could not load type AKSMReporting._default and it shows me the top line of the asp page as follows:

<%@ Page Language="vb" AutoEventWireup="false" Codebehind="default.aspx.vb" Inherits="AKSMReporting._default" %>


I tried the following to get past this error without success:
Change CodeBehind to CodeFile
Removed Compilers and Assemblies from WebConfig
Deleted Bin, recreated and reposted to site
tried moving project to different sub-directories due to folder restrictions of ASPX
Rebuilt project with the primary site project so it compiled as one porject instead of two

Been working on this for days trying to get it to work. Any suggestions other than upgrade to VS 2010 would be appreciated.

Douglas

Is This A Good Question/Topic? 0
  • +

Replies To: Compile / Parser Errors with WebConfig and Inherit Code

#2 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 9287
  • View blog
  • Posts: 34,808
  • Joined: 12-June 08

Re: Compile / Parser Errors with WebConfig and Inherit Code

Posted 04 February 2013 - 09:28 AM

What version of IIS are you on? Is it possible you have not set up the virtual directory to use 4.0? Server2003 has an 'ASP.NET' tab you can check to see what version it expects. 2008 server has application pools and what not to check.
Was This Post Helpful? 1
  • +
  • -

#3 Blasterman007  Icon User is offline

  • New D.I.C Head

Reputation: 2
  • View blog
  • Posts: 42
  • Joined: 15-September 09

Re: Compile / Parser Errors with WebConfig and Inherit Code

Posted 04 February 2013 - 09:41 AM

Thank you modi123_1,

I am running IIS 6 on a Windows 2003. The virtual is set to 4.0. My project assembly is 3.5 as it does not allow me to set it to 4.0 (not avail in the drop down).

Douglas
Was This Post Helpful? 0
  • +
  • -

#4 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 9287
  • View blog
  • Posts: 34,808
  • Joined: 12-June 08

Re: Compile / Parser Errors with WebConfig and Inherit Code

Posted 04 February 2013 - 09:44 AM

... and you have the 4.0 upgrade on that pc you are compile, right?
Was This Post Helpful? 0
  • +
  • -

#5 Blasterman007  Icon User is offline

  • New D.I.C Head

Reputation: 2
  • View blog
  • Posts: 42
  • Joined: 15-September 09

Re: Compile / Parser Errors with WebConfig and Inherit Code

Posted 04 February 2013 - 09:44 AM

Thank you modi123_1,

I am running IIS 6 on a Windows 2003. The virtual is set to 4.0. My project assembly is 3.5 as it does not allow me to set it to 4.0 (not avail in the drop down).

Douglas
Was This Post Helpful? 0
  • +
  • -

#6 Blasterman007  Icon User is offline

  • New D.I.C Head

Reputation: 2
  • View blog
  • Posts: 42
  • Joined: 15-September 09

Re: Compile / Parser Errors with WebConfig and Inherit Code

Posted 04 February 2013 - 11:29 AM

Attached is a print screen of my .net installs on the workstation.

BTW - Sorry about the double post before. I got an error on the first attempt and success on the second. Been having trouble with this forum loading on IE 8. Switching over to Mozilla for a while and see if it works better.
Was This Post Helpful? 0
  • +
  • -

#7 Blasterman007  Icon User is offline

  • New D.I.C Head

Reputation: 2
  • View blog
  • Posts: 42
  • Joined: 15-September 09

Re: Compile / Parser Errors with WebConfig and Inherit Code

Posted 04 February 2013 - 01:16 PM

Just following up and looks my IE let me down again without attaching file.
Using Mozilla now.
Typing in my .net installs below:
.net compact framework 1.0 sp3 developer 10/12/2011 1.0.4292
.net compact framework 2.0 sp2 10/17/2011 2.0.7045
.net compact framework 3.5 10/17/2011 3.5.7283
.net framework 4 client profile 2/11/2011 4.0.30319
.net framework 4 extended 2/11/2011 4.0.30319
Was This Post Helpful? 0
  • +
  • -

#8 Blasterman007  Icon User is offline

  • New D.I.C Head

Reputation: 2
  • View blog
  • Posts: 42
  • Joined: 15-September 09

Re: Compile / Parser Errors with WebConfig and Inherit Code

Posted 04 February 2013 - 01:54 PM

OK - Been experimenting and think I found something but need assistance to move forward.

When I published this project, I did the following:

c:\myReporting\ - All my ASPX pages, CSS, etc for the project.

In IIS, I created a virtualdirectory called exclusions and pointed to the above.
The website that created the virtual directory in was in
c:\pubweb
I put the bin in this directory (so c:\pubweb\bin) and the web.config in the root (c:\pubweb\web.config).

As such, I got the errors above.

I had posted other ASPX projects but to internal sites. In those, I had a website called IntWeb and was posted in c:\IntWeb. I made directories under this and did not use virtualdirectories.

I just published my project internally. so...
c:\IntWeb\myReporting - All my ASPX, etc
c:\IntWeb\Bin
c:\INtWeb\web.config

Web project runs just like in Dev. Is the virtual directory thing causing my problem?
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1