mardi 2 août 2016

.NET Publishing - Configuration Error

I recently built a .NET application and am encountering difficult with publishing it. When I try and run it from the server, I get this:

 Configuration Error
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

Parser Error Message: Unrecognized attribute 'targetFramework'. Note that attribute names are case-sensitive.

Source Error:


Line 16:   <system.web>
Line 17:     <compilation targetFramework="4.5" />
Line 18:     <httpRuntime targetFramework="4.5" />
Line 19:     <pages>
Line 20:       <namespaces>


Source File: D:\Webroot\fleet\web.config    Line: 18 

I did some research and it indicated that I needed to ensure the server Application Pool was set at 4.0. I changed that. Same issue. So I tried changing the framework version to 4.0 in the Web.config. Still no success (the server does not meet the requirements for 4.5). So I decided I would remove the httpRunTime tag and republish. After that, I get a Parser error:

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

Parser Error Message: The file '/Site.Master' does not exist.

Source Error:


Line 1:  <%@ Page Title="Home Page" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="Fleet_Maintenance._Default" %>
Line 2:  
Line 3:  <asp:Content ID="BodyContent" ContentPlaceHolderID="MainContent" runat="server">


Source File: /fleet/default.aspx    Line: 1 

I am a bit at a loss and would really appreciate any help. Here is a portion of my Web.config.

<?xml version="1.0" encoding="utf-8"?>
<!--
  For more information on how to configure your ASP.NET application, please visit
  http://ift.tt/1eW0XAj
  -->
<configuration>

  <configSections>




    <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
    <!-- For more information on Entity Framework configuration, visit http://ift.tt/1eigFsq -->
  </configSections>
  <system.web>
    <compilation debug="true" targetFramework="4.5" />
    <httpRuntime targetFramework="4.5" />
     <customErrors mode="Off"/>
    <pages>
      <namespaces>
        <add namespace="System.Web.Optimization" />
      </namespaces>
      <controls>
        <add assembly="Microsoft.AspNet.Web.Optimization.WebForms" namespace="Microsoft.AspNet.Web.Optimization.WebForms" tagPrefix="webopt" />
      </controls>
    </pages>
  </system.web>
  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="EntityFramework" publicKeyToken="B77A5C561934E089" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="Newtonsoft.Json" culture="neutral" publicKeyToken="30ad4fe6b2a6aeed" />
        <bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="WebGrease" culture="neutral" publicKeyToken="31bf3856ad364e35" />
        <bindingRedirect oldVersion="0.0.0.0-1.5.2.14234" newVersion="1.5.2.14234" />
      </dependentAssembly>
    </assemblyBinding>
  </runtime>




Aucun commentaire:

Enregistrer un commentaire