diff --git a/build/dependencies.props b/build/dependencies.props
index b62b9d05c0..5eea0cd400 100644
--- a/build/dependencies.props
+++ b/build/dependencies.props
@@ -3,33 +3,33 @@
$(MSBuildAllProjects);$(MSBuildThisFileFullPath)
- 2.1.0-preview1-15677
- 2.1.0-preview2-28214
- 2.1.0-preview2-28214
- 2.1.0-preview2-28214
- 2.1.0-preview2-28214
- 2.1.0-preview2-28214
- 2.1.0-preview2-28214
- 2.1.0-preview2-28214
- 2.1.0-preview2-28214
- 0.5.0-preview2-28214
- 2.1.0-preview2-28214
- 2.1.0-preview2-28214
- 2.1.0-preview2-28214
- 2.1.0-preview2-28214
- 2.1.0-preview2-28214
- 2.1.0-preview2-28214
- 2.1.0-preview2-28214
- 2.1.0-preview2-28214
- 2.1.0-preview2-28214
- 2.1.0-preview2-28214
- 2.1.0-preview2-28214
- 2.1.0-preview2-28214
+ 2.1.0-preview2-15693
+ 2.1.0-preview2-30015
+ 2.1.0-preview2-30015
+ 2.1.0-preview2-30015
+ 2.1.0-preview2-30015
+ 2.1.0-preview2-30015
+ 2.1.0-preview2-30015
+ 2.1.0-preview2-30015
+ 2.1.0-preview2-30015
+ 0.5.0-preview2-30015
+ 2.1.0-preview2-30015
+ 2.1.0-preview2-30015
+ 2.1.0-preview2-30015
+ 2.1.0-preview2-30015
+ 2.1.0-preview2-30015
+ 2.1.0-preview2-30015
+ 2.1.0-preview2-30015
+ 2.1.0-preview2-30015
+ 2.1.0-preview2-30015
+ 2.1.0-preview2-30015
+ 2.1.0-preview2-30015
+ 2.1.0-preview2-30015
1.1.0
- 2.1.0-preview2-28214
+ 2.1.0-preview2-30015
2.0.0
2.1.0-preview2-26130-04
- 2.1.0-preview2-28214
+ 2.1.0-preview2-30015
15.3.0
7.0.0
4.5.0-preview2-26130-01
diff --git a/korebuild-lock.txt b/korebuild-lock.txt
index df1f345b7a..f3c0e9b21b 100644
--- a/korebuild-lock.txt
+++ b/korebuild-lock.txt
@@ -1,2 +1,2 @@
-version:2.1.0-preview1-15677
-commithash:76ac40e0d67a4cc253cb4ecf35dda18c90a272ac
+version:2.1.0-preview2-15693
+commithash:bbc5ba7e5acafd36dcdcf865d528660892b6418a
diff --git a/src/AspNetCore/Src/applicationinfo.cpp b/src/AspNetCore/Src/applicationinfo.cpp
index 36fa89a5a5..e98ab8e782 100644
--- a/src/AspNetCore/Src/applicationinfo.cpp
+++ b/src/AspNetCore/Src/applicationinfo.cpp
@@ -161,7 +161,9 @@ APPLICATION_INFO::EnsureApplicationCreated()
BOOL fLocked = FALSE;
APPLICATION* pApplication = NULL;
STACK_STRU(struFileName, 300); // >MAX_PATH
- STRU hostFxrDllLocation;
+ STRU struHostFxrDllLocation;
+ PWSTR* pwzArgv;
+ DWORD dwArgCount;
if (m_pApplication != NULL)
{
@@ -170,10 +172,24 @@ APPLICATION_INFO::EnsureApplicationCreated()
if ( m_pConfiguration->QueryHostingModel() == APP_HOSTING_MODEL::HOSTING_IN_PROCESS )
{
- if ( FAILED( hr = HOSTFXR_UTILITY::GetHostFxrParameters( m_pConfiguration ) ) )
+ if (FAILED(hr = HOSTFXR_UTILITY::GetHostFxrParameters(
+ g_hEventLog,
+ m_pConfiguration->QueryProcessPath()->QueryStr(),
+ m_pConfiguration->QueryApplicationPhysicalPath()->QueryStr(),
+ m_pConfiguration->QueryArguments()->QueryStr(),
+ &struHostFxrDllLocation,
+ &dwArgCount,
+ &pwzArgv)))
{
goto Finished;
}
+
+ if (FAILED(hr = m_pConfiguration->SetHostFxrFullPath(struHostFxrDllLocation.QueryStr())))
+ {
+ goto Finished;
+ }
+
+ m_pConfiguration->SetHostFxrArguments(dwArgCount, pwzArgv);
}
hr = FindRequestHandlerAssembly();
diff --git a/src/AspNetCore/Src/globalmodule.cpp b/src/AspNetCore/Src/globalmodule.cpp
index af2c922608..f3e3eb40e0 100644
--- a/src/AspNetCore/Src/globalmodule.cpp
+++ b/src/AspNetCore/Src/globalmodule.cpp
@@ -56,4 +56,4 @@ ASPNET_CORE_GLOBAL_MODULE::OnGlobalApplicationStop(
// Return processing to the pipeline.
return GL_NOTIFICATION_CONTINUE;
-}
\ No newline at end of file
+}
diff --git a/src/CommonLib/aspnetcore_msg.mc b/src/CommonLib/aspnetcore_msg.mc
index bcd125850f..b3c0b198a7 100644
--- a/src/CommonLib/aspnetcore_msg.mc
+++ b/src/CommonLib/aspnetcore_msg.mc
@@ -110,6 +110,43 @@ Language=English
%1
.
+Messageid=1014
+SymbolicName=ASPNETCORE_EVENT_INPROCESS_FULL_FRAMEWORK_APP
+Language=English
+%1
+.
+
+Messageid=1015
+SymbolicName=ASPNETCORE_EVENT_PORTABLE_APP_DOTNET_MISSING
+Language=English
+%1
+.
+
+Messageid=1016
+SymbolicName=ASPNETCORE_EVENT_HOSTFXR_DIRECTORY_NOT_FOUND
+Language=English
+%1
+.
+
+Messageid=1017
+SymbolicName=ASPNETCORE_EVENT_HOSTFXR_DLL_NOT_FOUND
+Language=English
+%1
+.
+
+Messageid=1018
+SymbolicName=ASPNETCORE_EVENT_INPROCESS_THREAD_EXCEPTION
+Language=English
+%1
+.
+
+Messageid=1019
+SymbolicName=ASPNETCORE_EVENT_APPLICATION_EXE_NOT_FOUND
+Language=English
+%1
+.
+
+
;
;#endif // _ASPNETCORE_MODULE_MSG_H_
;
diff --git a/src/CommonLib/aspnetcoreconfig.cxx b/src/CommonLib/aspnetcoreconfig.cxx
index 2724dc2a65..160b9de3ed 100644
--- a/src/CommonLib/aspnetcoreconfig.cxx
+++ b/src/CommonLib/aspnetcoreconfig.cxx
@@ -525,4 +525,4 @@ Finished:
}
return hr;
-}
\ No newline at end of file
+}
diff --git a/src/CommonLib/aspnetcoreconfig.h b/src/CommonLib/aspnetcoreconfig.h
index 7c12bb6da0..fa14f3fc6f 100644
--- a/src/CommonLib/aspnetcoreconfig.h
+++ b/src/CommonLib/aspnetcoreconfig.h
@@ -253,7 +253,7 @@ public:
VOID
SetHostFxrArguments(
DWORD dwArgc,
- PCWSTR* ppStrArguments
+ PWSTR* ppStrArguments
)
{
if (m_ppStrArguments != NULL)
@@ -319,6 +319,6 @@ private:
APP_HOSTING_MODEL m_hostingModel;
ENVIRONMENT_VAR_HASH* m_pEnvironmentVariables;
STRU m_struHostFxrLocation;
- PCWSTR* m_ppStrArguments;
+ PWSTR* m_ppStrArguments;
DWORD m_dwArgc;
};
diff --git a/src/CommonLib/hostfxr_utility.cpp b/src/CommonLib/hostfxr_utility.cpp
index b39af4dada..15ec45d649 100644
--- a/src/CommonLib/hostfxr_utility.cpp
+++ b/src/CommonLib/hostfxr_utility.cpp
@@ -25,36 +25,98 @@ HOSTFXR_UTILITY::~HOSTFXR_UTILITY()
//
HRESULT
HOSTFXR_UTILITY::GetStandaloneHostfxrParameters(
- PCWSTR pwzExePath,
- ASPNETCORE_CONFIG *pConfig
+ PCWSTR pwzExeAbsolutePath, // includes .exe file extension.
+ PCWSTR pcwzApplicationPhysicalPath,
+ PCWSTR pcwzArguments,
+ HANDLE hEventLog,
+ _Inout_ STRU* struHostFxrDllLocation,
+ _Out_ DWORD* pdwArgCount,
+ _Out_ PWSTR** ppwzArgv
)
{
HRESULT hr = S_OK;
STRU struDllPath;
STRU struArguments;
+ STRU struHostFxrPath;
+ STRU struRuntimeConfigLocation;
+ STRU strEventMsg;
DWORD dwPosition;
- if (FAILED(hr))
+ // Obtain the app name from the processPath section.
+ if ( FAILED( hr = struDllPath.Copy( pwzExeAbsolutePath ) ) )
{
goto Finished;
}
- if (FAILED(hr = struDllPath.Copy(pwzExePath)))
- {
- goto Finished;
- }
-
- dwPosition = struDllPath.LastIndexOf(L'.', 0);
- if (dwPosition == -1)
+ dwPosition = struDllPath.LastIndexOf( L'.', 0 );
+ if ( dwPosition == -1 )
{
hr = E_FAIL;
goto Finished;
}
- struDllPath.QueryStr()[dwPosition] = L'\0';
+ hr = UTILITY::ConvertPathToFullPath( L".\\hostfxr.dll", pcwzApplicationPhysicalPath, &struHostFxrPath );
+ if ( FAILED( hr ) )
+ {
+ goto Finished;
+ }
- if (FAILED(hr = struDllPath.SyncWithBuffer()) ||
- FAILED(hr = struDllPath.Append(L".dll")))
+ struDllPath.QueryStr()[dwPosition] = L'\0';
+ if (FAILED(hr = struDllPath.SyncWithBuffer()))
+ {
+ goto Finished;
+ }
+
+ if ( !UTILITY::CheckIfFileExists( struHostFxrPath.QueryStr() ) )
+ {
+ // Most likely a full framework app.
+ // Check that the runtime config file doesn't exist in the folder as another heuristic.
+ if (FAILED(hr = struRuntimeConfigLocation.Copy(struDllPath)) ||
+ FAILED(hr = struRuntimeConfigLocation.Append( L".runtimeconfig.json" )))
+ {
+ goto Finished;
+ }
+ if (!UTILITY::CheckIfFileExists(struRuntimeConfigLocation.QueryStr()))
+ {
+
+ hr = E_APPLICATION_ACTIVATION_EXEC_FAILURE;
+ if (SUCCEEDED(strEventMsg.SafeSnwprintf(
+ ASPNETCORE_EVENT_INPROCESS_FULL_FRAMEWORK_APP_MSG,
+ pcwzApplicationPhysicalPath,
+ hr)))
+ {
+ UTILITY::LogEvent( hEventLog,
+ EVENTLOG_ERROR_TYPE,
+ ASPNETCORE_EVENT_INPROCESS_FULL_FRAMEWORK_APP,
+ strEventMsg.QueryStr() );
+ }
+ }
+ else
+ {
+ // If a runtime config file does exist, report a file not found on the app.exe
+ hr = HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND);
+ if (SUCCEEDED(strEventMsg.SafeSnwprintf(
+ ASPNETCORE_EVENT_APPLICATION_EXE_NOT_FOUND_MSG,
+ pcwzApplicationPhysicalPath,
+ hr)))
+ {
+ UTILITY::LogEvent(hEventLog,
+ EVENTLOG_ERROR_TYPE,
+ ASPNETCORE_EVENT_APPLICATION_EXE_NOT_FOUND,
+ strEventMsg.QueryStr());
+ }
+ }
+
+ goto Finished;
+ }
+
+ if (FAILED(hr = struHostFxrDllLocation->Copy(struHostFxrPath)))
+ {
+ goto Finished;
+ }
+
+
+ if (FAILED(hr = struDllPath.Append(L".dll")))
{
goto Finished;
}
@@ -62,18 +124,28 @@ HOSTFXR_UTILITY::GetStandaloneHostfxrParameters(
if (!UTILITY::CheckIfFileExists(struDllPath.QueryStr()))
{
// Treat access issue as File not found
- hr = ERROR_FILE_NOT_FOUND;
+ hr = HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND);
goto Finished;
}
if (FAILED(hr = struArguments.Copy(struDllPath)) ||
FAILED(hr = struArguments.Append(L" ")) ||
- FAILED(hr = struArguments.Append(pConfig->QueryArguments())))
+ FAILED(hr = struArguments.Append(pcwzArguments)))
{
goto Finished;
}
- if (FAILED(hr = SetHostFxrArguments(struArguments.QueryStr(), pwzExePath, pConfig)))
+ if (FAILED(hr = ParseHostfxrArguments(
+ struArguments.QueryStr(),
+ pwzExeAbsolutePath,
+ pcwzApplicationPhysicalPath,
+ hEventLog,
+ pdwArgCount,
+ ppwzArgv)))
+ {
+ goto Finished;
+ }
+ if (FAILED(hr = struHostFxrDllLocation->Copy(struDllPath)))
{
goto Finished;
}
@@ -85,7 +157,13 @@ Finished:
HRESULT
HOSTFXR_UTILITY::GetHostFxrParameters(
- ASPNETCORE_CONFIG *pConfig
+ HANDLE hEventLog,
+ PCWSTR pcwzProcessPath,
+ PCWSTR pcwzApplicationPhysicalPath,
+ PCWSTR pcwzArguments,
+ _Inout_ STRU* struHostFxrDllLocation,
+ _Out_ DWORD* pdwArgCount,
+ _Out_ PWSTR** ppwzArgv
)
{
HRESULT hr = S_OK;
@@ -94,13 +172,14 @@ HOSTFXR_UTILITY::GetHostFxrParameters(
STRU struExeLocation;
STRU struHostFxrSearchExpression;
STRU struHighestDotnetVersion;
+ STRU struEventMsg;
std::vector vVersionFolders;
DWORD dwPosition;
// Convert the process path an absolute path.
hr = UTILITY::ConvertPathToFullPath(
- pConfig->QueryProcessPath()->QueryStr(),
- pConfig->QueryApplicationPhysicalPath()->QueryStr(),
+ pcwzProcessPath,
+ pcwzApplicationPhysicalPath,
&struExeLocation
);
@@ -113,30 +192,22 @@ HOSTFXR_UTILITY::GetHostFxrParameters(
{
// Check if hostfxr is in this folder, if it is, we are a standalone application,
// else we assume we received an absolute path to dotnet.exe
- hr = UTILITY::ConvertPathToFullPath(L".\\hostfxr.dll", pConfig->QueryApplicationPhysicalPath()->QueryStr(), &struHostFxrPath);
- if (FAILED(hr))
- {
- goto Finished;
- }
-
- if (UTILITY::CheckIfFileExists(struHostFxrPath.QueryStr()))
- {
- // Standalone application
- if (FAILED(hr = pConfig->SetHostFxrFullPath(struHostFxrPath.QueryStr())))
- {
- goto Finished;
- }
-
- hr = GetStandaloneHostfxrParameters(struExeLocation.QueryStr(), pConfig);
- goto Finished;
- }
+ hr = GetStandaloneHostfxrParameters(
+ struExeLocation.QueryStr(),
+ pcwzApplicationPhysicalPath,
+ pcwzArguments,
+ hEventLog,
+ struHostFxrDllLocation,
+ pdwArgCount,
+ ppwzArgv);
+ goto Finished;
}
else
{
- if (FAILED(hr = HOSTFXR_UTILITY::FindDotnetExePath(&struExeLocation))) {
+ if (FAILED(hr = HOSTFXR_UTILITY::FindDotnetExePath(&struExeLocation)))
+ {
goto Finished;
}
-
}
if (FAILED(hr = struExeLocation.SyncWithBuffer()) ||
@@ -168,8 +239,17 @@ HOSTFXR_UTILITY::GetHostFxrParameters(
if (!UTILITY::DirectoryExists(&struHostFxrPath))
{
- // error, not found in folder
hr = ERROR_BAD_ENVIRONMENT;
+ if (SUCCEEDED(struEventMsg.SafeSnwprintf(
+ ASPNETCORE_EVENT_HOSTFXR_DIRECTORY_NOT_FOUND_MSG,
+ struHostFxrPath.QueryStr(),
+ hr)))
+ {
+ UTILITY::LogEvent(hEventLog,
+ EVENTLOG_ERROR_TYPE,
+ ASPNETCORE_EVENT_HOSTFXR_DIRECTORY_NOT_FOUND,
+ struEventMsg.QueryStr());
+ }
goto Finished;
}
@@ -192,8 +272,17 @@ HOSTFXR_UTILITY::GetHostFxrParameters(
if (vVersionFolders.size() == 0)
{
- // no core framework was found
- hr = ERROR_BAD_ENVIRONMENT;
+ hr = HRESULT_FROM_WIN32(ERROR_BAD_ENVIRONMENT);
+ if (SUCCEEDED(struEventMsg.SafeSnwprintf(
+ ASPNETCORE_EVENT_HOSTFXR_DIRECTORY_NOT_FOUND_MSG,
+ struHostFxrPath.QueryStr(),
+ hr)))
+ {
+ UTILITY::LogEvent(hEventLog,
+ EVENTLOG_ERROR_TYPE,
+ ASPNETCORE_EVENT_HOSTFXR_DIRECTORY_NOT_FOUND,
+ struEventMsg.QueryStr());
+ }
goto Finished;
}
@@ -212,16 +301,33 @@ HOSTFXR_UTILITY::GetHostFxrParameters(
if (!UTILITY::CheckIfFileExists(struHostFxrPath.QueryStr()))
{
- hr = ERROR_FILE_INVALID;
+ // ASPNETCORE_EVENT_HOSTFXR_DLL_NOT_FOUND_MSG
+ hr = HRESULT_FROM_WIN32(ERROR_FILE_INVALID);
+ if (SUCCEEDED(struEventMsg.SafeSnwprintf(
+ ASPNETCORE_EVENT_HOSTFXR_DLL_NOT_FOUND_MSG,
+ struHostFxrPath.QueryStr(),
+ hr)))
+ {
+ UTILITY::LogEvent(hEventLog,
+ EVENTLOG_ERROR_TYPE,
+ ASPNETCORE_EVENT_HOSTFXR_DLL_NOT_FOUND,
+ struEventMsg.QueryStr());
+ }
goto Finished;
}
- if (FAILED(hr = SetHostFxrArguments(pConfig->QueryArguments()->QueryStr(), struExeLocation.QueryStr(), pConfig)))
+ if (FAILED(hr = ParseHostfxrArguments(
+ pcwzArguments,
+ struExeLocation.QueryStr(),
+ pcwzApplicationPhysicalPath,
+ hEventLog,
+ pdwArgCount,
+ ppwzArgv)))
{
goto Finished;
}
- if (FAILED(hr = pConfig->SetHostFxrFullPath(struHostFxrPath.QueryStr())))
+ if (FAILED(hr = struHostFxrDllLocation->Copy(struHostFxrPath)))
{
goto Finished;
}
@@ -240,15 +346,23 @@ Finished:
// argv[2] = absolute path to dll.
//
HRESULT
-HOSTFXR_UTILITY::SetHostFxrArguments(
- PCWSTR pwzArgumentsFromConfig,
- PCWSTR pwzExePath,
- ASPNETCORE_CONFIG* pConfig
+HOSTFXR_UTILITY::ParseHostfxrArguments(
+ PCWSTR pwzArgumentsFromConfig,
+ PCWSTR pwzExePath,
+ PCWSTR pcwzApplicationPhysicalPath,
+ HANDLE hEventLog,
+ _Out_ DWORD* pdwArgCount,
+ _Out_ PWSTR** ppwzArgv
)
{
+ UNREFERENCED_PARAMETER( hEventLog ); // TODO use event log to set errors.
+
+ DBG_ASSERT(dwArgCount != NULL);
+ DBG_ASSERT(pwzArgv != NULL);
+
HRESULT hr = S_OK;
INT argc = 0;
- PCWSTR* argv = NULL;
+ PWSTR* argv = NULL;
LPWSTR* pwzArgs = NULL;
STRU struTempPath;
DWORD dwArgsProcessed = 0;
@@ -268,7 +382,7 @@ HOSTFXR_UTILITY::SetHostFxrArguments(
goto Failure;
}
- argv = new PCWSTR[argc + 2];
+ argv = new PWSTR[argc + 2];
if (argv == NULL)
{
hr = E_OUTOFMEMORY;
@@ -294,7 +408,7 @@ HOSTFXR_UTILITY::SetHostFxrArguments(
// Try to convert the application dll from a relative to an absolute path
// Don't record this failure as pwzArgs[0] may already be an absolute path to the dll.
- if (SUCCEEDED(UTILITY::ConvertPathToFullPath(pwzArgs[0], pConfig->QueryApplicationPhysicalPath()->QueryStr(), &struTempPath)))
+ if (SUCCEEDED(UTILITY::ConvertPathToFullPath(pwzArgs[0], pcwzApplicationPhysicalPath, &struTempPath)))
{
argv[2] = SysAllocString(struTempPath.QueryStr());
}
@@ -320,7 +434,9 @@ HOSTFXR_UTILITY::SetHostFxrArguments(
dwArgsProcessed++;
}
- pConfig->SetHostFxrArguments(argc + 2, argv);
+ *ppwzArgv = argv;
+ *pdwArgCount = dwArgsProcessed;
+
goto Finished;
Failure:
diff --git a/src/CommonLib/hostfxr_utility.h b/src/CommonLib/hostfxr_utility.h
index 1945574608..556e833705 100644
--- a/src/CommonLib/hostfxr_utility.h
+++ b/src/CommonLib/hostfxr_utility.h
@@ -14,33 +14,47 @@ public:
HOSTFXR_UTILITY();
~HOSTFXR_UTILITY();
- static
- HRESULT
- GetHostFxrParameters(
- ASPNETCORE_CONFIG *pConfig
- );
+ static
+ HRESULT
+ GetHostFxrParameters(
+ HANDLE hEventLog,
+ PCWSTR pcwzProcessPath,
+ PCWSTR pcwzApplicationPhysicalPath,
+ PCWSTR pcwzArguments,
+ _Inout_ STRU* struHostFxrDllLocation,
+ _Out_ DWORD* pdwArgCount,
+ _Out_ PWSTR** ppwzArgv
+ );
private:
static
HRESULT
GetStandaloneHostfxrParameters(
- PCWSTR pStruExePath,
- ASPNETCORE_CONFIG *pConfig
+ PCWSTR pwzExeAbsolutePath, // includes .exe file extension.
+ PCWSTR pcwzApplicationPhysicalPath,
+ PCWSTR pcwzArguments,
+ HANDLE hEventLog,
+ _Inout_ STRU* struHostFxrDllLocation,
+ _Out_ DWORD* pdwArgCount,
+ _Out_ PWSTR** ppwzArgv
);
static
HRESULT
- SetHostFxrArguments(
- PCWSTR struArguments,
- PCWSTR pStruExePath,
- ASPNETCORE_CONFIG *pConfig
+ ParseHostfxrArguments(
+ PCWSTR pwzArgumentsFromConfig,
+ PCWSTR pwzExePath,
+ PCWSTR pcwzApplicationPhysicalPath,
+ HANDLE hEventLog,
+ _Out_ DWORD* pdwArgCount,
+ _Out_ PWSTR** ppwzArgv
);
static
HRESULT
FindDotnetExePath(
- STRU * struDotnetLocation
+ STRU* struDotnetLocation
);
};
diff --git a/src/CommonLib/resources.h b/src/CommonLib/resources.h
index f3829a402d..f98a1ee2e3 100644
--- a/src/CommonLib/resources.h
+++ b/src/CommonLib/resources.h
@@ -16,14 +16,20 @@
#define ASPNETCORE_EVENT_PROCESS_START_POSTCREATE_ERROR_MSG L"Application '%s' with physical root '%s' created process with commandline '%s'but failed to get its status, ErrorCode = '0x%x', retryCounter '%d'."
#define ASPNETCORE_EVENT_PROCESS_START_ERROR_MSG L"Application '%s' with physical root '%s' failed to start process with commandline '%s', ErrorCode = '0x%x', retryCounter '%d'."
#define ASPNETCORE_EVENT_PROCESS_START_WRONGPORT_ERROR_MSG L"Application '%s' with physical root '%s' created process with commandline '%s' but failed to listen on the given port '%d'"
-#define ASPNETCORE_EVENT_PROCESS_START_NOTREADY_ERROR_MSG L"Application '%s' with physical root '%s' created process with commandline '%s' but either crashed or did not response or did not listen on the given port '%d', ErrorCode = '0x%x'"
-#define ASPNETCORE_EVENT_INVALID_STDOUT_LOG_FILE_MSG L"Warning: Could not create stdoutLogFile %s, ErrorCode = %d."
+#define ASPNETCORE_EVENT_PROCESS_START_NOTREADY_ERROR_MSG L"Application '%s' with physical root '%s' created process with commandline '%s' but either crashed or did not respond or did not listen on the given port '%d', ErrorCode = '0x%x'"
+#define ASPNETCORE_EVENT_INVALID_STDOUT_LOG_FILE_MSG L"Warning: Could not create stdoutLogFile %s, ErrorCode = '0x%x'."
#define ASPNETCORE_EVENT_GRACEFUL_SHUTDOWN_FAILURE_MSG L"Failed to gracefully shutdown process '%d'."
#define ASPNETCORE_EVENT_SENT_SHUTDOWN_HTTP_REQUEST_MSG L"Sent shutdown HTTP message to process '%d' and received http status '%d'."
#define ASPNETCORE_EVENT_LOAD_CLR_FALIURE_MSG L"Application '%s' with physical root '%s' failed to load clr and managed application, ErrorCode = '0x%x."
#define ASPNETCORE_EVENT_DUPLICATED_INPROCESS_APP_MSG L"Only one inprocess application is allowed per IIS application pool. Please assign the application '%s' to a different IIS application pool."
#define ASPNETCORE_EVENT_MIXED_HOSTING_MODEL_ERROR_MSG L"Mixed hosting model is not supported. Application '%s' configured with different hostingModel value '%d' other than the one of running application(s)."
#define ASPNETCORE_EVENT_ADD_APPLICATION_ERROR_MSG L"Failed to start application '%s', ErrorCode '0x%x'."
-#define ASPNETCORE_EVENT_INPROCESS_THREAD_EXIT_MSG L"Application '%s' with physical root '%s' hit unexpected managed background thread exit, ErrorCode = '0x%x."
+#define ASPNETCORE_EVENT_INPROCESS_THREAD_EXIT_MSG L"Application '%s' with physical root '%s' hit unexpected managed background thread exit, ErrorCode = '0x%x. Please check the stderr logs for more information."
#define ASPNETCORE_EVENT_RECYCLE_APPOFFLINE_MSG L"Application '%s' is recycled due to app_offline file was detected."
#define ASPNETCORE_EVENT_MODULE_DISABLED_MSG L"AspNetCore Module is disabled"
+#define ASPNETCORE_EVENT_INPROCESS_FULL_FRAMEWORK_APP_MSG L"Application '%s' was compiled for .NET Framework. Please compile for .NET core to run the inprocess application or change the process mode to out of process. ErrorCode = '0x%x'."
+#define ASPNETCORE_EVENT_PORTABLE_APP_DOTNET_MISSING_MSG L"Could not find dotnet.exe on the system PATH environment variable for portable application '%s'. Check that a valid path to dotnet is on the PATH and the bitness of dotnet matches the bitness of the IIS worker process. ErrorCode = '0x%x'."
+#define ASPNETCORE_EVENT_HOSTFXR_DIRECTORY_NOT_FOUND_MSG L"Could not find the hostfxr directory '%s' in the dotnet directory. ErrorCode = '0x%x'."
+#define ASPNETCORE_EVENT_HOSTFXR_DLL_NOT_FOUND_MSG L"Could not find hostfxr.dll in '%s'. ErrorCode = '0x%x'."
+#define ASPNETCORE_EVENT_APPLICATION_EXE_NOT_FOUND_MSG L"Could not find application executable in '%s'. ErrorCode = '0x%x'."
+#define ASPNETCORE_EVENT_INPROCESS_THREAD_EXCEPTION_MSG L"Application '%s' with physical root '%s' hit unexpected managed exception, ErrorCode = '0x%x. Please check the stderr logs for more information."
diff --git a/src/CommonLib/stdafx.h b/src/CommonLib/stdafx.h
index c3e3a35a26..119a9690ca 100644
--- a/src/CommonLib/stdafx.h
+++ b/src/CommonLib/stdafx.h
@@ -28,3 +28,5 @@
#include "requesthandler.h"
#include "fx_ver.h"
#include "hostfxr_utility.h"
+#include "resources.h"
+#include "aspnetcore_msg.h"