Merge branch 'merge/release/2.2-to-master'

This commit is contained in:
Ryan Brandenburg 2018-08-06 10:43:06 -07:00
commit 9f4375e55e
28 changed files with 128 additions and 127 deletions

View File

@ -37,7 +37,7 @@
<AncmPath>$(AspNetCoreModuleV1ShimDll)</AncmPath>
<AncmV2Path>$(AspNetCoreModuleV2ShimDll)</AncmV2Path>
<AncmInProcessRHPath>$(NativePlatform)\aspnetcorev2_inprocess.dll</AncmInProcessRHPath>
<AncmInProcessRHPath>aspnetcorev2_inprocess.dll</AncmInProcessRHPath>
<DotNetPath>$(userprofile)\.dotnet\$(NativePlatform)\dotnet.exe</DotNetPath>
</PropertyGroup>

View File

@ -13,7 +13,6 @@ public:
: m_HR(hr),
PollingAppOfflineApplication(pApplication, PollingAppOfflineApplicationMode::StopWhenAdded)
{
m_status = APPLICATION_STATUS::RUNNING;
}
~ServerErrorApplication() = default;

View File

@ -54,7 +54,7 @@ APPLICATION_INFO::GetOrCreateApplication(
)
{
HRESULT hr = S_OK;
SRWExclusiveLock lock(m_applicationLock);
auto& httpApplication = *pHttpContext->GetApplication();
@ -72,7 +72,7 @@ APPLICATION_INFO::GetOrCreateApplication(
else
{
// another thread created the application
FINISHED(S_OK);
FINISHED(S_OK);
}
}
@ -124,7 +124,7 @@ Finished:
if (m_pApplication)
{
pApplication = ReferenceApplication(m_pApplication.get());
pApplication = ReferenceApplication(m_pApplication.get());
}
return hr;
@ -410,7 +410,7 @@ APPLICATION_INFO::RecycleApplication()
}
DWORD WINAPI
DWORD WINAPI
APPLICATION_INFO::DoRecycleApplication(
LPVOID lpParam)
{

View File

@ -95,20 +95,12 @@ ASPNET_CORE_PROXY_MODULE::OnExecuteRequestHandler(
// the error should already been logged to window event log for the first request
FINISHED(E_APPLICATION_ACTIVATION_EXEC_FAILURE);
}
DBG_ASSERT(pHttpContext);
std::unique_ptr<IAPPLICATION, IAPPLICATION_DELETER> pApplication;
FINISHED_IF_FAILED(m_pApplicationInfo->GetOrCreateApplication(pHttpContext, pApplication));
// We allow RECYCLED application to serve pages
if (pApplication->QueryStatus() != APPLICATION_STATUS::RUNNING &&
pApplication->QueryStatus() != APPLICATION_STATUS::STARTING &&
pApplication->QueryStatus() != APPLICATION_STATUS::RECYCLED)
{
FINISHED(HRESULT_FROM_WIN32(ERROR_SERVER_DISABLED));
}
IREQUEST_HANDLER* pHandler;
// Create RequestHandler and process the request
FINISHED_IF_FAILED(pApplication->CreateHandler(pHttpContext, &pHandler));

View File

@ -13,6 +13,7 @@ public:
AppOfflineApplication(IHttpApplication& pApplication)
: PollingAppOfflineApplication(pApplication, PollingAppOfflineApplicationMode::StopWhenRemoved)
{
CheckAppOffline();
}
HRESULT CreateHandler(IHttpContext* pHttpContext, IREQUEST_HANDLER** pRequestHandler) override;

View File

@ -6,7 +6,7 @@
#include "GlobalVersionUtility.h"
namespace fs = std::filesystem;
namespace fs = std::experimental::filesystem;
// throws runtime error if no request handler versions are installed.
// Throw invalid_argument if any argument is null

View File

@ -9,11 +9,12 @@
APPLICATION_STATUS PollingAppOfflineApplication::QueryStatus()
{
return (AppOfflineExists() == (m_mode == StopWhenRemoved)) ? APPLICATION_STATUS::RUNNING : APPLICATION_STATUS::RECYCLED;
CheckAppOffline();
return APPLICATION::QueryStatus();
}
bool
PollingAppOfflineApplication::AppOfflineExists()
void
PollingAppOfflineApplication::CheckAppOffline()
{
const auto ulCurrentTime = GetTickCount64();
//
@ -29,16 +30,20 @@ PollingAppOfflineApplication::AppOfflineExists()
m_fAppOfflineFound = is_regular_file(m_appOfflineLocation);
if(m_fAppOfflineFound)
{
LOG_IF_FAILED(OnAppOfflineFound());
LOG_IF_FAILED(OnAppOfflineFound());
}
m_ulLastCheckTime = ulCurrentTime;
}
}
return m_fAppOfflineFound;
if (m_fAppOfflineFound != (m_mode == StopWhenRemoved))
{
Stop(/* fServerInitiated */ false);
}
}
std::filesystem::path PollingAppOfflineApplication::GetAppOfflineLocation(IHttpApplication& pApplication)
std::experimental::filesystem::path PollingAppOfflineApplication::GetAppOfflineLocation(IHttpApplication& pApplication)
{
return std::filesystem::path(pApplication.GetApplicationPhysicalPath()) / "app_offline.htm";
return std::experimental::filesystem::path(pApplication.GetApplicationPhysicalPath()) / "app_offline.htm";
}

