与主Wordpress应用程序位于同一文件夹中时,如何使.NET应用程序在IIS 10.x上运行?

时间:2019-03-06 16:06:27

标签: .net asp.net-mvc wordpress razor iis-10

好的,这是我对.NET的首次尝试。我有一个项目,将应用程序部署到1and1.com上的专用服务器上

我可以从VS2015的本地框中发布

我已将该站点设置为IIS上的应用程序

在绑定中,由于这不是域,因此我不得不使用一个子域:something.atrealdomain.net <--- atrealdomain是我使用的域之一。

这是我尝试运行该应用程序时得到的:

Server Error in '/' Application.
This type of page is not served.
Description: The type of page you have requested is not served because it has 
been explicitly forbidden.  The extension '.cshtml' may be incorrect.   
Please review the URL below and make sure that it is spelled correctly. 

Requested URL: /views/account/login.cshtml

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET 
Version:4.7.3282.0

但是,当我尝试使用localhost时,通过R在服务器上

“ /”应用程序中的服务器错误。     运行时错误     说明:服务器上发生应用程序错误。该应用程序当前的自定义错误设置会阻止查看该应用程序错误的详细信息。

Details: To enable the details of this specific error message to be viewable on the local server machine, please create a <customErrors>
tag within a "web.config" configuration file located in the root directory of the current web application. This <customErrors>
    tag should then have its "mode" attribute set to "RemoteOnly". To enable the details to be viewable on remote machines, please set "mode" to "Off".


    <!-- Web.Config Configuration File -->

    <configuration>
        <system.web>
            <customErrors mode="RemoteOnly" />
        </system.web>
    </configuration>

    Notes: The current error page you are seeing can be replaced by a custom error page by modifying the "defaultRedirect" attribute of the application's <customErrors>
        configuration tag to point to a custom error page URL.


        <!-- Web.Config Configuration File -->

        <configuration>
            <system.web>
                <customErrors mode="On" defaultRedirect="mycustompage.htm" />
            </system.web>
        </configuration>

我的PAYCHECK正在帮助我完成这项工作。

由于Angular是我的强项,所以我对.NET并不精通,但我希望他们让我在Angular中做到这一点,因为我已经在不到24小时的时间内就将其构建了出来。另外,他们正在使用WordPress ... ARGH !!!!!!!!!

我需要确保我在1and1.com专用服务器上的配置能够正常工作,并且可以通过子域访问它,以便在星期五之前显示客户端,或者我是TOAST!

任何帮助将不胜感激。

在服务器上运行应用程序时,我使用:http://subdomain.domain.net/folder/index.php我得到

http://subdomain.domain.net/folder/plugins/yith-wishlist/assets/css/font-awesome?ver=4.7.0

.NET应用程序必须与.NET APP称为...奇怪的WORD PRESS应用程序位于同一文件夹中。

但是它没有运行_appStart.cshtml页面,我在IIS配置中得到的CSHTML是“ FORBIDDEN”。 ARGH !!!!!!!!

谢谢大家。

更新:

这里是#ADyson要求的事件日志。

Event code: 3008 
Event message: A configuration error has occurred. 
Event time: 3/6/2019 11:35:51 AM 
Event time (UTC): 3/6/2019 5:35:51 PM 
Event ID: 3f89307e1fac4b5caa8e6592b3b12561 
Event sequence: 50 
Event occurrence: 11 
Event detail code: 0 

Process information: 
    Process ID: 11328 
    Process name: w3wp.exe 
    Account name: IIS APPPOOL\DefaultAppPool 

Exception information: 
    Exception type: ConfigurationErrorsException 
    Exception message: It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level.  This error can be caused by a virtual directory not being configured as an application in IIS. (C:\inetpub\wwwroot\semble\web.config line 72)
   at System.Configuration.ConfigurationSchemaErrors.ThrowIfErrors(Boolean ignoreLocal)
   at System.Configuration.BaseConfigurationRecord.GetSectionRecursive(String configKey, Boolean getLkg, Boolean checkPermission, Boolean getRuntimeObject, Boolean requestIsHere, Object& result, Object& resultRuntimeObject)
   at System.Configuration.BaseConfigurationRecord.GetSection(String configKey)
   at System.Web.Configuration.RuntimeConfig.GetSectionObject(String sectionName)
   at System.Web.Configuration.RuntimeConfig.GetSection(String sectionName, Type type, ResultsIndex index)
   at System.Web.Configuration.RuntimeConfig.get_Identity()
   at System.Web.HttpContext.SetImpersonationEnabled()
   at System.Web.HttpApplication.AssignContext(HttpContext context)
   at System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context)



Request information: 
    Request URL: http://semble.webparity.net/semble/account/login 
    Request path: /semble/account/login 
    User host address: xx.xx.xxx.xxx
    User:  HIDDEN
    Is authenticated: False 
    Authentication Type:  
    Thread account name: U123456789\myusername (FAKE)

Thread information: 
    Thread ID: 138 
    Thread account name: U123456789\myusername (FAKE)
    Is impersonating: False 
    Stack trace:    at System.Configuration.ConfigurationSchemaErrors.ThrowIfErrors(Boolean ignoreLocal)
   at System.Configuration.BaseConfigurationRecord.GetSectionRecursive(String configKey, Boolean getLkg, Boolean checkPermission, Boolean getRuntimeObject, Boolean requestIsHere, Object& result, Object& resultRuntimeObject)
   at System.Configuration.BaseConfigurationRecord.GetSection(String configKey)
   at System.Web.Configuration.RuntimeConfig.GetSectionObject(String sectionName)
   at System.Web.Configuration.RuntimeConfig.GetSection(String sectionName, Type type, ResultsIndex index)
   at System.Web.Configuration.RuntimeConfig.get_Identity()
   at System.Web.HttpContext.SetImpersonationEnabled()
   at System.Web.HttpApplication.AssignContext(HttpContext context)
   at System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context)

更新2:

这是我的文件夹结构。 semble / semble .... <---第二个semble文件夹是.NET应用程序。因此,我右键单击并添加应用程序,对吗?使用.NET4.5 / Integrated还是CLASSIC?使用默认池还是创建一个新的?

Folder Structure - WP folder and Semble App INSIDE

当我单击“转换为应用程序”时,出现了我所期望的。我是否只接受所有默认值?这是我以前没有做过的我选择了添加应用...而不是转换为应用。

更新3:

以下是wwwroot / semlbeapp文件夹下的TOP LEVEL GLOBAL和.NET APP的第一部分。我从原来的名字重命名了...

GLOBAL web.config

    <httpModules>
        <add name="OutputCache" type="System.Web.Caching.OutputCacheModule" />
        <add name="Session" type="System.Web.SessionState.SessionStateModule" />
        <add name="WindowsAuthentication" type="System.Web.Security.WindowsAuthenticationModule" />
        <add name="FormsAuthentication" type="System.Web.Security.FormsAuthenticationModule" />
        <add name="PassportAuthentication" type="System.Web.Security.PassportAuthenticationModule" />
        <add name="RoleManager" type="System.Web.Security.RoleManagerModule" />
        <add name="UrlAuthorization" type="System.Web.Security.UrlAuthorizationModule" />
        <add name="FileAuthorization" type="System.Web.Security.FileAuthorizationModule" />
        <add name="AnonymousIdentification" type="System.Web.Security.AnonymousIdentificationModule" />
        <add name="Profile" type="System.Web.Profile.ProfileModule" />
        <add name="ErrorHandlerModule" type="System.Web.Mobile.ErrorHandlerModule, System.Web.Mobile, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
        <add name="ServiceModel" type="System.ServiceModel.Activation.HttpModule, System.ServiceModel.Activation, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
        <add name="UrlRoutingModule-4.0" type="System.Web.Routing.UrlRoutingModule" />
        <add name="ScriptModule-4.0" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
    </httpModules>

APPLICATION web.config

<authentication mode="Forms"> <--- THIS IS LINE 72 which consistently FAILS
  <!--<forms name="PiranhaCMS" timeout="30" />-->
  <forms loginUrl="~/login" timeout="2880" />
</authentication>

CONVERT TO APP in IIS

0 个答案:

没有答案