Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inprocess application start problem #6118

Closed
aurokk opened this issue Dec 25, 2018 · 3 comments
Closed

Inprocess application start problem #6118

aurokk opened this issue Dec 25, 2018 · 3 comments
Labels
area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions feature-iis Includes: IIS, ANCM

Comments

@aurokk
Copy link

aurokk commented Dec 25, 2018

Hello!
I'm trying to host web app using inprocess hosting model. And...
Application can't start.
IIS responses with 500.30.
ANCM logs contains this.
If i switch hostingModel to OutOfProcess — everything is ok.

My web.config

<?xml version="1.0" encoding="utf-8"?>
<configuration>
    <system.webServer>
      <handlers>
        <add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" />
      </handlers>
      <aspNetCore processPath=".\Dodo.ClientSite.exe" arguments="" stdoutLogEnabled="true" stdoutLogFile=".\logs\stdout" forwardWindowsAuthToken="false" hostingModel="InProcess">
	  
	     <handlerSettings>
                  <handlerSetting name="debugFile" value=".\aspnetcore-debug.log" />
                  <handlerSetting name="debugLevel" value="FILE,TRACE" />
              </handlerSettings>
      </aspNetCore>
   </system.webServer>
</configuration>

Logs

[aspnetcorev2.dll] ASPNET_CORE_GLOBAL_MODULE::OnGlobalConfigurationChange 'MACHINE/WEBROOT/APPHOST/RU-DEV-GS-GSITE.EXT.DEV.DODOIS.COM'
[aspnetcorev2.dll] Stopping application '/LM/W3SVC/340/ROOT'
[aspnetcorev2_inprocess.dll] Stopping file watcher thread
[aspnetcorev2.dll] ASPNET_CORE_GLOBAL_MODULE::OnGlobalStopListening
[aspnetcorev2.dll] ASPNET_CORE_GLOBAL_MODULE::Terminate
[aspnetcorev2.dll] Initializing logs for 'C:\Program Files\IIS\Asp.Net Core Module\V2\aspnetcorev2.dll'. Process Id: 9476.. File Version: 12.2.18316.0. Description: IIS ASP.NET Core Module V2. Commit: ce8cf65589734f82b0536c543aba5bd60d0a5a98.
[aspnetcorev2.dll] Resolving hostfxr parameters for application: '.\Dodo.ClientSite.exe' arguments: '' path: 'E:\sites\ru-dev-gs-gsite.ext.dev.dodois.com\'
[aspnetcorev2.dll] Known dotnet.exe location: ''
[aspnetcorev2.dll] Process path '.\Dodo.ClientSite.exe' is not dotnet, treating application as standalone or portable with bootstrapper
[aspnetcorev2.dll] Checking application.dll at 'E:\sites\ru-dev-gs-gsite.ext.dev.dodois.com\.\Dodo.ClientSite.dll'
[aspnetcorev2.dll] Checking hostfxr.dll at 'E:\sites\ru-dev-gs-gsite.ext.dev.dodois.com\.\hostfxr.dll'
[aspnetcorev2.dll] hostfxr.dll found app local at 'E:\sites\ru-dev-gs-gsite.ext.dev.dodois.com\.\hostfxr.dll', treating application as portable with launcher
[aspnetcorev2.dll] Resolving absolute path to dotnet.exe from 'dotnet'
[aspnetcorev2.dll] Invoking where.exe to find dotnet.exe
[aspnetcorev2.dll] where.exe invocation returned: 'C:\Program Files\dotnet\dotnet.exe
C:\Program Files (x86)\dotnet\dotnet.exe
'
[aspnetcorev2.dll] Current process bitness type detected as isX64=1
[aspnetcorev2.dll] Processing entry 'C:\Program Files\dotnet\dotnet.exe'
[aspnetcorev2.dll] Binary type 6
[aspnetcorev2.dll] Found dotnet.exe via where.exe invocation at 'C:\Program Files\dotnet\dotnet.exe'
[aspnetcorev2.dll] Resolving absolute path to hostfxr.dll from 'C:\Program Files\dotnet\dotnet.exe'
[aspnetcorev2.dll] hostfxr.dll located at 'C:\Program Files\dotnet\host\fxr\2.2.0\hostfxr.dll'
[aspnetcorev2.dll] Parsed hostfxr options: dotnet location: 'C:\Program Files\dotnet\dotnet.exe' hostfxr path: 'C:\Program Files\dotnet\host\fxr\2.2.0\hostfxr.dll' arguments:
[aspnetcorev2.dll] Argument[0] = 'C:\Program Files\dotnet\dotnet.exe'
[aspnetcorev2.dll] Argument[1] = 'E:\sites\ru-dev-gs-gsite.ext.dev.dodois.com\.\Dodo.ClientSite.dll'
[aspnetcorev2.dll] c:\b\w\e37dd45d8cd1eaf4\src\iisintegration\src\aspnetcoremodulev2\commonlib\fileoutputmanager.cpp:142 Operation failed with LastError: 32 HR: 0x80070020
[aspnetcorev2.dll] Loading request handler:  'E:\sites\ru-dev-gs-gsite.ext.dev.dodois.com\aspnetcorev2_inprocess.dll'
[aspnetcorev2.dll] Creating handler application
[aspnetcorev2_inprocess.dll] Initializing logs for 'E:\sites\ru-dev-gs-gsite.ext.dev.dodois.com\aspnetcorev2_inprocess.dll'. Process Id: 9476.. File Version: 12.2.18316.0. Description: IIS ASP.NET Core Module V2 Request Handler. Commit: ce8cf65589734f82b0536c543aba5bd60d0a5a98.
[aspnetcorev2_inprocess.dll] Waiting for initialization
[aspnetcorev2_inprocess.dll] Starting in-process worker thread
[aspnetcorev2_inprocess.dll] Resolving hostfxr parameters for application: '.\Dodo.ClientSite.exe' arguments: '' path: 'E:\sites\ru-dev-gs-gsite.ext.dev.dodois.com\'
[aspnetcorev2_inprocess.dll] Known dotnet.exe location: 'C:\Program Files\dotnet\dotnet.exe'
[aspnetcorev2_inprocess.dll] Process path '.\Dodo.ClientSite.exe' is not dotnet, treating application as standalone or portable with bootstrapper
[aspnetcorev2_inprocess.dll] Checking application.dll at 'E:\sites\ru-dev-gs-gsite.ext.dev.dodois.com\.\Dodo.ClientSite.dll'
[aspnetcorev2_inprocess.dll] Checking hostfxr.dll at 'E:\sites\ru-dev-gs-gsite.ext.dev.dodois.com\.\hostfxr.dll'
[aspnetcorev2_inprocess.dll] hostfxr.dll found app local at 'E:\sites\ru-dev-gs-gsite.ext.dev.dodois.com\.\hostfxr.dll', treating application as portable with launcher
[aspnetcorev2_inprocess.dll] Resolving absolute path to hostfxr.dll from 'C:\Program Files\dotnet\dotnet.exe'
[aspnetcorev2_inprocess.dll] hostfxr.dll located at 'C:\Program Files\dotnet\host\fxr\2.2.0\hostfxr.dll'
[aspnetcorev2_inprocess.dll] Parsed hostfxr options: dotnet location: 'C:\Program Files\dotnet\dotnet.exe' hostfxr path: 'C:\Program Files\dotnet\host\fxr\2.2.0\hostfxr.dll' arguments:
[aspnetcorev2_inprocess.dll] Argument[0] = 'C:\Program Files\dotnet\dotnet.exe'
[aspnetcorev2_inprocess.dll] Argument[1] = 'E:\sites\ru-dev-gs-gsite.ext.dev.dodois.com\.\Dodo.ClientSite.dll'
[aspnetcorev2_inprocess.dll] Managed threw an exception -1073741819
[aspnetcorev2_inprocess.dll] Starting shutdown sequence 1
[aspnetcorev2_inprocess.dll] Clr thread wait ended: clrThreadExited: 1
[aspnetcorev2_inprocess.dll] c:\b\w\e37dd45d8cd1eaf4\src\iisintegration\src\aspnetcoremodulev2\commonlib\fileoutputmanager.cpp:142 Operation failed with LastError: 32 HR: 0x80070020
[aspnetcorev2_inprocess.dll] Event Log: 'Application '/LM/W3SVC/340/ROOT' with physical root 'E:\sites\ru-dev-gs-gsite.ext.dev.dodois.com\' hit unexpected managed exception, exception code = '0xc0000005'. Please check the stderr logs for more information.' 
End Event Log Message.
[aspnetcorev2_inprocess.dll] Stopping in-process worker thread
[aspnetcorev2_inprocess.dll] Stopping CLR
[aspnetcorev2_inprocess.dll] Event Log: 'Application '/LM/W3SVC/340/ROOT' with physical root 'E:\sites\ru-dev-gs-gsite.ext.dev.dodois.com\' failed to load clr and managed application. CLR worker thread exited prematurely' 
End Event Log Message.
[aspnetcorev2_inprocess.dll] Exception 'InvalidOperationException' caught at c:\b\w\e37dd45d8cd1eaf4\src\iisintegration\src\aspnetcoremodulev2\inprocessrequesthandler\inprocessapplication.cpp:350 
[aspnetcorev2_inprocess.dll] Failed HRESULT returned: 0x8007023e at c:\b\w\e37dd45d8cd1eaf4\src\iisintegration\src\aspnetcoremodulev2\inprocessrequesthandler\dllmain.cpp:120 
[aspnetcorev2_inprocess.dll] Starting app_offline monitoring in application 'E:\sites\ru-dev-gs-gsite.ext.dev.dodois.com\'
[aspnetcorev2_inprocess.dll] Starting file watcher thread
[aspnetcorev2.dll] ASPNET_CORE_GLOBAL_MODULE::OnGlobalConfigurationChange 'MACHINE/WEBROOT/APPHOST/RU-DEV-GS-GSITE.EXT.DEV.DODOIS.COM'
[aspnetcorev2.dll] Stopping application '/LM/W3SVC/340/ROOT'
[aspnetcorev2_inprocess.dll] Stopping file watcher thread
[aspnetcorev2.dll] ASPNET_CORE_GLOBAL_MODULE::OnGlobalStopListening
[aspnetcorev2.dll] ASPNET_CORE_GLOBAL_MODULE::Terminate
@pakrym
Copy link
Contributor