View File

@ -25,18 +25,18 @@ public:
}
APPLICATION_STATUS QueryStatus() override;
bool AppOfflineExists();
void CheckAppOffline();
virtual HRESULT OnAppOfflineFound() = 0;
void Stop(bool fServerInitiated) override { UNREFERENCED_PARAMETER(fServerInitiated); }
void StopInternal(bool fServerInitiated) override { UNREFERENCED_PARAMETER(fServerInitiated); }
protected:
std::filesystem::path m_appOfflineLocation;
static std::filesystem::path GetAppOfflineLocation(IHttpApplication& pApplication);
std::experimental::filesystem::path m_appOfflineLocation;
static std::experimental::filesystem::path GetAppOfflineLocation(IHttpApplication& pApplication);
private:
static const int c_appOfflineRefreshIntervalMS = 200;
std::string m_strAppOfflineContent;
ULONGLONG m_ulLastCheckTime;
ULONGLONG m_ulLastCheckTime;
bool m_fAppOfflineFound;
SRWLOCK m_statusLock {};
PollingAppOfflineApplicationMode m_mode;

View File

@ -7,11 +7,10 @@
#include "exceptions.h"
#include "utility.h"
#include "ntassert.h"
#include "SRWExclusiveLock.h"
class APPLICATION : public IAPPLICATION
{
public:
// Non-copyable
APPLICATION(const APPLICATION&) = delete;
@ -20,24 +19,38 @@ public:
APPLICATION_STATUS
QueryStatus() override
{
return m_status;
return m_fStopCalled ? APPLICATION_STATUS::RECYCLED : APPLICATION_STATUS::RUNNING;
}
APPLICATION()
: m_cRefs(1)
: m_fStopCalled(false),
m_cRefs(1)
{
InitializeSRWLock(&m_stateLock);
}
VOID
Stop(bool fServerInitiated) override
{
UNREFERENCED_PARAMETER(fServerInitiated);
SRWExclusiveLock stopLock(m_stateLock);
if (m_fStopCalled)
{
return;
}
m_fStopCalled = true;
StopInternal(fServerInitiated);
}
virtual
VOID
StopInternal(bool fServerInitiated)
{
UNREFERENCED_PARAMETER(fServerInitiated);
}
VOID
ReferenceApplication() override
@ -59,11 +72,9 @@ public:
}
protected:
volatile APPLICATION_STATUS m_status = APPLICATION_STATUS::UNKNOWN;
SRWLOCK m_stateLock;
bool m_fStopCalled;
bool m_fStopCalled;
private:
mutable LONG m_cRefs;
mutable LONG m_cRefs;
};

