ASP.NET MVC发布到ASP.NET WebForms中的子目录,给出了错误404

时间:2015-11-27 11:32:30

标签: asp.net asp.net-mvc webforms umbraco umbraco4

我在根目录中的ASP.NET WebForms项目工作正常。

但是现在我已经创建了我的新项目ASP.NET MVC并上传到mysite.com/subdirectory但我没有访问权限,它提供了404 - 文件或目录未找到。

这是我在根目录中的WebForms web.config:

<?xml version="1.0" encoding="utf-8"?>
<configuration> 
  <configSections>
    <section name="urlrewritingnet" restartOnExternalChanges="true" requirePermission="false" type="UrlRewritingNet.Configuration.UrlRewriteSection, UrlRewritingNet.UrlRewriter" />
    <section name="microsoft.scripting" type="Microsoft.Scripting.Hosting.Configuration.Section, Microsoft.Scripting, Version=1.0.0.0, Culture=neutral, PublicKeyToken=XXXXXXXXXXXX" requirePermission="false" />
    <section name="clientDependency" type="ClientDependency.Core.Config.ClientDependencySection, ClientDependency.Core" />
    <section name="Examine" type="Examine.Config.ExamineSettings, Examine" />
    <section name="ExamineLuceneIndexSets" type="UmbracoExamine.Config.ExamineLuceneIndexes, UmbracoExamine" />
    <section name="ImageGenConfiguration" type="ImageGen.ImageGenConfigurationHandler,ImageGen" />
  </configSections>
  <urlrewritingnet configSource="config\UrlRewriting.config" />
  <microsoft.scripting configSource="config\scripting.config" />
  <clientDependency configSource="config\ClientDependency.config" />
  <Examine configSource="config\ExamineSettings.config" />
  <ExamineLuceneIndexSets configSource="config\ExamineIndex.config" />
  <appSettings>  
    <add key="umbracoConfigurationStatus" value="4.6.1" />
    <add key="umbracoReservedUrls" value="~/config/splashes/booting.aspx,~/install/default.aspx,~/config/splashes/noNodes.aspx,~/sqlmodifier.aspx" />
    <add key="umbracoReservedPaths" value="~/umbraco,~/install/" />
    <add key="umbracoContentXML" value="~/App_Data/umbraco.config" />
    <add key="umbracoStorageDirectory" value="~/App_Data" />
    <add key="umbracoPath" value="~/umbraco" />
    <add key="umbracoEnableStat" value="false" />
    <add key="umbracoHideTopLevelNodeFromPath" value="true" />
    <add key="umbracoEditXhtmlMode" value="true" />
    <add key="umbracoUseDirectoryUrls" value="true" />
    <add key="umbracoDebugMode" value="false" />
    <add key="umbracoTimeOutInMinutes" value="100" />
    <add key="umbracoVersionCheckPeriod" value="7" />
    <add key="umbracoDisableXsltExtensions" value="true" />
    <add key="umbracoDefaultUILanguage" value="en" />
    <add key="umbracoProfileUrl" value="profiler" />
    <add key="umbracoUseSSL" value="false" />
    <add key="umbracoUseMediumTrust" value="false" />
    <!-- 
        Set this to true to enable storing the xml cache locally to the IIS server even if the app files are stored centrally on a SAN/NAS 
        Alex Norcliffe 2010 02 for 4.1-->
    <add key="umbracoContentXMLUseLocalTemp" value="false" />
  </appSettings>
  <system.net>
    <mailSettings>
      <smtp>
        <!--<network host="127.0.0.1" userName="username" password="password" />-->
        <network host="smtphost" port="25" defaultCredentials="false" />
      </smtp>
    </mailSettings>
  </system.net>
  <connectionStrings>
    <remove name="LocalSqlServer" />
  </connectionStrings>
  <system.web>
    <identity impersonate="false" />
    <customErrors mode="Off" />
    <trace enabled="true" requestLimit="10" pageOutput="false" traceMode="SortByTime" localOnly="true" />
    <machineKey decryptionKey=",IsolateApps" validationKey=",IsolateApps" />

 <globalization requestEncoding="UTF-8" responseEncoding="UTF-8" />
    <xhtmlConformance mode="Strict" />
    <httpRuntime requestValidationMode="2.0" maxRequestLength="2000000" />
    <pages validateRequest="false" enableEventValidation="false" viewStateEncryptionMode="Never">
      <!-- ASPNETAJAX -->
      <controls>
        <add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=" />
        <add tagPrefix="umbraco" namespace="umbraco.presentation.templateControls" assembly="umbraco" />
        <add tagPrefix="asp" namespace="System.Web.UI.WebControls" assembly="System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=" />
      </controls>
    </pages>
    <httpModules>
      <!-- URL REWRTIER -->
      <add name="UrlRewriteModule" type="UrlRewritingNet.Web.UrlRewriteModule, UrlRewritingNet.UrlRewriter" />
      <add name="umbracoRequestModule" type="umbraco.presentation.requestModule" />
      <!-- UMBRACO -->
      <add name="viewstateMoverModule" type="umbraco.presentation.viewstateMoverModule" />
      <add name="umbracoBaseRequestModule" type="umbraco.presentation.umbracobase.requestModule" />
      <!-- ASPNETAJAX -->
      <add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=" />
      <!-- CLIENT DEPENDENCY -->
      <add name="ClientDependencyModule" type="ClientDependency.Core.Module.ClientDependencyModule, ClientDependency.Core" />
    </httpModules>
    <httpHandlers>
      <remove verb="*" path="*.asmx" />
      <!-- ASPNETAJAX -->
      <add verb="*" path="*.asmx" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=" validate="false" />
      <add verb="*" path="*_AppService.axd" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=" validate="false" />
      <add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=" validate="false" />
      <!-- UMBRACO CHANNELS -->
      <add verb="*" path="umbraco/channels.aspx" type="umbraco.presentation.channels.api, umbraco" />
      <add verb="*" path="umbraco/channels/word.aspx" type="umbraco.presentation.channels.wordApi, umbraco" />
      <add verb="*" path="DependencyHandler.axd" type="ClientDependency.Core.CompositeFiles.CompositeDependencyHandler, ClientDependency.Core " />
      <add verb="GET,HEAD,POST" path="GoogleSpellChecker.ashx" type="umbraco.presentation.umbraco_client.tinymce3.plugins.spellchecker.GoogleSpellChecker,umbraco" />
      <add path="MultipleFileUploadHandler.axd" verb="POST" type="noerd.Umb.DataTypes.multipleFileUpload.MultipleFileUploadHandler, noerd.Umb.DataTypes.multipleFileUpload" validate="False" />
    </httpHandlers>
    <compilation defaultLanguage="c#" debug="false" batch="false" targetFramework="4.0">
      <assemblies>
        <!-- ASP.NET 4.0 Assemblies -->
        <add assembly="System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=" />
        <add assembly="System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=" />
        <add assembly="System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=" />
        <add assembly="System.Xml.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=" />
        <add assembly="System.Data.DataSetExtensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=" />
        <add assembly="System.Web.Extensions.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=" />
        <add assembly="System.Web.Abstractions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=" />
      </assemblies>
    </compilation>
    <authentication mode="Windows">
      <forms name="yourAuthCookie" loginUrl="login.aspx" protection="All" path="/" />
    </authentication>
    <authorization>
      <allow users="?" />
    </authorization>
    <!-- Membership Provider -->
    <membership defaultProvider="UmbracoMembershipProvider" userIsOnlineTimeWindow="15">
      <providers>
        <clear />
        <add name="UmbracoMembershipProvider" type="umbraco.providers.members.UmbracoMembershipProvider" enablePasswordRetrieval="false" enablePasswordReset="false" requiresQuestionAndAnswer="false" defaultMemberTypeAlias="Another Type" passwordFormat="Hashed" />
        <add name="UsersMembershipProvider" type="umbraco.providers.UsersMembershipProvider" enablePasswordRetrieval="false" enablePasswordReset="false" requiresQuestionAndAnswer="false" passwordFormat="Hashed" />
      </providers>
    </membership>
    <!-- added by NH to support membership providers in access layer -->
    <roleManager enabled="true" defaultProvider="UmbracoRoleProvider">
      <providers>
        <clear />
        <add name="UmbracoRoleProvider" type="umbraco.providers.members.UmbracoRoleProvider" />
      </providers>
    </roleManager>
    <!-- Sitemap provider-->
    <siteMap defaultProvider="UmbracoSiteMapProvider" enabled="true">
      <providers>
        <clear />
        <add name="UmbracoSiteMapProvider" type="umbraco.presentation.nodeFactory.UmbracoSiteMapProvider" defaultDescriptionAlias="description" securityTrimmingEnabled="true" />
      </providers>
    </siteMap>
  </system.web>
   <!--</location>-->
  <!-- ASPNETAJAX -->
  <system.web.extensions>
    <scripting>
      <scriptResourceHandler enableCompression="true" enableCaching="true" />
    </scripting>
  </system.web.extensions>
  <system.webServer>


        <rewrite>
            <rules>
                <rule name="SpecificRedirect" stopProcessing="true">
                    <match url="^$" />
                    <action type="Redirect" url="/homepage" />
                </rule>
            </rules>
        </rewrite>


    <validation validateIntegratedModeConfiguration="false" />
    <modules runAllManagedModulesForAllRequests="true">
      <remove name="ScriptModule" />
      <remove name="UrlRewriteModule" />
      <remove name="umbracoRequestModule" />
      <remove name="viewstateMoverModule" />
      <remove name="umbracoBaseRequestModule" />
      <remove name="ClientDependencyModule" />
      <add name="UrlRewriteModule" type="UrlRewritingNet.Web.UrlRewriteModule, UrlRewritingNet.UrlRewriter" />
      <add name="umbracoRequestModule" type="umbraco.presentation.requestModule" />
      <add name="viewstateMoverModule" type="umbraco.presentation.viewstateMoverModule" />
      <add name="umbracoBaseRequestModule" type="umbraco.presentation.umbracobase.requestModule" />
      <add name="ScriptModule" preCondition="managedHandler" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=" />
      <add name="ClientDependencyModule" type="ClientDependency.Core.Module.ClientDependencyModule, ClientDependency.Core" />
    </modules>
    <handlers accessPolicy="Read, Write, Script, Execute">
      <remove name="WebServiceHandlerFactory-Integrated" />
      <remove name="ScriptHandlerFactory" />
      <remove name="ScriptHandlerFactoryAppServices" />
      <remove name="ScriptResource" />
      <remove name="Channels" />
      <remove name="Channels_Word" />
      <remove name="ClientDependency" />
      <remove name="SpellChecker" />
      <add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=" />
      <add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=" />
      <add name="ScriptResource" verb="GET,HEAD" path="ScriptResource.axd" preCondition="integratedMode" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=" />
       <add verb="*" name="Channels" preCondition="integratedMode" path="umbraco/channels.aspx" type="umbraco.presentation.channels.api, umbraco" />
      <add verb="*" name="Channels_Word" preCondition="integratedMode" path="umbraco/channels/word.aspx" type="umbraco.presentation.channels.wordApi, umbraco" />
      <add verb="*" name="ClientDependency" preCondition="integratedMode" path="DependencyHandler.axd" type="ClientDependency.Core.CompositeFiles.CompositeDependencyHandler, ClientDependency.Core " />
      <add verb="GET,HEAD,POST" preCondition="integratedMode" name="SpellChecker" path="GoogleSpellChecker.ashx" type="umbraco.presentation.umbraco_client.tinymce3.plugins.spellchecker.GoogleSpellChecker,umbraco" />
      <remove name="MultiFileUpload" /><add name="MultiFileUpload" path="MultipleFileUploadHandler.axd" verb="POST" type="noerd.Umb.DataTypes.multipleFileUpload.MultipleFileUploadHandler, noerd.Umb.DataTypes.multipleFileUpload" preCondition="integratedMode" />
    </handlers>
  </system.webServer>
  <system.codedom>
    <compilers>
      <compiler language="c#;cs;csharp" extension=".cs" type="Microsoft.CSharp.CSharpCodeProvider,System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" warningLevel="4">
        <providerOption name="CompilerVersion" value="v4.0" />
        <providerOption name="WarnAsError" value="false" />
      </compiler>
    </compilers>
  </system.codedom>
  <runtime>
    <!-- Old asp.net ajax assembly bindings -->
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="System.Web.Extensions" publicKeyToken="" />
        <bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="4.0.0.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Web.Extensions.Design" publicKeyToken="" />
        <bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="4.0.0.0" />
      </dependentAssembly>
    </assemblyBinding>
  </runtime>
  <ImageGenConfiguration configSource="config\ImageGen.config" />
    <system.webServer>
        <defaultDocument>
            <files>
                <clear />
                <add value="default.aspx" />
                <add value="Default.htm" />
                <add value="Default.asp" />
                <add value="index.htm" />
                <add value="index.html" />
                <add value="iisstart.htm" />
            </files>
        </defaultDocument>
        <security>
            <authentication>
                <windowsAuthentication enabled="true" />
                <anonymousAuthentication enabled="false" />
            </authentication>
        </security>
    </system.webServer>
  </configuration> 

1 个答案:

答案 0 :(得分:0)

虽然我没有尝试,但我认为相同的Umbraco实例无法处理WebFormsMVC个网站。

以下是同一网站中混合MVCWebForms的{​​{3}}。希望这能让您更好地了解问题。