pakrym commented Dec 26, 2018

Your Program.Main is throwing an exception. It's probably due to the CurrentDirectory issue: #4206. Here is our recommended workaround for now: https://github.com/aspnet/Docs/blob/master/aspnetcore/host-and-deploy/aspnet-core-module/samples_snapshot/2.x/CurrentDirectoryHelpers.cs. This will be fixed in a patch.

@pakrym
Copy link
Contributor

pakrym commented Dec 29, 2018

I assume the workaround has resolved your issue. Feel free to reopen otherwise.

@ljcorreia
Copy link

Your Program.Main is throwing an exception. It's probably due to the CurrentDirectory issue: #4206. Here is our recommended workaround for now: https://github.com/aspnet/Docs/blob/master/aspnetcore/host-and-deploy/aspnet-core-module/samples_snapshot/2.x/CurrentDirectoryHelpers.cs. This will be fixed in a patch.

I'm having problems applying the suggested fix and resolving the issue which I don't know if it should be fixed in the current version .Net Core 2.2 since I am still getting the same error - IIS responses with 500.30 - when running InProcess. Enabling the logs I could see the problem is related to the same issue as the directory returned is not the correct directory. Instead, it returned the path where the IIS service run from in the system. To apply the fix, I've copied the CurrentDirectoryHelper.cs to my project and call it from the Program.cs before Setting the SetBasePath,

logger.LogWarning($"Applying Patch to fix Current Directory issue. Current Directory: {Environment.CurrentDirectory}"); //TODO: the line below can be removed when the bug with InProcess method is fixed (more details, follow the class definition and read the comments) CurrentDirectoryHelpers.SetCurrentDirectory(); logger.LogWarning($"Fix applied. Current Directory now is: {Environment.CurrentDirectory}");
Applying the fix as such still produces the same result.
The Application starts fine if running as OutOfProcess and if running under IIS Express

Can anyone help me with this, please?

@dotnet dotnet locked as resolved and limited conversation to collaborators Dec 3, 2019
@amcasey amcasey added area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions and removed area-runtime labels Jun 2, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions feature-iis Includes: IIS, ANCM
Projects
None yet
Development

No branches or pull requests

4 participants