View File

@ -13,7 +13,7 @@
#include "HandleWrapper.h"
#include "Environment.h"
namespace fs = std::filesystem;
namespace fs = std::experimental::filesystem;
//
// Runs a standalone appliction.
@ -98,7 +98,7 @@ HOSTFXR_UTILITY::GetStandaloneHostfxrParameters(
}
BOOL
HOSTFXR_UTILITY::IsDotnetExecutable(const std::filesystem::path & dotnetPath)
HOSTFXR_UTILITY::IsDotnetExecutable(const std::experimental::filesystem::path & dotnetPath)
{
auto name = dotnetPath.filename();
name.replace_extension("");

View File

@ -44,7 +44,7 @@ public:
static
BOOL
IsDotnetExecutable(
_In_ const std::filesystem::path & dotnetPath
_In_ const std::experimental::filesystem::path & dotnetPath
);
static
@ -74,25 +74,25 @@ public:
);
static
std::optional<std::filesystem::path>
std::optional<std::experimental::filesystem::path>
GetAbsolutePathToHostFxr(
_In_ const std::filesystem::path & dotnetPath,
_In_ const std::experimental::filesystem::path & dotnetPath,
_In_ HANDLE hEventLog
);
static
std::optional<std::filesystem::path>
std::optional<std::experimental::filesystem::path>
GetAbsolutePathToDotnetFromProgramFiles();
static
std::optional<std::filesystem::path>
std::optional<std::experimental::filesystem::path>
InvokeWhereToFindDotnet();
static
std::optional<std::filesystem::path>
std::optional<std::experimental::filesystem::path>
GetAbsolutePathToDotnet(
_In_ const std::filesystem::path & applicationPath,
_In_ const std::filesystem::path & requestedPath
_In_ const std::experimental::filesystem::path & applicationPath,
_In_ const std::experimental::filesystem::path & requestedPath
);
};

View File

@ -8,12 +8,8 @@
enum APPLICATION_STATUS
{
UNKNOWN = 0,
STARTING,
RUNNING,
SHUTDOWN,
RECYCLED,
FAIL
};
struct APPLICATION_PARAMETER

View File

@ -15,9 +15,9 @@ InProcessApplicationBase::InProcessApplicationBase(
}
VOID
InProcessApplicationBase::Stop(bool fServerInitiated)
InProcessApplicationBase::StopInternal(bool fServerInitiated)
{
AppOfflineTrackingApplication::Stop(fServerInitiated);
AppOfflineTrackingApplication::StopInternal(fServerInitiated);
// Stop was initiated by server no need to do anything, server would stop on it's own
if (fServerInitiated)

View File

@ -18,7 +18,7 @@ public:
~InProcessApplicationBase() = default;
VOID Stop(bool fServerInitiated) override;
VOID StopInternal(bool fServerInitiated) override;
protected:
BOOL m_fRecycleCalled;

View File

@ -32,7 +32,6 @@ public:
ShuttingDownApplication(IHttpServer& pHttpServer, IHttpApplication& pHttpApplication)
: InProcessApplicationBase(pHttpServer, pHttpApplication)
{
m_status = APPLICATION_STATUS::RUNNING;
}
~ShuttingDownApplication() = default;

View File

@ -16,7 +16,6 @@ public:
: m_disableLogs(disableLogs),
InProcessApplicationBase(pServer, pApplication)
{
m_status = APPLICATION_STATUS::RUNNING;
html500Page = std::string("<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\"> \
<html xmlns=\"http://www.w3.org/1999/xhtml\"> \
<head> \

View File

@ -23,7 +23,6 @@ IN_PROCESS_APPLICATION::IN_PROCESS_APPLICATION(
APPLICATION_PARAMETER *pParameters,
DWORD nParameters) :
InProcessApplicationBase(pHttpServer, pApplication),
m_pHttpServer(pHttpServer),
m_ProcessExitCode(0),
m_fBlockCallbacksIntoManaged(FALSE),
m_fShutdownCalledFromNative(FALSE),
@ -40,7 +39,7 @@ IN_PROCESS_APPLICATION::IN_PROCESS_APPLICATION(
}
}
m_status = APPLICATION_STATUS::STARTING;
m_status = MANAGED_APPLICATION_STATUS::STARTING;
}
IN_PROCESS_APPLICATION::~IN_PROCESS_APPLICATION()
@ -63,22 +62,13 @@ IN_PROCESS_APPLICATION::DoShutDown(
__override
VOID
IN_PROCESS_APPLICATION::Stop(bool fServerInitiated)
IN_PROCESS_APPLICATION::StopInternal(bool fServerInitiated)
{
UNREFERENCED_PARAMETER(fServerInitiated);
HRESULT hr = S_OK;
CHandle hThread;
DWORD dwThreadStatus = 0;
SRWExclusiveLock stopLock(m_stateLock);
if (m_fStopCalled)
{
return;
}
AppOfflineTrackingApplication::Stop(fServerInitiated);
DWORD dwTimeout = m_pConfig->QueryShutdownTimeLimitInMS();
if (IsDebuggerPresent())
@ -137,7 +127,7 @@ Finished:
m_pConfig->QueryConfigPath()->QueryStr());
}
InProcessApplicationBase::Stop(fServerInitiated);
InProcessApplicationBase::StopInternal(fServerInitiated);
}
VOID
@ -152,16 +142,16 @@ IN_PROCESS_APPLICATION::ShutDownInternal()
}
if (m_fShutdownCalledFromNative ||
m_status == APPLICATION_STATUS::STARTING ||
m_status == APPLICATION_STATUS::FAIL)
m_status == MANAGED_APPLICATION_STATUS::STARTING ||
m_status == MANAGED_APPLICATION_STATUS::FAIL)
{
return;
}
{
if (m_fShutdownCalledFromNative ||
m_status == APPLICATION_STATUS::STARTING ||
m_status == APPLICATION_STATUS::FAIL)
m_status == MANAGED_APPLICATION_STATUS::STARTING ||
m_status == MANAGED_APPLICATION_STATUS::FAIL)
{
return;
}
@ -171,7 +161,7 @@ IN_PROCESS_APPLICATION::ShutDownInternal()
// managed. We still need to wait on main exiting no matter what. m_fShutdownCalledFromNative
// is used for detecting redundant calls and blocking more requests to OnExecuteRequestHandler.
m_fShutdownCalledFromNative = TRUE;
m_status = APPLICATION_STATUS::RECYCLED;
m_status = MANAGED_APPLICATION_STATUS::SHUTDOWN;
if (!m_fShutdownCalledFromManaged)
{
@ -249,18 +239,18 @@ IN_PROCESS_APPLICATION::LoadManagedApplication
HRESULT hr = S_OK;
DWORD dwTimeout;
DWORD dwResult;
ReferenceApplication();
if (m_status != APPLICATION_STATUS::STARTING)
if (m_status != MANAGED_APPLICATION_STATUS::STARTING)
{
// Core CLR has already been loaded.
// Cannot load more than once even there was a failure
if (m_status == APPLICATION_STATUS::FAIL)
if (m_status == MANAGED_APPLICATION_STATUS::FAIL)
{
hr = E_APPLICATION_ACTIVATION_EXEC_FAILURE;
}
else if (m_status == APPLICATION_STATUS::SHUTDOWN)
else if (m_status == MANAGED_APPLICATION_STATUS::SHUTDOWN)
{
hr = HRESULT_FROM_WIN32(ERROR_SHUTDOWN_IS_SCHEDULED);
}
@ -289,13 +279,13 @@ IN_PROCESS_APPLICATION::LoadManagedApplication
LOG_IF_FAILED(m_pLoggerProvider->Start());
}
if (m_status != APPLICATION_STATUS::STARTING)
if (m_status != MANAGED_APPLICATION_STATUS::STARTING)
{
if (m_status == APPLICATION_STATUS::FAIL)
if (m_status == MANAGED_APPLICATION_STATUS::FAIL)
{
hr = E_APPLICATION_ACTIVATION_EXEC_FAILURE;
}
else if (m_status == APPLICATION_STATUS::SHUTDOWN)
else if (m_status == MANAGED_APPLICATION_STATUS::SHUTDOWN)
{
hr = HRESULT_FROM_WIN32(ERROR_SHUTDOWN_IS_SCHEDULED);
}
@ -363,13 +353,13 @@ IN_PROCESS_APPLICATION::LoadManagedApplication
goto Finished;
}
m_status = APPLICATION_STATUS::RUNNING;
m_status = MANAGED_APPLICATION_STATUS::RUNNING_MANAGED;
}
Finished:
if (FAILED(hr))
{
m_status = APPLICATION_STATUS::FAIL;
m_status = MANAGED_APPLICATION_STATUS::FAIL;
UTILITY::LogEventF(g_hEventLog,
EVENTLOG_ERROR_TYPE,
@ -444,7 +434,7 @@ IN_PROCESS_APPLICATION::ExecuteApplication(
hostfxr_main_fn pProc;
std::unique_ptr<HOSTFXR_OPTIONS> hostFxrOptions = NULL;
DBG_ASSERT(m_status == APPLICATION_STATUS::STARTING);
DBG_ASSERT(m_status == MANAGED_APPLICATION_STATUS::STARTING);
pProc = s_fMainCallback;
if (pProc == nullptr)
@ -502,7 +492,7 @@ Finished:
// Don't bother locking here as there will always be a race between receiving a native shutdown
// notification and unexpected managed exit.
//
m_status = APPLICATION_STATUS::SHUTDOWN;
m_status = MANAGED_APPLICATION_STATUS::SHUTDOWN;
m_fShutdownCalledFromManaged = TRUE;
FreeLibrary(hModule);
m_pLoggerProvider->Stop();
@ -575,12 +565,12 @@ IN_PROCESS_APPLICATION::RunDotnetApplication(DWORD argc, CONST PCWSTR* argv, hos
{
hr = HRESULT_FROM_WIN32(GetLastError());
}
LOG_INFOF("Managed application exited with code %d", m_ProcessExitCode);
}
__except(GetExceptionCode() != 0)
{
LOG_INFOF("Managed threw an exception %d", GetExceptionCode());
hr = HRESULT_FROM_WIN32(GetLastError());
}

View File

@ -26,7 +26,7 @@ public:
__override
VOID
Stop(bool fServerInitiated) override;
StopInternal(bool fServerInitiated) override;
VOID
SetCallbackHandles(
@ -111,7 +111,14 @@ public:
private:
IHttpServer & m_pHttpServer;
enum MANAGED_APPLICATION_STATUS
{
UNKNOWN = 0,
STARTING,
RUNNING_MANAGED,
SHUTDOWN,
FAIL
};
// Thread executing the .NET Core process
HANDLE m_hThread;
@ -138,6 +145,7 @@ private:
volatile BOOL m_fShutdownCalledFromNative;
volatile BOOL m_fShutdownCalledFromManaged;
BOOL m_fInitialized;
MANAGED_APPLICATION_STATUS m_status;
std::unique_ptr<REQUESTHANDLER_CONFIG> m_pConfig;
static IN_PROCESS_APPLICATION* s_Application;

View File

@ -12,7 +12,6 @@ OUT_OF_PROCESS_APPLICATION::OUT_OF_PROCESS_APPLICATION(
m_fWebSocketSupported(WEBSOCKET_STATUS::WEBSOCKET_UNKNOWN),
m_pConfig(std::move(pConfig))
{
m_status = APPLICATION_STATUS::RUNNING;
m_pProcessManager = NULL;
}
@ -62,16 +61,9 @@ OUT_OF_PROCESS_APPLICATION::GetProcess(
__override
VOID
OUT_OF_PROCESS_APPLICATION::Stop(bool fServerInitiated)
{
SRWExclusiveLock lock(m_stateLock);
if (m_fStopCalled)
{
return;
}
AppOfflineTrackingApplication::Stop(fServerInitiated);
OUT_OF_PROCESS_APPLICATION::StopInternal(bool fServerInitiated)
{
AppOfflineTrackingApplication::StopInternal(fServerInitiated);
if (m_pProcessManager != NULL)
{

View File

@ -32,7 +32,7 @@ public:
__override
VOID
Stop(bool fServerInitiated)
StopInternal(bool fServerInitiated)
override;
__override

View File

@ -6,8 +6,6 @@
#include "EventLog.h"
#include "exceptions.h"
extern HANDLE g_hEventLog;
HRESULT AppOfflineTrackingApplication::StartMonitoringAppOffline()
{
LOG_INFOF("Starting app_offline monitoring in application %S", m_applicationPath.c_str());
@ -26,11 +24,9 @@ HRESULT AppOfflineTrackingApplication::StartMonitoringAppOffline()
return hr;
}
void AppOfflineTrackingApplication::Stop(bool fServerInitiated)
void AppOfflineTrackingApplication::StopInternal(bool fServerInitiated)
{
APPLICATION::Stop(fServerInitiated);
m_status = APPLICATION_STATUS::RECYCLED;
APPLICATION::StopInternal(fServerInitiated);
if (m_fileWatcher)
{

View File

@ -12,7 +12,8 @@ class AppOfflineTrackingApplication: public APPLICATION
{
public:
AppOfflineTrackingApplication(const IHttpApplication& application)
: m_applicationPath(application.GetApplicationPhysicalPath()),
: APPLICATION(),
m_applicationPath(application.GetApplicationPhysicalPath()),
m_fileWatcher(nullptr),
m_fAppOfflineProcessed(false)
{
@ -23,15 +24,15 @@ public:
if (m_fileWatcher)
{
m_fileWatcher->StopMonitor();
}
}
};
HRESULT
StartMonitoringAppOffline();
VOID
Stop(bool fServerInitiated) override;
StopInternal(bool fServerInitiated) override;
virtual
VOID
OnAppOffline();

View File

@ -10,6 +10,7 @@
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<PackNativeAssets Condition="'$(OS)' == 'Windows_NT'">true</PackNativeAssets>
<NativeAssetsTargetFramework>netcoreapp2.2</NativeAssetsTargetFramework>
<DisableFastUpToDateCheck>True</DisableFastUpToDateCheck>
</PropertyGroup>
<Import Project="..\..\build\assets.props" />
@ -25,6 +26,12 @@
<PackageReference Include="Microsoft.AspNetCore.Hosting.Abstractions" Version="$(MicrosoftAspNetCoreHostingAbstractionsPackageVersion)" />
</ItemGroup>
<ItemGroup Condition="'$(VCTargetsPath)' != ''">
<ProjectReference Include="..\AspNetCoreModuleV2\InProcessRequestHandler\InProcessRequestHandler.vcxproj" >
<ReferenceOutputAssembly>False</ReferenceOutputAssembly>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Content Include="$(PackageId).targets" PackagePath="build/$(TargetFramework)/" />
</ItemGroup>
@ -43,14 +50,6 @@
<Target Name="AddRunNativeComponents" BeforeTargets="AssignTargetPaths" Condition="$(PackNativeAssets) == 'true'">
<ItemGroup>
<None Include="%(RunInProcessComponents.DllLocation)"
CopyToOutputDirectory="PreserveNewest"
Link="%(RunInProcessComponents.Platform)\%(RunInProcessComponents.NativeAsset).dll"/>
<None Include="%(RunInProcessComponents.PdbLocation)"
CopyToOutputDirectory="PreserveNewest"
Link="%(RunInProcessComponents.Platform)\%(RunInProcessComponents.NativeAsset).pdb"/>
<!-- Copy to platform specific and app local directory for standalone publish -->
<None Include="%(RunInProcessComponents.DllLocation)"
CopyToOutputDirectory="PreserveNewest"
Link="%(RunInProcessComponents.NativeAsset).dll"/>

View File

@ -7,6 +7,7 @@
<NoWarn>$(NoWarn);CS1591</NoWarn>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<PackageTags>aspnetcore;iis</PackageTags>
<DisableFastUpToDateCheck>True</DisableFastUpToDateCheck>
</PropertyGroup>
<Import Project="..\..\build\assets.props" />
@ -21,6 +22,18 @@
<PackageReference Include="Microsoft.Web.Administration" Version="$(MicrosoftWebAdministrationPackageVersion)" />
</ItemGroup>
<ItemGroup Condition="'$(VCTargetsPath)' != ''">
<ProjectReference Include="..\AspNetCoreModuleV1\AspNetCore\AspNetCore.vcxproj" >
<ReferenceOutputAssembly>False</ReferenceOutputAssembly>
</ProjectReference>
<ProjectReference Include="..\AspNetCoreModuleV2\AspNetCore\AspNetCore.vcxproj" >
<ReferenceOutputAssembly>False</ReferenceOutputAssembly>
</ProjectReference>
<ProjectReference Include="..\AspNetCoreModuleV2\OutOfProcessRequestHandler\OutOfProcessRequestHandler.vcxproj " >
<ReferenceOutputAssembly>False</ReferenceOutputAssembly>
</ProjectReference>
</ItemGroup>
<Target Name="AddPackNativeComponents" BeforeTargets="_GetPackageFiles;GetSignedPackageFiles" Condition="$(PackNativeAssets) == 'true'">
<ItemGroup>
<Content Include="%(ShimComponents.DllLocation)"

View File

@ -41,7 +41,7 @@ namespace FileOutManagerStartupTests
wprintf(expected, out);
}
for (auto & p : std::filesystem::directory_iterator(tempDirectory.path()))
for (auto & p : std::experimental::filesystem::directory_iterator(tempDirectory.path()))
{
std::wstring filename(p.path().filename());
ASSERT_EQ(filename.substr(0, fileNamePrefix.size()), fileNamePrefix);

View File

@ -7,7 +7,7 @@
namespace GlobalVersionTests
{
using ::testing::Test;
namespace fs = std::filesystem;
namespace fs = std::experimental::filesystem;
class GlobalVersionTest : public Test
{

View File

@ -28,7 +28,7 @@ TempDirectory::TempDirectory()
RPC_CSTR szUuid = NULL;
if (UuidToStringA(&uuid, &szUuid) == RPC_S_OK)
{
m_path = std::filesystem::temp_directory_path() / reinterpret_cast<PCHAR>(szUuid);
m_path = std::experimental::filesystem::temp_directory_path() / szUuid;
RpcStringFreeA(&szUuid);
return;
}
@ -37,5 +37,5 @@ TempDirectory::TempDirectory()
TempDirectory::~TempDirectory()
{
std::filesystem::remove_all(m_path);
std::experimental::filesystem::remove_all(m_path);
}

View File

@ -18,11 +18,11 @@ public:
~TempDirectory();
std::filesystem::path path() const
std::experimental::filesystem::path path() const
{
return m_path;
}
private:
std::filesystem::path m_path;
std::experimental::filesystem::path m_path;
};