Make paths absolute for in-process, fix relative path check (#513)
This commit is contained in:
parent
7b65bdb6ef
commit
ab7ec622ef
|
|
@ -1,6 +1,7 @@
|
||||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
|
||||||
|
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||||
# Visual Studio 15
|
# Visual Studio 15
|
||||||
VisualStudioVersion = 15.0.27130.2010
|
VisualStudioVersion = 15.0.27130.2020
|
||||||
MinimumVisualStudioVersion = 15.0.26730.03
|
MinimumVisualStudioVersion = 15.0.26730.03
|
||||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{04B1EDB6-E967-4D25-89B9-E6F8304038CD}"
|
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{04B1EDB6-E967-4D25-89B9-E6F8304038CD}"
|
||||||
ProjectSection(SolutionItems) = preProject
|
ProjectSection(SolutionItems) = preProject
|
||||||
|
|
@ -53,7 +54,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CommonLib", "src\CommonLib\
|
||||||
EndProject
|
EndProject
|
||||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "RequestHandler", "src\RequestHandler\RequestHandler.vcxproj", "{D57EA297-6DC2-4BC0-8C91-334863327863}"
|
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "RequestHandler", "src\RequestHandler\RequestHandler.vcxproj", "{D57EA297-6DC2-4BC0-8C91-334863327863}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.AspNetCore.Server.IIS", "src\Microsoft.AspNetCore.Server.IIS\Microsoft.AspNetCore.Server.IIS.csproj", "{46A8612B-418B-4D70-B3A7-A21DD0627473}"
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.Server.IIS", "src\Microsoft.AspNetCore.Server.IIS\Microsoft.AspNetCore.Server.IIS.csproj", "{46A8612B-418B-4D70-B3A7-A21DD0627473}"
|
||||||
EndProject
|
EndProject
|
||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
|
|
@ -202,16 +203,16 @@ Global
|
||||||
{D57EA297-6DC2-4BC0-8C91-334863327863}.Release|x86.Build.0 = Release|Win32
|
{D57EA297-6DC2-4BC0-8C91-334863327863}.Release|x86.Build.0 = Release|Win32
|
||||||
{46A8612B-418B-4D70-B3A7-A21DD0627473}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
{46A8612B-418B-4D70-B3A7-A21DD0627473}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
{46A8612B-418B-4D70-B3A7-A21DD0627473}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{46A8612B-418B-4D70-B3A7-A21DD0627473}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{46A8612B-418B-4D70-B3A7-A21DD0627473}.Debug|x64.ActiveCfg = Debug|x64
|
{46A8612B-418B-4D70-B3A7-A21DD0627473}.Debug|x64.ActiveCfg = Debug|Any CPU
|
||||||
{46A8612B-418B-4D70-B3A7-A21DD0627473}.Debug|x64.Build.0 = Debug|x64
|
{46A8612B-418B-4D70-B3A7-A21DD0627473}.Debug|x64.Build.0 = Debug|Any CPU
|
||||||
{46A8612B-418B-4D70-B3A7-A21DD0627473}.Debug|x86.ActiveCfg = Debug|x86
|
{46A8612B-418B-4D70-B3A7-A21DD0627473}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||||
{46A8612B-418B-4D70-B3A7-A21DD0627473}.Debug|x86.Build.0 = Debug|x86
|
{46A8612B-418B-4D70-B3A7-A21DD0627473}.Debug|x86.Build.0 = Debug|Any CPU
|
||||||
{46A8612B-418B-4D70-B3A7-A21DD0627473}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{46A8612B-418B-4D70-B3A7-A21DD0627473}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
{46A8612B-418B-4D70-B3A7-A21DD0627473}.Release|Any CPU.Build.0 = Release|Any CPU
|
{46A8612B-418B-4D70-B3A7-A21DD0627473}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
{46A8612B-418B-4D70-B3A7-A21DD0627473}.Release|x64.ActiveCfg = Release|x64
|
{46A8612B-418B-4D70-B3A7-A21DD0627473}.Release|x64.ActiveCfg = Release|Any CPU
|
||||||
{46A8612B-418B-4D70-B3A7-A21DD0627473}.Release|x64.Build.0 = Release|x64
|
{46A8612B-418B-4D70-B3A7-A21DD0627473}.Release|x64.Build.0 = Release|Any CPU
|
||||||
{46A8612B-418B-4D70-B3A7-A21DD0627473}.Release|x86.ActiveCfg = Release|x86
|
{46A8612B-418B-4D70-B3A7-A21DD0627473}.Release|x86.ActiveCfg = Release|Any CPU
|
||||||
{46A8612B-418B-4D70-B3A7-A21DD0627473}.Release|x86.Build.0 = Release|x86
|
{46A8612B-418B-4D70-B3A7-A21DD0627473}.Release|x86.Build.0 = Release|Any CPU
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(SolutionProperties) = preSolution
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
HideSolutionNode = FALSE
|
HideSolutionNode = FALSE
|
||||||
|
|
|
||||||
|
|
@ -25,24 +25,21 @@ HOSTFXR_UTILITY::~HOSTFXR_UTILITY()
|
||||||
//
|
//
|
||||||
HRESULT
|
HRESULT
|
||||||
HOSTFXR_UTILITY::GetStandaloneHostfxrParameters(
|
HOSTFXR_UTILITY::GetStandaloneHostfxrParameters(
|
||||||
|
PCWSTR pwzExePath,
|
||||||
ASPNETCORE_CONFIG *pConfig
|
ASPNETCORE_CONFIG *pConfig
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
HRESULT hr = S_OK;
|
HRESULT hr = S_OK;
|
||||||
STRU struExePath;
|
|
||||||
STRU struDllPath;
|
STRU struDllPath;
|
||||||
STRU struArguments;
|
STRU struArguments;
|
||||||
DWORD dwPosition;
|
DWORD dwPosition;
|
||||||
|
|
||||||
hr = UTILITY::ConvertPathToFullPath(pConfig->QueryProcessPath()->QueryStr(),
|
|
||||||
pConfig->QueryApplicationPhysicalPath()->QueryStr(),
|
|
||||||
&struExePath);
|
|
||||||
if (FAILED(hr))
|
if (FAILED(hr))
|
||||||
{
|
{
|
||||||
goto Finished;
|
goto Finished;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (FAILED(hr = struDllPath.Copy(struExePath)))
|
if (FAILED(hr = struDllPath.Copy(pwzExePath)))
|
||||||
{
|
{
|
||||||
goto Finished;
|
goto Finished;
|
||||||
}
|
}
|
||||||
|
|
@ -76,7 +73,7 @@ HOSTFXR_UTILITY::GetStandaloneHostfxrParameters(
|
||||||
goto Finished;
|
goto Finished;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (FAILED(hr = SetHostFxrArguments(&struArguments, &struExePath, pConfig)))
|
if (FAILED(hr = SetHostFxrArguments(struArguments.QueryStr(), pwzExePath, pConfig)))
|
||||||
{
|
{
|
||||||
goto Finished;
|
goto Finished;
|
||||||
}
|
}
|
||||||
|
|
@ -94,18 +91,32 @@ HOSTFXR_UTILITY::GetHostFxrParameters(
|
||||||
HRESULT hr = S_OK;
|
HRESULT hr = S_OK;
|
||||||
STRU struSystemPathVariable;
|
STRU struSystemPathVariable;
|
||||||
STRU struHostFxrPath;
|
STRU struHostFxrPath;
|
||||||
STRU strDotnetExeLocation;
|
STRU struExeLocation;
|
||||||
STRU strHostFxrSearchExpression;
|
STRU struHostFxrSearchExpression;
|
||||||
STRU strHighestDotnetVersion;
|
STRU struHighestDotnetVersion;
|
||||||
std::vector<std::wstring> vVersionFolders;
|
std::vector<std::wstring> vVersionFolders;
|
||||||
DWORD dwPosition;
|
DWORD dwPosition;
|
||||||
DWORD dwPathLength = MAX_PATH;
|
DWORD dwPathLength = MAX_PATH;
|
||||||
DWORD dwDotnetLength = 0;
|
DWORD dwDotnetLength = 0;
|
||||||
BOOL fFound = FALSE;
|
BOOL fFound = FALSE;
|
||||||
|
|
||||||
if (UTILITY::CheckIfFileExists(pConfig->QueryProcessPath()->QueryStr()))
|
// Convert the process path an absolute path.
|
||||||
|
hr = UTILITY::ConvertPathToFullPath(
|
||||||
|
pConfig->QueryProcessPath()->QueryStr(),
|
||||||
|
pConfig->QueryApplicationPhysicalPath()->QueryStr(),
|
||||||
|
&struExeLocation
|
||||||
|
);
|
||||||
|
|
||||||
|
if (FAILED(hr))
|
||||||
{
|
{
|
||||||
hr = UTILITY::ConvertPathToFullPath(L"hostfxr.dll", pConfig->QueryApplicationPath()->QueryStr(), &struHostFxrPath);
|
goto Finished;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (UTILITY::CheckIfFileExists(struExeLocation.QueryStr()))
|
||||||
|
{
|
||||||
|
// 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))
|
if (FAILED(hr))
|
||||||
{
|
{
|
||||||
goto Finished;
|
goto Finished;
|
||||||
|
|
@ -119,54 +130,44 @@ HOSTFXR_UTILITY::GetHostFxrParameters(
|
||||||
goto Finished;
|
goto Finished;
|
||||||
}
|
}
|
||||||
|
|
||||||
hr = GetStandaloneHostfxrParameters(pConfig);
|
hr = GetStandaloneHostfxrParameters(struExeLocation.QueryStr(), pConfig);
|
||||||
goto Finished;
|
goto Finished;
|
||||||
}
|
}
|
||||||
else
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (FAILED(hr = struExeLocation.Resize(MAX_PATH)))
|
||||||
{
|
{
|
||||||
hr = UTILITY::ConvertPathToFullPath(
|
goto Finished;
|
||||||
pConfig->QueryProcessPath()->QueryStr(),
|
}
|
||||||
pConfig->QueryApplicationPath()->QueryStr(),
|
|
||||||
&strDotnetExeLocation
|
while (!fFound)
|
||||||
);
|
{
|
||||||
if (FAILED(hr))
|
dwDotnetLength = SearchPath(NULL, L"dotnet", L".exe", dwPathLength, struExeLocation.QueryStr(), NULL);
|
||||||
|
if (dwDotnetLength == 0)
|
||||||
{
|
{
|
||||||
|
hr = GetLastError();
|
||||||
|
// Could not find dotnet
|
||||||
goto Finished;
|
goto Finished;
|
||||||
}
|
}
|
||||||
|
else if (dwDotnetLength == dwPathLength)
|
||||||
|
{
|
||||||
|
// Increase size
|
||||||
|
dwPathLength *= 2;
|
||||||
|
if (FAILED(hr = struExeLocation.Resize(dwPathLength)))
|
||||||
|
{
|
||||||
|
goto Finished;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
fFound = TRUE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (FAILED(hr = strDotnetExeLocation.Resize(MAX_PATH)))
|
if (FAILED(hr = struExeLocation.SyncWithBuffer())
|
||||||
{
|
|| FAILED(hr = struHostFxrPath.Copy(struExeLocation)))
|
||||||
goto Finished;
|
|
||||||
}
|
|
||||||
|
|
||||||
while (!fFound)
|
|
||||||
{
|
|
||||||
dwDotnetLength = SearchPath(NULL, L"dotnet", L".exe", dwPathLength, strDotnetExeLocation.QueryStr(), NULL);
|
|
||||||
if (dwDotnetLength == 0)
|
|
||||||
{
|
|
||||||
hr = GetLastError();
|
|
||||||
// Could not find dotnet
|
|
||||||
goto Finished;
|
|
||||||
}
|
|
||||||
else if (dwDotnetLength == dwPathLength)
|
|
||||||
{
|
|
||||||
// Increase size
|
|
||||||
dwPathLength *= 2;
|
|
||||||
if (FAILED(hr = strDotnetExeLocation.Resize(dwPathLength)))
|
|
||||||
{
|
|
||||||
goto Finished;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
fFound = TRUE;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (FAILED(hr = strDotnetExeLocation.SyncWithBuffer())
|
|
||||||
|| FAILED(hr = struHostFxrPath.Copy(strDotnetExeLocation)))
|
|
||||||
{
|
{
|
||||||
goto Finished;
|
goto Finished;
|
||||||
}
|
}
|
||||||
|
|
@ -200,13 +201,13 @@ HOSTFXR_UTILITY::GetHostFxrParameters(
|
||||||
}
|
}
|
||||||
|
|
||||||
// Find all folders under host\\fxr\\ for version numbers.
|
// Find all folders under host\\fxr\\ for version numbers.
|
||||||
hr = strHostFxrSearchExpression.Copy(struHostFxrPath);
|
hr = struHostFxrSearchExpression.Copy(struHostFxrPath);
|
||||||
if (FAILED(hr))
|
if (FAILED(hr))
|
||||||
{
|
{
|
||||||
goto Finished;
|
goto Finished;
|
||||||
}
|
}
|
||||||
|
|
||||||
hr = strHostFxrSearchExpression.Append(L"\\*");
|
hr = struHostFxrSearchExpression.Append(L"\\*");
|
||||||
if (FAILED(hr))
|
if (FAILED(hr))
|
||||||
{
|
{
|
||||||
goto Finished;
|
goto Finished;
|
||||||
|
|
@ -214,7 +215,7 @@ HOSTFXR_UTILITY::GetHostFxrParameters(
|
||||||
|
|
||||||
// As we use the logic from core-setup, we are opting to use std here.
|
// As we use the logic from core-setup, we are opting to use std here.
|
||||||
// TODO remove all uses of std?
|
// TODO remove all uses of std?
|
||||||
UTILITY::FindDotNetFolders(strHostFxrSearchExpression.QueryStr(), &vVersionFolders);
|
UTILITY::FindDotNetFolders(struHostFxrSearchExpression.QueryStr(), &vVersionFolders);
|
||||||
|
|
||||||
if (vVersionFolders.size() == 0)
|
if (vVersionFolders.size() == 0)
|
||||||
{
|
{
|
||||||
|
|
@ -223,14 +224,14 @@ HOSTFXR_UTILITY::GetHostFxrParameters(
|
||||||
goto Finished;
|
goto Finished;
|
||||||
}
|
}
|
||||||
|
|
||||||
hr = UTILITY::FindHighestDotNetVersion(vVersionFolders, &strHighestDotnetVersion);
|
hr = UTILITY::FindHighestDotNetVersion(vVersionFolders, &struHighestDotnetVersion);
|
||||||
if (FAILED(hr))
|
if (FAILED(hr))
|
||||||
{
|
{
|
||||||
goto Finished;
|
goto Finished;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (FAILED(hr = struHostFxrPath.Append(L"\\"))
|
if (FAILED(hr = struHostFxrPath.Append(L"\\"))
|
||||||
|| FAILED(hr = struHostFxrPath.Append(strHighestDotnetVersion.QueryStr()))
|
|| FAILED(hr = struHostFxrPath.Append(struHighestDotnetVersion.QueryStr()))
|
||||||
|| FAILED(hr = struHostFxrPath.Append(L"\\hostfxr.dll")))
|
|| FAILED(hr = struHostFxrPath.Append(L"\\hostfxr.dll")))
|
||||||
{
|
{
|
||||||
goto Finished;
|
goto Finished;
|
||||||
|
|
@ -242,7 +243,7 @@ HOSTFXR_UTILITY::GetHostFxrParameters(
|
||||||
goto Finished;
|
goto Finished;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (FAILED(hr = SetHostFxrArguments(pConfig->QueryArguments(), &strDotnetExeLocation, pConfig)))
|
if (FAILED(hr = SetHostFxrArguments(pConfig->QueryArguments()->QueryStr(), struExeLocation.QueryStr(), pConfig)))
|
||||||
{
|
{
|
||||||
goto Finished;
|
goto Finished;
|
||||||
}
|
}
|
||||||
|
|
@ -263,12 +264,12 @@ Finished:
|
||||||
// Arg structure:
|
// Arg structure:
|
||||||
// argv[0] = Path to exe activating hostfxr.
|
// argv[0] = Path to exe activating hostfxr.
|
||||||
// argv[1] = L"exec"
|
// argv[1] = L"exec"
|
||||||
// argv[2] = first argument specified in the arguments portion of aspnetcore config.
|
// argv[2] = absolute path to dll.
|
||||||
//
|
//
|
||||||
HRESULT
|
HRESULT
|
||||||
HOSTFXR_UTILITY::SetHostFxrArguments(
|
HOSTFXR_UTILITY::SetHostFxrArguments(
|
||||||
STRU* struArgumentsFromConfig,
|
PCWSTR pwzArgumentsFromConfig,
|
||||||
STRU* pstruExePath,
|
PCWSTR pwzExePath,
|
||||||
ASPNETCORE_CONFIG* pConfig
|
ASPNETCORE_CONFIG* pConfig
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
|
@ -276,30 +277,89 @@ HOSTFXR_UTILITY::SetHostFxrArguments(
|
||||||
INT argc = 0;
|
INT argc = 0;
|
||||||
PCWSTR* argv = NULL;
|
PCWSTR* argv = NULL;
|
||||||
LPWSTR* pwzArgs = NULL;
|
LPWSTR* pwzArgs = NULL;
|
||||||
|
STRU struTempPath;
|
||||||
|
DWORD dwArgsProcessed = 0;
|
||||||
|
|
||||||
pwzArgs = CommandLineToArgvW(struArgumentsFromConfig->QueryStr(), &argc);
|
pwzArgs = CommandLineToArgvW(pwzArgumentsFromConfig, &argc);
|
||||||
|
|
||||||
if (pwzArgs == NULL)
|
if (pwzArgs == NULL)
|
||||||
{
|
{
|
||||||
goto Finished;
|
hr = HRESULT_FROM_WIN32(GetLastError());
|
||||||
|
goto Failure;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (argc < 1)
|
||||||
|
{
|
||||||
|
// Invalid arguments
|
||||||
|
hr = E_INVALIDARG;
|
||||||
|
goto Failure;
|
||||||
}
|
}
|
||||||
|
|
||||||
argv = new PCWSTR[argc + 2];
|
argv = new PCWSTR[argc + 2];
|
||||||
if (argv == NULL)
|
if (argv == NULL)
|
||||||
{
|
{
|
||||||
hr = E_OUTOFMEMORY;
|
hr = E_OUTOFMEMORY;
|
||||||
goto Finished;
|
goto Failure;
|
||||||
}
|
}
|
||||||
|
|
||||||
argv[0] = SysAllocString(pstruExePath->QueryStr());
|
argv[0] = SysAllocString(pwzExePath);
|
||||||
argv[1] = SysAllocString(L"exec");
|
|
||||||
|
|
||||||
for (INT i = 0; i < argc; i++)
|
if (argv[0] == NULL)
|
||||||
|
{
|
||||||
|
hr = E_OUTOFMEMORY;
|
||||||
|
goto Failure;
|
||||||
|
}
|
||||||
|
dwArgsProcessed++;
|
||||||
|
|
||||||
|
argv[1] = SysAllocString(L"exec");
|
||||||
|
if (argv[1] == NULL)
|
||||||
|
{
|
||||||
|
hr = E_OUTOFMEMORY;
|
||||||
|
goto Failure;
|
||||||
|
}
|
||||||
|
dwArgsProcessed++;
|
||||||
|
|
||||||
|
// 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)))
|
||||||
|
{
|
||||||
|
argv[2] = SysAllocString(struTempPath.QueryStr());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
argv[2] = SysAllocString(pwzArgs[0]);
|
||||||
|
}
|
||||||
|
if (argv[2] == NULL)
|
||||||
|
{
|
||||||
|
hr = E_OUTOFMEMORY;
|
||||||
|
goto Failure;
|
||||||
|
}
|
||||||
|
dwArgsProcessed++;
|
||||||
|
|
||||||
|
for (INT i = 1; i < argc; i++)
|
||||||
{
|
{
|
||||||
argv[i + 2] = SysAllocString(pwzArgs[i]);
|
argv[i + 2] = SysAllocString(pwzArgs[i]);
|
||||||
|
if (argv[i + 2] == NULL)
|
||||||
|
{
|
||||||
|
hr = E_OUTOFMEMORY;
|
||||||
|
goto Failure;
|
||||||
|
}
|
||||||
|
dwArgsProcessed++;
|
||||||
}
|
}
|
||||||
|
|
||||||
pConfig->SetHostFxrArguments(argc + 2, argv);
|
pConfig->SetHostFxrArguments(argc + 2, argv);
|
||||||
|
goto Finished;
|
||||||
|
|
||||||
|
Failure:
|
||||||
|
if (argv != NULL)
|
||||||
|
{
|
||||||
|
for (DWORD i = 0; i < dwArgsProcessed; i++)
|
||||||
|
{
|
||||||
|
SysFreeString((BSTR)argv[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
delete[] argv;
|
||||||
|
|
||||||
Finished:
|
Finished:
|
||||||
if (pwzArgs != NULL)
|
if (pwzArgs != NULL)
|
||||||
|
|
|
||||||
|
|
@ -23,15 +23,16 @@ private:
|
||||||
static
|
static
|
||||||
HRESULT
|
HRESULT
|
||||||
GetStandaloneHostfxrParameters(
|
GetStandaloneHostfxrParameters(
|
||||||
|
PCWSTR pStruExePath,
|
||||||
ASPNETCORE_CONFIG *pConfig
|
ASPNETCORE_CONFIG *pConfig
|
||||||
);
|
);
|
||||||
|
|
||||||
static
|
static
|
||||||
HRESULT
|
HRESULT
|
||||||
SetHostFxrArguments(
|
SetHostFxrArguments(
|
||||||
STRU * struArguments,
|
PCWSTR struArguments,
|
||||||
STRU * pstruExePath,
|
PCWSTR pStruExePath,
|
||||||
ASPNETCORE_CONFIG *pConfig
|
ASPNETCORE_CONFIG *pConfig
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,7 @@
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <shellapi.h>
|
#include <shellapi.h>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
|
#include "Shlwapi.h"
|
||||||
#include "..\IISLib\hashtable.h"
|
#include "..\IISLib\hashtable.h"
|
||||||
#include "..\IISLib\stringu.h"
|
#include "..\IISLib\stringu.h"
|
||||||
#include "..\IISLib\stringa.h"
|
#include "..\IISLib\stringa.h"
|
||||||
|
|
|
||||||
|
|
@ -384,7 +384,7 @@ UTILITY::ConvertPathToFullPath(
|
||||||
LPWSTR pszFullPath = NULL;
|
LPWSTR pszFullPath = NULL;
|
||||||
|
|
||||||
// if relative path, prefix with root path and then convert to absolute path.
|
// if relative path, prefix with root path and then convert to absolute path.
|
||||||
if ( pszPath[0] == L'.' )
|
if ( PathIsRelative(pszPath) )
|
||||||
{
|
{
|
||||||
hr = strFileFullPath.Copy(pszRootPath);
|
hr = strFileFullPath.Copy(pszRootPath);
|
||||||
if(FAILED(hr))
|
if(FAILED(hr))
|
||||||
|
|
|
||||||
|
|
@ -48,7 +48,13 @@ namespace IISIntegration.IISServerFunctionalTests
|
||||||
ServerConfigTemplateContent = (serverType == ServerType.IISExpress) ? File.ReadAllText("Http.config") : null,
|
ServerConfigTemplateContent = (serverType == ServerType.IISExpress) ? File.ReadAllText("Http.config") : null,
|
||||||
SiteName = "HttpTestSite", // This is configured in the Http.config
|
SiteName = "HttpTestSite", // This is configured in the Http.config
|
||||||
TargetFramework = "netcoreapp2.0",
|
TargetFramework = "netcoreapp2.0",
|
||||||
ApplicationType = ApplicationType.Portable
|
ApplicationType = ApplicationType.Portable,
|
||||||
|
Configuration =
|
||||||
|
#if DEBUG
|
||||||
|
"Debug"
|
||||||
|
#else
|
||||||
|
"Release"
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
using (var deployer = ApplicationDeployerFactory.Create(deploymentParameters, loggerFactory))
|
using (var deployer = ApplicationDeployerFactory.Create(deploymentParameters, loggerFactory))
|
||||||
|
|
|
||||||
|
|
@ -47,6 +47,12 @@ namespace Microsoft.AspNetCore.Server.IIS.FunctionalTests
|
||||||
SiteName = "HttpTestSite", // This is configured in the Http.config
|
SiteName = "HttpTestSite", // This is configured in the Http.config
|
||||||
TargetFramework = runtimeFlavor == RuntimeFlavor.Clr ? "net461" : "netcoreapp2.0",
|
TargetFramework = runtimeFlavor == RuntimeFlavor.Clr ? "net461" : "netcoreapp2.0",
|
||||||
ApplicationType = applicationType,
|
ApplicationType = applicationType,
|
||||||
|
Configuration =
|
||||||
|
#if DEBUG
|
||||||
|
"Debug"
|
||||||
|
#else
|
||||||
|
"Release"
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
using (var deployer = ApplicationDeployerFactory.Create(deploymentParameters, loggerFactory))
|
using (var deployer = ApplicationDeployerFactory.Create(deploymentParameters, loggerFactory))
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@ namespace Microsoft.AspNetCore.Server.IIS.FunctionalTests
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
[Fact(Skip = "See https://github.com/aspnet/IISIntegration/issues/424")]
|
[Fact(Skip = "See https://github.com/aspnet/IISIntegration/issues/515")]
|
||||||
public Task HelloWorld_InProcess_IISExpress_CoreClr_X64_Portable()
|
public Task HelloWorld_InProcess_IISExpress_CoreClr_X64_Portable()
|
||||||
{
|
{
|
||||||
return HelloWorld(RuntimeFlavor.CoreClr, ApplicationType.Portable);
|
return HelloWorld(RuntimeFlavor.CoreClr, ApplicationType.Portable);
|
||||||
|
|
@ -42,7 +42,13 @@ namespace Microsoft.AspNetCore.Server.IIS.FunctionalTests
|
||||||
ServerConfigTemplateContent = (serverType == ServerType.IISExpress) ? File.ReadAllText("Http.config") : null,
|
ServerConfigTemplateContent = (serverType == ServerType.IISExpress) ? File.ReadAllText("Http.config") : null,
|
||||||
SiteName = "HttpTestSite", // This is configured in the Http.config
|
SiteName = "HttpTestSite", // This is configured in the Http.config
|
||||||
TargetFramework = runtimeFlavor == RuntimeFlavor.Clr ? "net461" : "netcoreapp2.0",
|
TargetFramework = runtimeFlavor == RuntimeFlavor.Clr ? "net461" : "netcoreapp2.0",
|
||||||
ApplicationType = applicationType
|
ApplicationType = applicationType,
|
||||||
|
Configuration =
|
||||||
|
#if DEBUG
|
||||||
|
"Debug"
|
||||||
|
#else
|
||||||
|
"Release"
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
using (var deployer = ApplicationDeployerFactory.Create(deploymentParameters, loggerFactory))
|
using (var deployer = ApplicationDeployerFactory.Create(deploymentParameters, loggerFactory))
|
||||||
|
|
|
||||||
|
|
@ -253,7 +253,7 @@
|
||||||
<add name="ManagedEngine64" image="%windir%\Microsoft.NET\Framework64\v2.0.50727\webengine.dll" preCondition="integratedMode,runtimeVersionv2.0,bitness64" />
|
<add name="ManagedEngine64" image="%windir%\Microsoft.NET\Framework64\v2.0.50727\webengine.dll" preCondition="integratedMode,runtimeVersionv2.0,bitness64" />
|
||||||
<add name="ManagedEngineV4.0_32bit" image="%windir%\Microsoft.NET\Framework\v4.0.30319\webengine4.dll" preCondition="integratedMode,runtimeVersionv4.0,bitness32" />
|
<add name="ManagedEngineV4.0_32bit" image="%windir%\Microsoft.NET\Framework\v4.0.30319\webengine4.dll" preCondition="integratedMode,runtimeVersionv4.0,bitness32" />
|
||||||
<add name="ManagedEngineV4.0_64bit" image="%windir%\Microsoft.NET\Framework64\v4.0.30319\webengine4.dll" preCondition="integratedMode,runtimeVersionv4.0,bitness64" />
|
<add name="ManagedEngineV4.0_64bit" image="%windir%\Microsoft.NET\Framework64\v4.0.30319\webengine4.dll" preCondition="integratedMode,runtimeVersionv4.0,bitness64" />
|
||||||
<add name="AspNetCoreModule" image="%IIS_BIN%\aspnetcore.dll"/>
|
<add name="AspNetCoreModule" image="[ANCMPath]"/>
|
||||||
</globalModules>
|
</globalModules>
|
||||||
|
|
||||||
<httpCompression directory="%TEMP%\iisexpress\IIS Temporary Compressed Files">
|
<httpCompression directory="%TEMP%\iisexpress\IIS Temporary Compressed Files">
|
||||||
|
|
|
||||||
|
|
@ -48,7 +48,13 @@ namespace Microsoft.AspNetCore.Server.IIS.FunctionalTests
|
||||||
ServerConfigTemplateContent = (serverType == ServerType.IISExpress) ? File.ReadAllText("Http.config") : null,
|
ServerConfigTemplateContent = (serverType == ServerType.IISExpress) ? File.ReadAllText("Http.config") : null,
|
||||||
SiteName = "HttpTestSite", // This is configured in the Http.config
|
SiteName = "HttpTestSite", // This is configured in the Http.config
|
||||||
TargetFramework = runtimeFlavor == RuntimeFlavor.Clr ? "net461" : "netcoreapp2.0",
|
TargetFramework = runtimeFlavor == RuntimeFlavor.Clr ? "net461" : "netcoreapp2.0",
|
||||||
ApplicationType = applicationType
|
ApplicationType = applicationType,
|
||||||
|
Configuration =
|
||||||
|
#if DEBUG
|
||||||
|
"Debug"
|
||||||
|
#else
|
||||||
|
"Release"
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
using (var deployer = ApplicationDeployerFactory.Create(deploymentParameters, loggerFactory))
|
using (var deployer = ApplicationDeployerFactory.Create(deploymentParameters, loggerFactory))
|
||||||
|
|
|
||||||
|
|
@ -46,7 +46,13 @@ namespace Microsoft.AspNetCore.Server.IIS.FunctionalTests
|
||||||
ServerConfigTemplateContent = (serverType == ServerType.IISExpress) ? File.ReadAllText("Http.config") : null,
|
ServerConfigTemplateContent = (serverType == ServerType.IISExpress) ? File.ReadAllText("Http.config") : null,
|
||||||
SiteName = "HttpTestSite", // This is configured in the Http.config
|
SiteName = "HttpTestSite", // This is configured in the Http.config
|
||||||
TargetFramework = "netcoreapp2.0",
|
TargetFramework = "netcoreapp2.0",
|
||||||
ApplicationType = applicationType
|
ApplicationType = applicationType,
|
||||||
|
Configuration =
|
||||||
|
#if DEBUG
|
||||||
|
"Debug"
|
||||||
|
#else
|
||||||
|
"Release"
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
using (var deployer = ApplicationDeployerFactory.Create(deploymentParameters, loggerFactory))
|
using (var deployer = ApplicationDeployerFactory.Create(deploymentParameters, loggerFactory))
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,13 @@ namespace Microsoft.AspNetCore.Server.IIS.FunctionalTests
|
||||||
ServerConfigTemplateContent = (serverType == ServerType.IISExpress) ? File.ReadAllText("Http.config") : null,
|
ServerConfigTemplateContent = (serverType == ServerType.IISExpress) ? File.ReadAllText("Http.config") : null,
|
||||||
SiteName = "HttpTestSite", // This is configured in the Http.config
|
SiteName = "HttpTestSite", // This is configured in the Http.config
|
||||||
TargetFramework = runtimeFlavor == RuntimeFlavor.Clr ? "net461" : "netcoreapp2.0",
|
TargetFramework = runtimeFlavor == RuntimeFlavor.Clr ? "net461" : "netcoreapp2.0",
|
||||||
ApplicationType = applicationType
|
ApplicationType = applicationType,
|
||||||
|
Configuration =
|
||||||
|
#if DEBUG
|
||||||
|
"Debug"
|
||||||
|
#else
|
||||||
|
"Release"
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
using (var deployer = ApplicationDeployerFactory.Create(deploymentParameters, loggerFactory))
|
using (var deployer = ApplicationDeployerFactory.Create(deploymentParameters, loggerFactory))
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Microsoft.AspNetCore.Server.Kestrel" Version="$(MicrosoftAspNetCoreServerKestrelPackageVersion)" />
|
<PackageReference Include="Microsoft.AspNetCore.Hosting" Version="$(MicrosoftAspNetCoreHostingPackageVersion)" />
|
||||||
<PackageReference Include="Microsoft.AspNetCore.WebUtilities" Version="$(MicrosoftAspNetCoreWebUtilitiesPackageVersion)" />
|
<PackageReference Include="Microsoft.AspNetCore.WebUtilities" Version="$(MicrosoftAspNetCoreWebUtilitiesPackageVersion)" />
|
||||||
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="$(MicrosoftExtensionsConfigurationEnvironmentVariablesPackageVersion)" />
|
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="$(MicrosoftExtensionsConfigurationEnvironmentVariablesPackageVersion)" />
|
||||||
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="$(MicrosoftExtensionsConfigurationJsonPackageVersion)" />
|
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="$(MicrosoftExtensionsConfigurationJsonPackageVersion)" />
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue