From 5d4fedaeac71916d59110b3aab0054c8b0bb96b4 Mon Sep 17 00:00:00 2001 From: Pavel Krymets Date: Mon, 30 Jul 2018 14:37:33 -0700 Subject: [PATCH 1/8] Remove extra logic from file watcher (#1107) --- .../AspNetCore/applicationinfo.cpp | 5 +- .../CommonLib/application.h | 14 + .../InProcessApplicationBase.cpp | 21 +- .../InProcessApplicationBase.h | 1 - .../inprocessapplication.cpp | 16 +- .../inprocessapplication.h | 2 - .../outprocessapplication.cpp | 13 +- .../outprocessapplication.h | 1 - .../AppOfflineTrackingApplication.cpp | 31 +- .../AppOfflineTrackingApplication.h | 12 +- .../RequestHandlerLib/filewatcher.cpp | 364 +++++------------- .../RequestHandlerLib/filewatcher.h | 112 +----- .../IISApplication.cs | 4 +- .../Common.FunctionalTests/AppOfflineTests.cs | 7 +- 14 files changed, 180 insertions(+), 423 deletions(-) diff --git a/src/AspNetCoreModuleV2/AspNetCore/applicationinfo.cpp b/src/AspNetCoreModuleV2/AspNetCore/applicationinfo.cpp index a65af02467..307d669dbf 100644 --- a/src/AspNetCoreModuleV2/AspNetCore/applicationinfo.cpp +++ b/src/AspNetCoreModuleV2/AspNetCore/applicationinfo.cpp @@ -64,8 +64,9 @@ APPLICATION_INFO::GetOrCreateApplication( if (m_pApplication->QueryStatus() == RECYCLED) { LOG_INFO("Application went offline"); - // Application that went offline - // are supposed to recycle themselves + + // Call to wait for application to complete stopping + m_pApplication->Stop(/* fServerInitiated */ false); m_pApplication = nullptr; } else diff --git a/src/AspNetCoreModuleV2/CommonLib/application.h b/src/AspNetCoreModuleV2/CommonLib/application.h index 9761851002..1bc3d02f37 100644 --- a/src/AspNetCoreModuleV2/CommonLib/application.h +++ b/src/AspNetCoreModuleV2/CommonLib/application.h @@ -26,8 +26,19 @@ public: APPLICATION() : m_cRefs(1) { + InitializeSRWLock(&m_stateLock); } + + VOID + Stop(bool fServerInitiated) override + { + UNREFERENCED_PARAMETER(fServerInitiated); + + m_fStopCalled = true; + } + + VOID ReferenceApplication() override { @@ -49,6 +60,9 @@ public: protected: volatile APPLICATION_STATUS m_status = APPLICATION_STATUS::UNKNOWN; + SRWLOCK m_stateLock; + bool m_fStopCalled; + private: mutable LONG m_cRefs; diff --git a/src/AspNetCoreModuleV2/InProcessRequestHandler/InProcessApplicationBase.cpp b/src/AspNetCoreModuleV2/InProcessRequestHandler/InProcessApplicationBase.cpp index d271a3a30a..3152b75cca 100644 --- a/src/AspNetCoreModuleV2/InProcessRequestHandler/InProcessApplicationBase.cpp +++ b/src/AspNetCoreModuleV2/InProcessRequestHandler/InProcessApplicationBase.cpp @@ -2,7 +2,6 @@ // Licensed under the MIT License. See License.txt in the project root for license information. #include "InProcessApplicationBase.h" -#include "SRWExclusiveLock.h" hostfxr_main_fn InProcessApplicationBase::s_fMainCallback = NULL; @@ -11,32 +10,14 @@ InProcessApplicationBase::InProcessApplicationBase( IHttpApplication& pHttpApplication) : AppOfflineTrackingApplication(pHttpApplication), m_fRecycleCalled(FALSE), - m_srwLock(), m_pHttpServer(pHttpServer) { - InitializeSRWLock(&m_srwLock); } VOID InProcessApplicationBase::Stop(bool fServerInitiated) { - // We need to guarantee that recycle is only called once, as calling pHttpServer->RecycleProcess - // multiple times can lead to AVs. - if (m_fRecycleCalled) - { - return; - } - - { - SRWExclusiveLock lock(m_srwLock); - - if (m_fRecycleCalled) - { - return; - } - - m_fRecycleCalled = true; - } + AppOfflineTrackingApplication::Stop(fServerInitiated); // Stop was initiated by server no need to do anything, server would stop on it's own if (fServerInitiated) diff --git a/src/AspNetCoreModuleV2/InProcessRequestHandler/InProcessApplicationBase.h b/src/AspNetCoreModuleV2/InProcessRequestHandler/InProcessApplicationBase.h index c189095ffa..5df37d34b6 100644 --- a/src/AspNetCoreModuleV2/InProcessRequestHandler/InProcessApplicationBase.h +++ b/src/AspNetCoreModuleV2/InProcessRequestHandler/InProcessApplicationBase.h @@ -22,7 +22,6 @@ public: protected: BOOL m_fRecycleCalled; - SRWLOCK m_srwLock; IHttpServer& m_pHttpServer; // Allows to override call to hostfxr_main with custome callback // used in testing diff --git a/src/AspNetCoreModuleV2/InProcessRequestHandler/inprocessapplication.cpp b/src/AspNetCoreModuleV2/InProcessRequestHandler/inprocessapplication.cpp index 2cbcc4d6f3..575d9180e4 100644 --- a/src/AspNetCoreModuleV2/InProcessRequestHandler/inprocessapplication.cpp +++ b/src/AspNetCoreModuleV2/InProcessRequestHandler/inprocessapplication.cpp @@ -69,6 +69,16 @@ IN_PROCESS_APPLICATION::Stop(bool 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()) @@ -149,8 +159,6 @@ IN_PROCESS_APPLICATION::ShutDownInternal() } { - SRWExclusiveLock lock(m_srwLock); - if (m_fShutdownCalledFromNative || m_status == APPLICATION_STATUS::STARTING || m_status == APPLICATION_STATUS::FAIL) @@ -241,7 +249,7 @@ IN_PROCESS_APPLICATION::LoadManagedApplication HRESULT hr = S_OK; DWORD dwTimeout; DWORD dwResult; - + ReferenceApplication(); if (m_status != APPLICATION_STATUS::STARTING) @@ -263,7 +271,7 @@ IN_PROCESS_APPLICATION::LoadManagedApplication { // Set up stdout redirect - SRWExclusiveLock lock(m_srwLock); + SRWExclusiveLock lock(m_stateLock); if (m_pLoggerProvider == NULL) { diff --git a/src/AspNetCoreModuleV2/InProcessRequestHandler/inprocessapplication.h b/src/AspNetCoreModuleV2/InProcessRequestHandler/inprocessapplication.h index e23cf6b83a..a18d85a617 100644 --- a/src/AspNetCoreModuleV2/InProcessRequestHandler/inprocessapplication.h +++ b/src/AspNetCoreModuleV2/InProcessRequestHandler/inprocessapplication.h @@ -134,11 +134,9 @@ private: // The exit code of the .NET Core process INT m_ProcessExitCode; - BOOL m_fIsWebSocketsConnection; volatile BOOL m_fBlockCallbacksIntoManaged; volatile BOOL m_fShutdownCalledFromNative; volatile BOOL m_fShutdownCalledFromManaged; - BOOL m_fRecycleCalled; BOOL m_fInitialized; std::unique_ptr m_pConfig; diff --git a/src/AspNetCoreModuleV2/OutOfProcessRequestHandler/outprocessapplication.cpp b/src/AspNetCoreModuleV2/OutOfProcessRequestHandler/outprocessapplication.cpp index 5f5877edac..41835538a9 100644 --- a/src/AspNetCoreModuleV2/OutOfProcessRequestHandler/outprocessapplication.cpp +++ b/src/AspNetCoreModuleV2/OutOfProcessRequestHandler/outprocessapplication.cpp @@ -14,12 +14,11 @@ OUT_OF_PROCESS_APPLICATION::OUT_OF_PROCESS_APPLICATION( { m_status = APPLICATION_STATUS::RUNNING; m_pProcessManager = NULL; - InitializeSRWLock(&m_srwLock); } OUT_OF_PROCESS_APPLICATION::~OUT_OF_PROCESS_APPLICATION() { - SRWExclusiveLock lock(m_srwLock); + SRWExclusiveLock lock(m_stateLock); if (m_pProcessManager != NULL) { m_pProcessManager->Shutdown(); @@ -65,9 +64,15 @@ __override VOID OUT_OF_PROCESS_APPLICATION::Stop(bool fServerInitiated) { - UNREFERENCED_PARAMETER(fServerInitiated); + SRWExclusiveLock lock(m_stateLock); + + if (m_fStopCalled) + { + return; + } + + AppOfflineTrackingApplication::Stop(fServerInitiated); - SRWExclusiveLock lock(m_srwLock); if (m_pProcessManager != NULL) { m_pProcessManager->Shutdown(); diff --git a/src/AspNetCoreModuleV2/OutOfProcessRequestHandler/outprocessapplication.h b/src/AspNetCoreModuleV2/OutOfProcessRequestHandler/outprocessapplication.h index 1667069c09..6ac813f6a7 100644 --- a/src/AspNetCoreModuleV2/OutOfProcessRequestHandler/outprocessapplication.h +++ b/src/AspNetCoreModuleV2/OutOfProcessRequestHandler/outprocessapplication.h @@ -56,7 +56,6 @@ private: VOID SetWebsocketStatus(IHttpContext *pHttpContext); PROCESS_MANAGER * m_pProcessManager; - SRWLOCK m_srwLock; IHttpServer *m_pHttpServer; WEBSOCKET_STATUS m_fWebSocketSupported; diff --git a/src/AspNetCoreModuleV2/RequestHandlerLib/AppOfflineTrackingApplication.cpp b/src/AspNetCoreModuleV2/RequestHandlerLib/AppOfflineTrackingApplication.cpp index 17c004b693..ed465eb7c1 100644 --- a/src/AspNetCoreModuleV2/RequestHandlerLib/AppOfflineTrackingApplication.cpp +++ b/src/AspNetCoreModuleV2/RequestHandlerLib/AppOfflineTrackingApplication.cpp @@ -26,6 +26,19 @@ HRESULT AppOfflineTrackingApplication::StartMonitoringAppOffline() return hr; } +void AppOfflineTrackingApplication::Stop(bool fServerInitiated) +{ + APPLICATION::Stop(fServerInitiated); + + m_status = APPLICATION_STATUS::RECYCLED; + + if (m_fileWatcher) + { + m_fileWatcher->StopMonitor(); + m_fileWatcher = nullptr; + } +} + HRESULT AppOfflineTrackingApplication::StartMonitoringAppOflineImpl() { if (m_fileWatcher) @@ -34,25 +47,21 @@ HRESULT AppOfflineTrackingApplication::StartMonitoringAppOflineImpl() } m_fileWatcher = std::make_unique(); - RETURN_IF_FAILED(m_fileWatcher->Create()); - m_fileWatcherEntry.reset(new FILE_WATCHER_ENTRY(m_fileWatcher.get())); - // FileWatcherCompletionRoutine calls dereference so we need to get ourselves a reference count - m_fileWatcherEntry->ReferenceFileWatcherEntry(); - RETURN_IF_FAILED(m_fileWatcherEntry->Create( - m_applicationPath.c_str(), + RETURN_IF_FAILED(m_fileWatcher->Create(m_applicationPath.c_str(), L"app_offline.htm", - std::bind(&AppOfflineTrackingApplication::OnAppOffline, this), - NULL)); + this)); return S_OK; } void AppOfflineTrackingApplication::OnAppOffline() { + if (m_fAppOfflineProcessed.exchange(true)) + { + return; + } + LOG_INFOF("Received app_offline notification in application %S", m_applicationPath.c_str()); - m_fileWatcherEntry->StopMonitor(); - m_fileWatcherEntry.reset(nullptr); - m_status = APPLICATION_STATUS::RECYCLED; UTILITY::LogEventF(g_hEventLog, EVENTLOG_INFORMATION_TYPE, ASPNETCORE_EVENT_RECYCLE_APPOFFLINE, diff --git a/src/AspNetCoreModuleV2/RequestHandlerLib/AppOfflineTrackingApplication.h b/src/AspNetCoreModuleV2/RequestHandlerLib/AppOfflineTrackingApplication.h index 2b6c36ccfa..f104370c72 100644 --- a/src/AspNetCoreModuleV2/RequestHandlerLib/AppOfflineTrackingApplication.h +++ b/src/AspNetCoreModuleV2/RequestHandlerLib/AppOfflineTrackingApplication.h @@ -6,6 +6,7 @@ #include #include "application.h" #include "filewatcher.h" +#include class AppOfflineTrackingApplication: public APPLICATION { @@ -13,20 +14,23 @@ public: AppOfflineTrackingApplication(const IHttpApplication& application) : m_applicationPath(application.GetApplicationPhysicalPath()), m_fileWatcher(nullptr), - m_fileWatcherEntry(nullptr) + m_fAppOfflineProcessed(false) { } ~AppOfflineTrackingApplication() override { - if (m_fileWatcherEntry) + if (m_fileWatcher) { - m_fileWatcherEntry->StopMonitor(); + m_fileWatcher->StopMonitor(); } }; HRESULT StartMonitoringAppOffline(); + + VOID + Stop(bool fServerInitiated) override; virtual VOID @@ -38,5 +42,5 @@ private: std::wstring m_applicationPath; std::unique_ptr m_fileWatcher; - std::unique_ptr m_fileWatcherEntry; + std::atomic_bool m_fAppOfflineProcessed; }; diff --git a/src/AspNetCoreModuleV2/RequestHandlerLib/filewatcher.cpp b/src/AspNetCoreModuleV2/RequestHandlerLib/filewatcher.cpp index 721e248220..a4d7a0c57e 100644 --- a/src/AspNetCoreModuleV2/RequestHandlerLib/filewatcher.cpp +++ b/src/AspNetCoreModuleV2/RequestHandlerLib/filewatcher.cpp @@ -4,6 +4,7 @@ #include "stdafx.h" #include "filewatcher.h" #include "debugutil.h" +#include "AppOfflineTrackingApplication.h" FILE_WATCHER::FILE_WATCHER() : m_hCompletionPort(NULL), @@ -14,13 +15,13 @@ FILE_WATCHER::FILE_WATCHER() : FILE_WATCHER::~FILE_WATCHER() { + StopMonitor(); + if (m_hChangeNotificationThread != NULL) { DWORD dwRetryCounter = 20; // totally wait for 1s DWORD dwExitCode = STILL_ACTIVE; - // signal the file watch thread to exit - PostQueuedCompletionStatus(m_hCompletionPort, 0, FILE_WATCHER_SHUTDOWN_KEY, NULL); while (!m_fThreadExit && dwRetryCounter > 0) { if (GetExitCodeThread(m_hChangeNotificationThread, &dwExitCode)) @@ -45,55 +46,66 @@ FILE_WATCHER::~FILE_WATCHER() { TerminateThread(m_hChangeNotificationThread, 1); } - - CloseHandle(m_hChangeNotificationThread); - m_hChangeNotificationThread = NULL; - } - - if (NULL != m_hCompletionPort) - { - CloseHandle(m_hCompletionPort); - m_hCompletionPort = NULL; } } HRESULT FILE_WATCHER::Create( - VOID + _In_ PCWSTR pszDirectoryToMonitor, + _In_ PCWSTR pszFileNameToMonitor, + _In_ AppOfflineTrackingApplication *pApplication ) { - HRESULT hr = S_OK; - m_hCompletionPort = CreateIoCompletionPort(INVALID_HANDLE_VALUE, - NULL, - 0, - 0); + RETURN_LAST_ERROR_IF_NULL(m_hCompletionPort = CreateIoCompletionPort(INVALID_HANDLE_VALUE, NULL, 0, 0)); - if (m_hCompletionPort == NULL) - { - hr = HRESULT_FROM_WIN32(GetLastError()); - goto Finished; - } - - m_hChangeNotificationThread = CreateThread(NULL, + RETURN_LAST_ERROR_IF_NULL(m_hChangeNotificationThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)ChangeNotificationThread, this, 0, - NULL); + NULL)); - if (m_hChangeNotificationThread == NULL) + if (pszDirectoryToMonitor == NULL || + pszFileNameToMonitor == NULL || + pApplication == NULL) { - hr = HRESULT_FROM_WIN32(GetLastError()); - - CloseHandle(m_hCompletionPort); - m_hCompletionPort = NULL; - - goto Finished; + DBG_ASSERT(FALSE); + return HRESULT_FROM_WIN32(ERROR_INVALID_PARAMETER); } -Finished: - return hr; + _pApplication = ReferenceApplication(pApplication); + + RETURN_IF_FAILED(_strFileName.Copy(pszFileNameToMonitor)); + RETURN_IF_FAILED(_strDirectoryName.Copy(pszDirectoryToMonitor)); + RETURN_IF_FAILED(_strFullName.Append(_strDirectoryName)); + RETURN_IF_FAILED(_strFullName.Append(_strFileName)); + + // + // Resize change buffer to something "reasonable" + // + RETURN_LAST_ERROR_IF(!_buffDirectoryChanges.Resize(FILE_WATCHER_ENTRY_BUFFER_SIZE)); + + _hDirectory = CreateFileW( + _strDirectoryName.QueryStr(), + FILE_LIST_DIRECTORY, + FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, + NULL, + OPEN_EXISTING, + FILE_FLAG_BACKUP_SEMANTICS | FILE_FLAG_OVERLAPPED, + NULL); + + RETURN_LAST_ERROR_IF_NULL(_hDirectory); + + RETURN_LAST_ERROR_IF_NULL(CreateIoCompletionPort( + _hDirectory, + m_hCompletionPort, + NULL, + 0)); + + RETURN_IF_FAILED(Monitor()); + + return S_OK; } DWORD @@ -148,107 +160,29 @@ Win32 error DBG_ASSERT(pOverlapped != NULL); if (pOverlapped != NULL) { - FileWatcherCompletionRoutine( - dwErrorStatus, - cbCompletion, - pOverlapped); + pFileMonitor->HandleChangeCompletion(cbCompletion); + + if (!pFileMonitor->_lStopMonitorCalled) + { + // + // Continue monitoring + // + pFileMonitor->Monitor(); + } } pOverlapped = NULL; cbCompletion = 0; } pFileMonitor->m_fThreadExit = TRUE; - + LOG_INFO("Stopping file watcher thread"); ExitThread(0); } -VOID -WINAPI -FILE_WATCHER::FileWatcherCompletionRoutine( - DWORD dwCompletionStatus, - DWORD cbCompletion, - OVERLAPPED * pOverlapped -) -/*++ - -Routine Description: - -Called when ReadDirectoryChangesW() completes - -Arguments: - -dwCompletionStatus - Error of completion -cbCompletion - Bytes of completion -pOverlapped - State of completion - -Return Value: - -None - ---*/ -{ - FILE_WATCHER_ENTRY * pMonitorEntry; - pMonitorEntry = CONTAINING_RECORD(pOverlapped, FILE_WATCHER_ENTRY, _overlapped); - - DBG_ASSERT(pMonitorEntry != NULL); - - pMonitorEntry->HandleChangeCompletion(dwCompletionStatus, cbCompletion); - - if (pMonitorEntry->QueryIsValid()) - { - // - // Continue monitoring - // - pMonitorEntry->Monitor(); - } - // - // Deference the counter not matter whether the monitor is valid - // Valid: Monitor increases the counter, need to reduce one - // InValid: Reduce the counter to free the entry - // - pMonitorEntry->DereferenceFileWatcherEntry(); - -} - - -FILE_WATCHER_ENTRY::FILE_WATCHER_ENTRY(FILE_WATCHER * pFileMonitor) : - _pFileMonitor(pFileMonitor), - _hDirectory(INVALID_HANDLE_VALUE), - _hImpersonationToken(NULL), - _pCallback(), - _lStopMonitorCalled(0), - _cRefs(1), - _fIsValid(TRUE) -{ - _dwSignature = FILE_WATCHER_ENTRY_SIGNATURE; - InitializeSRWLock(&_srwLock); -} - -FILE_WATCHER_ENTRY::~FILE_WATCHER_ENTRY() -{ - DBG_ASSERT(_cRefs == 0); - - _dwSignature = FILE_WATCHER_ENTRY_SIGNATURE_FREE; - - if (_hDirectory != INVALID_HANDLE_VALUE) - { - CloseHandle(_hDirectory); - _hDirectory = INVALID_HANDLE_VALUE; - } - - if (_hImpersonationToken != NULL) - { - CloseHandle(_hImpersonationToken); - _hImpersonationToken = NULL; - } -} - -#pragma warning(disable:4100) HRESULT -FILE_WATCHER_ENTRY::HandleChangeCompletion( - _In_ DWORD dwCompletionStatus, +FILE_WATCHER::HandleChangeCompletion( _In_ DWORD cbCompletion ) /*++ @@ -269,16 +203,8 @@ HRESULT --*/ { - HRESULT hr = S_OK; - FILE_NOTIFY_INFORMATION * pNotificationInfo; BOOL fFileChanged = FALSE; - AcquireSRWLockExclusive(&_srwLock); - if (!_fIsValid) - { - goto Finished; - } - // When directory handle is closed then HandleChangeCompletion // happens with cbCompletion = 0 and dwCompletionStatus = 0 // From documentation it is not clear if that combination @@ -289,7 +215,7 @@ HRESULT // if (_lStopMonitorCalled) { - goto Finished; + return S_OK; } // @@ -303,7 +229,7 @@ HRESULT } else { - pNotificationInfo = (FILE_NOTIFY_INFORMATION*)_buffDirectoryChanges.QueryPtr(); + auto pNotificationInfo = (FILE_NOTIFY_INFORMATION*)_buffDirectoryChanges.QueryPtr(); DBG_ASSERT(pNotificationInfo != NULL); while (pNotificationInfo != NULL) @@ -334,55 +260,58 @@ HRESULT } } -Finished: - ReleaseSRWLockExclusive(&_srwLock); - - if (fFileChanged) + if (fFileChanged && !_lStopMonitorCalled) { - // - // so far we only monitoring app_offline - // - _pCallback(); + // Reference application before + _pApplication->ReferenceApplication(); + RETURN_LAST_ERROR_IF(!QueueUserWorkItem(RunNotificationCallback, _pApplication.get(), WT_EXECUTEDEFAULT)); } - return hr; + + return S_OK; } -#pragma warning( error : 4100 ) +DWORD +WINAPI +FILE_WATCHER::RunNotificationCallback( + LPVOID pvArg +) +{ + // Recapture application instance into unique_ptr + auto pApplication = std::unique_ptr(static_cast(pvArg)); + DBG_ASSERT(pFileMonitor != NULL); + pApplication->OnAppOffline(); + + return 0; +} HRESULT -FILE_WATCHER_ENTRY::Monitor(VOID) +FILE_WATCHER::Monitor(VOID) { HRESULT hr = S_OK; DWORD cbRead; - AcquireSRWLockExclusive(&_srwLock); - ReferenceFileWatcherEntry(); + ZeroMemory(&_overlapped, sizeof(_overlapped)); - if (!ReadDirectoryChangesW(_hDirectory, + RETURN_LAST_ERROR_IF(!ReadDirectoryChangesW(_hDirectory, _buffDirectoryChanges.QueryPtr(), _buffDirectoryChanges.QuerySize(), FALSE, // Watching sub dirs. Set to False now as only monitoring app_offline FILE_NOTIFY_VALID_MASK & ~FILE_NOTIFY_CHANGE_LAST_ACCESS, &cbRead, &_overlapped, - NULL)) - { - hr = HRESULT_FROM_WIN32(GetLastError()); - DereferenceFileWatcherEntry(); - } + NULL)); // Check if file exist because ReadDirectoryChangesW would not fire events for existing files if (GetFileAttributes(_strFullName.QueryStr()) != INVALID_FILE_ATTRIBUTES) { - PostQueuedCompletionStatus(_pFileMonitor->QueryCompletionPort(), 0, 0, &_overlapped); + PostQueuedCompletionStatus(m_hCompletionPort, 0, 0, &_overlapped); } - - ReleaseSRWLockExclusive(&_srwLock); + return hr; } VOID -FILE_WATCHER_ENTRY::StopMonitor(VOID) +FILE_WATCHER::StopMonitor() { // // Flag that monitoring is being stopped so that @@ -390,123 +319,8 @@ FILE_WATCHER_ENTRY::StopMonitor(VOID) // can be ignored // InterlockedExchange(&_lStopMonitorCalled, 1); - MarkEntryInValid(); - if (_hDirectory != INVALID_HANDLE_VALUE) - { - AcquireSRWLockExclusive(&_srwLock); - if (_hDirectory != INVALID_HANDLE_VALUE) - { - CloseHandle(_hDirectory); - _hDirectory = INVALID_HANDLE_VALUE; - DereferenceFileWatcherEntry(); - } - ReleaseSRWLockExclusive(&_srwLock); - } -} - -HRESULT -FILE_WATCHER_ENTRY::Create( - _In_ PCWSTR pszDirectoryToMonitor, - _In_ PCWSTR pszFileNameToMonitor, - _In_ std::function pCallback, - _In_ HANDLE hImpersonationToken -) -{ - HRESULT hr = S_OK; - BOOL fRet = FALSE; - - if (pszDirectoryToMonitor == NULL || - pszFileNameToMonitor == NULL || - pCallback == NULL) - { - DBG_ASSERT(FALSE); - hr = HRESULT_FROM_WIN32(ERROR_INVALID_PARAMETER); - goto Finished; - } - - _pCallback = pCallback; - - if (FAILED(hr = _strFileName.Copy(pszFileNameToMonitor))) - { - goto Finished; - } - - if (FAILED(hr = _strDirectoryName.Copy(pszDirectoryToMonitor))) - { - goto Finished; - } - - if (FAILED(hr = _strFullName.Append(_strDirectoryName)) || - FAILED(hr = _strFullName.Append(_strFileName))) - { - goto Finished; - } - - // - // Resize change buffer to something "reasonable" - // - if (!_buffDirectoryChanges.Resize(FILE_WATCHER_ENTRY_BUFFER_SIZE)) - { - hr = HRESULT_FROM_WIN32(ERROR_NOT_ENOUGH_MEMORY); - goto Finished; - } - - if (hImpersonationToken != NULL) - { - fRet = DuplicateHandle(GetCurrentProcess(), - hImpersonationToken, - GetCurrentProcess(), - &_hImpersonationToken, - 0, - FALSE, - DUPLICATE_SAME_ACCESS); - - if (!fRet) - { - hr = HRESULT_FROM_WIN32(GetLastError()); - goto Finished; - } - } - else - { - if (_hImpersonationToken != NULL) - { - CloseHandle(_hImpersonationToken); - _hImpersonationToken = NULL; - } - } - - _hDirectory = CreateFileW( - _strDirectoryName.QueryStr(), - FILE_LIST_DIRECTORY, - FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, - NULL, - OPEN_EXISTING, - FILE_FLAG_BACKUP_SEMANTICS | FILE_FLAG_OVERLAPPED, - NULL); - - if (_hDirectory == INVALID_HANDLE_VALUE) - { - hr = HRESULT_FROM_WIN32(GetLastError()); - goto Finished; - } - - if (CreateIoCompletionPort( - _hDirectory, - _pFileMonitor->QueryCompletionPort(), - NULL, - 0) == NULL) - { - hr = HRESULT_FROM_WIN32(GetLastError()); - goto Finished; - } - - // - // Start monitoring - // - hr = Monitor(); - -Finished: - - return hr; + // signal the file watch thread to exit + PostQueuedCompletionStatus(m_hCompletionPort, 0, FILE_WATCHER_SHUTDOWN_KEY, NULL); + // Release application reference + _pApplication.reset(nullptr); } diff --git a/src/AspNetCoreModuleV2/RequestHandlerLib/filewatcher.h b/src/AspNetCoreModuleV2/RequestHandlerLib/filewatcher.h index 4e37600c69..46ea744533 100644 --- a/src/AspNetCoreModuleV2/RequestHandlerLib/filewatcher.h +++ b/src/AspNetCoreModuleV2/RequestHandlerLib/filewatcher.h @@ -6,12 +6,14 @@ #include #include +#include "iapplication.h" +#include "HandleWrapper.h" #define FILE_WATCHER_SHUTDOWN_KEY (ULONG_PTR)(-1) #define FILE_WATCHER_ENTRY_BUFFER_SIZE 4096 #define FILE_NOTIFY_VALID_MASK 0x00000fff -#define FILE_WATCHER_ENTRY_SIGNATURE ((DWORD) 'FWES') -#define FILE_WATCHER_ENTRY_SIGNATURE_FREE ((DWORD) 'sewf') + +class AppOfflineTrackingApplication; class FILE_WATCHER{ public: @@ -20,110 +22,36 @@ public: ~FILE_WATCHER(); - HRESULT Create(); - - HANDLE - QueryCompletionPort( - VOID - ) const - { - return m_hCompletionPort; - } + HRESULT Create( + _In_ PCWSTR pszDirectoryToMonitor, + _In_ PCWSTR pszFileNameToMonitor, + _In_ AppOfflineTrackingApplication *pApplication + ); static DWORD WINAPI ChangeNotificationThread(LPVOID); static - void - WINAPI FileWatcherCompletionRoutine - ( - DWORD dwCompletionStatus, - DWORD cbCompletion, - OVERLAPPED * pOverlapped - ); + DWORD + WINAPI RunNotificationCallback(LPVOID); -private: - HANDLE m_hCompletionPort; - HANDLE m_hChangeNotificationThread; - volatile BOOL m_fThreadExit; -}; - -class FILE_WATCHER_ENTRY -{ -public: - FILE_WATCHER_ENTRY(FILE_WATCHER * pFileMonitor); - - OVERLAPPED _overlapped; - - HRESULT - Create( - _In_ PCWSTR pszDirectoryToMonitor, - _In_ PCWSTR pszFileNameToMonitor, - _In_ std::function pCallback, - _In_ HANDLE hImpersonationToken - ); - - VOID - ReferenceFileWatcherEntry() const - { - InterlockedIncrement(&_cRefs); - } - - VOID - DereferenceFileWatcherEntry() const - { - if (InterlockedDecrement(&_cRefs) == 0) - { - delete this; - } - } - - BOOL - QueryIsValid() const - { - return _fIsValid; - } - - VOID - MarkEntryInValid() - { - _fIsValid = FALSE; - } + HRESULT HandleChangeCompletion(DWORD cbCompletion); HRESULT Monitor(); - - VOID StopMonitor(); - - HRESULT - HandleChangeCompletion( - _In_ DWORD dwCompletionStatus, - _In_ DWORD cbCompletion - ); + void StopMonitor(); private: - virtual ~FILE_WATCHER_ENTRY(); + HandleWrapper m_hCompletionPort; + HandleWrapper m_hChangeNotificationThread; + HandleWrapper _hDirectory; + volatile BOOL m_fThreadExit; - DWORD _dwSignature; BUFFER _buffDirectoryChanges; - HANDLE _hImpersonationToken; - HANDLE _hDirectory; - FILE_WATCHER* _pFileMonitor; STRU _strFileName; STRU _strDirectoryName; STRU _strFullName; - LONG _lStopMonitorCalled; - mutable LONG _cRefs; - BOOL _fIsValid; - SRWLOCK _srwLock; - std::function _pCallback; -}; - - -struct FILE_WATCHER_ENTRY_DELETER -{ - void operator()(FILE_WATCHER_ENTRY* entry) const - { - entry->DereferenceFileWatcherEntry(); - } + LONG _lStopMonitorCalled {}; + OVERLAPPED _overlapped; + std::unique_ptr _pApplication; }; diff --git a/src/Microsoft.AspNetCore.Server.IntegrationTesting.IIS/IISApplication.cs b/src/Microsoft.AspNetCore.Server.IntegrationTesting.IIS/IISApplication.cs index ce1f3e426e..aa35ac92da 100644 --- a/src/Microsoft.AspNetCore.Server.IntegrationTesting.IIS/IISApplication.cs +++ b/src/Microsoft.AspNetCore.Server.IntegrationTesting.IIS/IISApplication.cs @@ -18,6 +18,8 @@ namespace Microsoft.AspNetCore.Server.IntegrationTesting /// internal class IISApplication { + internal const int ERROR_OBJECT_NOT_FOUND = unchecked((int)0x800710D8); + private static readonly TimeSpan _timeout = TimeSpan.FromSeconds(10); private static readonly TimeSpan _retryDelay = TimeSpan.FromMilliseconds(200); private readonly ServerManager _serverManager = new ServerManager(); @@ -106,7 +108,7 @@ namespace Microsoft.AspNetCore.Server.IntegrationTesting _logger.LogInformation($"Tried to start site, state: {state.ToString()}"); } } - catch (Exception ex) when (ex is DllNotFoundException || (ex is COMException && (uint)ex.HResult == 0x800710D8) ) + catch (Exception ex) when (ex is DllNotFoundException || (ex is COMException && ex.HResult == ERROR_OBJECT_NOT_FOUND) ) { // Accessing the site.State property while the site // is starting up returns the COMException diff --git a/test/Common.FunctionalTests/AppOfflineTests.cs b/test/Common.FunctionalTests/AppOfflineTests.cs index b2c30663a9..169be93035 100644 --- a/test/Common.FunctionalTests/AppOfflineTests.cs +++ b/test/Common.FunctionalTests/AppOfflineTests.cs @@ -77,7 +77,6 @@ namespace Microsoft.AspNetCore.Server.IIS.FunctionalTests.Inprocess for (int i = 0; i < 10; i++) { - // send first request and add app_offline while app is starting var runningTask = AssertAppOffline(deploymentResult); @@ -220,14 +219,10 @@ namespace Microsoft.AspNetCore.Server.IIS.FunctionalTests.Inprocess { HttpResponseMessage response = null; - for (var i = 0; i < 5; i++) + for (var i = 0; i < 5 && response?.StatusCode != HttpStatusCode.ServiceUnavailable; i++) { // Keep retrying until app_offline is present. response = await deploymentResult.HttpClient.GetAsync("HelloWorld"); - if (!response.IsSuccessStatusCode) - { - break; - } } Assert.Equal(HttpStatusCode.ServiceUnavailable, response.StatusCode); From 652c529f8f0baa2c4504c377bf0d17a1c7ca69cf Mon Sep 17 00:00:00 2001 From: Pavel Krymets Date: Mon, 30 Jul 2018 14:52:04 -0700 Subject: [PATCH 2/8] Fix ServerShutsDownWhenMainExits test (#1120) --- .../InProcess/ShutdownTests.cs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/test/IISExpress.FunctionalTests/InProcess/ShutdownTests.cs b/test/IISExpress.FunctionalTests/InProcess/ShutdownTests.cs index b1ab071c5d..45c9e080aa 100644 --- a/test/IISExpress.FunctionalTests/InProcess/ShutdownTests.cs +++ b/test/IISExpress.FunctionalTests/InProcess/ShutdownTests.cs @@ -1,6 +1,9 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +using System; +using System.IO; +using System.Net.Http; using System.Threading.Tasks; using Microsoft.AspNetCore.Server.IIS.FunctionalTests.Utilities; using Microsoft.AspNetCore.Server.IntegrationTesting; @@ -22,8 +25,14 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests { var parameters = Helpers.GetBaseDeploymentParameters(publish: true); var result = await DeployAsync(parameters); - - var response = await result.RetryingHttpClient.GetAsync("/Shutdown"); + try + { + await result.HttpClient.GetAsync("/Shutdown"); + } + catch (HttpRequestException ex) when (ex.InnerException is IOException) + { + // Server might close a connection before request completes + } Assert.True(result.HostShutdownToken.WaitHandle.WaitOne(TimeoutExtensions.DefaultTimeout)); } From d99d2d881c464879f7e7a4dcf8282c0215d31a79 Mon Sep 17 00:00:00 2001 From: Pavel Krymets Date: Tue, 31 Jul 2018 16:35:34 -0700 Subject: [PATCH 3/8] Fix HTTPS certs on VSTS (#1123) --- .vsts-pipelines/templates/build-steps.yml | 8 ++------ .../OutOfProcess/HttpsTest.cs | 1 - tools/UpdateIISExpressCertificate.ps1 | 20 +++++++++++++++++++ 3 files changed, 22 insertions(+), 7 deletions(-) create mode 100644 tools/UpdateIISExpressCertificate.ps1 diff --git a/.vsts-pipelines/templates/build-steps.yml b/.vsts-pipelines/templates/build-steps.yml index 33d1e65180..949093b338 100644 --- a/.vsts-pipelines/templates/build-steps.yml +++ b/.vsts-pipelines/templates/build-steps.yml @@ -3,12 +3,8 @@ phases: parameters: agentOs: Windows beforeBuild: - - powershell: "git submodule update --init" - displayName: Update submodules - - powershell: "& ./tools/update_schema.ps1" - displayName: Update ANCM schema - - powershell: Restart-Service w3svc - displayName: Restart IIS + - powershell: "& ./tools/UpdateIISExpressCertificate.ps1; & ./tools/update_schema.ps1; Restart-Service w3svc" + displayName: Prepare repo - template: .vsts-pipelines/templates/phases/default-build.yml@buildtools parameters: diff --git a/test/IISExpress.FunctionalTests/OutOfProcess/HttpsTest.cs b/test/IISExpress.FunctionalTests/OutOfProcess/HttpsTest.cs index 4f0c93b400..ff9996c851 100644 --- a/test/IISExpress.FunctionalTests/OutOfProcess/HttpsTest.cs +++ b/test/IISExpress.FunctionalTests/OutOfProcess/HttpsTest.cs @@ -18,7 +18,6 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests // So these tests always have to use ports in this range, and we can't rely on OS-allocated ports without a whole lot of ceremony around // creating self-signed certificates and registering SSL bindings with HTTP.sys // Test specific to IISExpress - [SkipInVSTS] public class HttpsTest : IISFunctionalTestBase { public HttpsTest(ITestOutputHelper output) : base(output) diff --git a/tools/UpdateIISExpressCertificate.ps1 b/tools/UpdateIISExpressCertificate.ps1 new file mode 100644 index 0000000000..9034cf8f75 --- /dev/null +++ b/tools/UpdateIISExpressCertificate.ps1 @@ -0,0 +1,20 @@ +$cert = New-SelfSignedCertificate -DnsName "localhost", "localhost" -CertStoreLocation "cert:\LocalMachine\My" -NotAfter (Get-Date).AddYears(5) +$thumb = $cert.GetCertHashString() + +$Store = New-Object -TypeName System.Security.Cryptography.X509Certificates.X509Store -ArgumentList 'root', 'LocalMachine' +$Store.Open([System.Security.Cryptography.X509Certificates.OpenFlags]::ReadWrite) +$Store.Add($cert) +$Store.Close() + +$tempFile = [System.IO.Path]::GetTempFileName(); +$content = ""; + +for ($i=44300; $i -le 44399; $i++) { + $content += "http delete sslcert ipport=0.0.0.0:$i`n"; + $content += "http add sslcert ipport=0.0.0.0:$i certhash=$thumb appid=`{214124cd-d05b-4309-9af9-9caa44b2b74a`}`n"; +} + +[IO.File]::WriteAllLines($tempFile, $content) + +netsh -f $tempFile +Remove-Item $tempFile; \ No newline at end of file From ff0a5bbbdf6898cd650fbdb6c8aab2fb64bbc87f Mon Sep 17 00:00:00 2001 From: Mike Harder Date: Tue, 31 Jul 2018 19:21:32 -0700 Subject: [PATCH 4/8] Update resources.h (#1134) --- src/AspNetCoreModuleV2/CommonLib/resources.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/AspNetCoreModuleV2/CommonLib/resources.h b/src/AspNetCoreModuleV2/CommonLib/resources.h index ae26e9777f..b1e8264941 100644 --- a/src/AspNetCoreModuleV2/CommonLib/resources.h +++ b/src/AspNetCoreModuleV2/CommonLib/resources.h @@ -15,7 +15,7 @@ #define ASPNETCORE_EVENT_PROCESS_START_SUCCESS_MSG L"Application '%s' started process '%d' successfully and process '%d' is listening on port '%d'." #define ASPNETCORE_EVENT_RAPID_FAIL_COUNT_EXCEEDED_MSG L"Maximum rapid fail count per minute of '%d' exceeded." #define ASPNETCORE_EVENT_PROCESS_START_ERROR_MSG L"Application '%s' with physical root '%s' failed to start process with commandline '%s' at stage '%s', ErrorCode = '0x%x', assigned port %d, retryCounter '%d'." -#define ASPNETCORE_EVENT_PROCESS_START_FAILURE_MSG L"Application '%s' with physical root '%s' failed to start process with commandline '%s' with multiple retries. The last try of listening port is '%d'. See pervious warnings for details." +#define ASPNETCORE_EVENT_PROCESS_START_FAILURE_MSG L"Application '%s' with physical root '%s' failed to start process with commandline '%s' with multiple retries. The last try of listening port is '%d'. See previous warnings for details." #define ASPNETCORE_EVENT_PROCESS_START_STATUS_ERROR_MSG L"Application '%s' with physical root '%s' failed to start process with commandline '%s' , ErrorCode = '0x%x', processId '%d', processStatus '%d'." #define ASPNETCORE_EVENT_PROCESS_START_PORTSETUP_ERROR_MSG L"Application '%s' with physical root '%s' failed to choose listen port '%d' given port rang '%d - %d', EorrorCode = '0x%x'. If environment variable 'ASPNETCORE_PORT' was set, try removing it such that a random port is selected instead." #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'" From 4b5a32d3b95299445163137b3443fb8f89389e27 Mon Sep 17 00:00:00 2001 From: Pavel Krymets Date: Tue, 31 Jul 2018 19:32:48 -0700 Subject: [PATCH 5/8] Use TestApplication (#1118) --- build/dependencies.props | 52 +++++++------- build/testsite.props | 3 +- .../Common.FunctionalTests/AppOfflineTests.cs | 16 +++-- .../Inprocess/EventLogTests.cs | 12 +++- .../Inprocess/LoggingTests.cs | 20 ++++-- .../Inprocess/StartupExceptionTests.cs | 14 +++- .../OutOfProcess/HelloWorldTest.cs | 14 ++-- .../PublishedSitesFixture.cs | 70 +++++++++++++++++++ .../Utilities/FunctionalTestsBase.cs | 5 ++ .../Utilities/Helpers.cs | 19 +---- .../InProcess/AuthenticationTests.cs | 9 ++- .../InProcess/ShutdownTests.cs | 12 ++-- .../InProcess/StartupTests.cs | 36 +++------- .../OutOfProcess/GlobalVersionTests.cs | 44 +++++++----- .../OutOfProcess/HttpsTest.cs | 22 +++--- .../OutOfProcess/NtlmAuthentationTest.cs | 14 ++-- .../OutOfProcess/WindowsAuthTests.cs | 11 +-- .../UpgradeFeatureDetectionTests.cs | 15 ++-- 18 files changed, 236 insertions(+), 152 deletions(-) create mode 100644 test/Common.FunctionalTests/PublishedSitesFixture.cs diff --git a/build/dependencies.props b/build/dependencies.props index fe40c919f6..a181793011 100644 --- a/build/dependencies.props +++ b/build/dependencies.props @@ -4,38 +4,38 @@ 0.10.13 - 2.2.0-preview1-17102 - 2.2.0-preview1-34823 - 2.2.0-preview1-34823 - 2.2.0-preview1-34823 - 2.2.0-preview1-34823 - 2.2.0-preview1-34823 - 2.2.0-preview1-34823 - 2.2.0-preview1-34823 - 2.2.0-preview1-34823 - 2.2.0-preview1-34823 - 0.6.0-preview1-34823 - 2.2.0-preview1-34823 - 2.2.0-preview1-34823 - 2.2.0-preview1-34823 - 2.2.0-preview1-34823 + 2.2.0-preview1-17099 + 2.2.0-preview1-34825 + 2.2.0-preview1-34825 + 2.2.0-preview1-34825 + 2.2.0-preview1-34825 + 2.2.0-preview1-34825 + 2.2.0-preview1-34825 + 2.2.0-preview1-34825 + 2.2.0-preview1-34825 + 2.2.0-preview1-34825 + 0.6.0-a-preview1-test-application-17108 + 2.2.0-preview1-34825 + 2.2.0-preview1-34825 + 2.2.0-preview1-34825 + 2.2.0-preview1-34825 15.6.82 15.6.82 - 2.2.0-preview1-34823 - 2.2.0-preview1-34823 - 2.2.0-preview1-34823 - 2.2.0-preview1-34823 - 2.2.0-preview1-34823 - 2.2.0-preview1-34823 - 2.2.0-preview1-34823 - 2.2.0-preview1-34823 - 2.2.0-preview1-34823 - 2.2.0-preview1-34823 + 2.2.0-preview1-34825 + 2.2.0-preview1-34825 + 2.2.0-preview1-34825 + 2.2.0-preview1-34825 + 2.2.0-preview1-34825 + 2.2.0-preview1-34825 + 2.2.0-preview1-34825 + 2.2.0-preview1-34825 + 2.2.0-preview1-34825 + 2.2.0-preview1-34825 2.0.9 2.1.2 2.2.0-preview1-26618-02 1.0.1 - 2.2.0-preview1-34823 + 2.2.0-preview1-34825 15.6.1 11.1.0 2.0.3 diff --git a/build/testsite.props b/build/testsite.props index ab74d58d72..3f84d67f31 100644 --- a/build/testsite.props +++ b/build/testsite.props @@ -7,6 +7,7 @@ $(MSBuildThisFileDirectory)applicationhost.iis.config x64 $(Platform) + false @@ -51,7 +52,7 @@ - + diff --git a/test/Common.FunctionalTests/AppOfflineTests.cs b/test/Common.FunctionalTests/AppOfflineTests.cs index 169be93035..d8d0861d3a 100644 --- a/test/Common.FunctionalTests/AppOfflineTests.cs +++ b/test/Common.FunctionalTests/AppOfflineTests.cs @@ -14,10 +14,18 @@ using Microsoft.Extensions.Logging; using Xunit; using Microsoft.AspNetCore.Server.IntegrationTesting.IIS; -namespace Microsoft.AspNetCore.Server.IIS.FunctionalTests.Inprocess +namespace Microsoft.AspNetCore.Server.IIS.FunctionalTests { + [Collection(PublishedSitesCollection.Name)] public class AppOfflineTests : IISFunctionalTestBase { + private readonly PublishedSitesFixture _fixture; + + public AppOfflineTests(PublishedSitesFixture fixture) + { + _fixture = fixture; + } + [ConditionalTheory] [InlineData(HostingModel.InProcess)] [InlineData(HostingModel.OutOfProcess)] @@ -36,8 +44,7 @@ namespace Microsoft.AspNetCore.Server.IIS.FunctionalTests.Inprocess [InlineData(HostingModel.OutOfProcess, 502, "502.5")] public async Task AppOfflineDroppedWhileSiteFailedToStartInShim_AppOfflineServed(HostingModel hostingModel, int statusCode, string content) { - - var deploymentParameters = Helpers.GetBaseDeploymentParameters(hostingModel: hostingModel, publish: true); + var deploymentParameters = _fixture.GetBaseDeploymentParameters(hostingModel: hostingModel, publish: true); deploymentParameters.WebConfigActionList.Add(WebConfigHelpers.AddOrModifyAspNetCoreSection("processPath", "nonexistent")); var deploymentResult = await DeployAsync(deploymentParameters); @@ -193,10 +200,9 @@ namespace Microsoft.AspNetCore.Server.IIS.FunctionalTests.Inprocess } } - private async Task DeployApp(HostingModel hostingModel = HostingModel.InProcess) { - var deploymentParameters = Helpers.GetBaseDeploymentParameters(hostingModel: hostingModel, publish: true); + var deploymentParameters = _fixture.GetBaseDeploymentParameters(hostingModel: hostingModel, publish: true); return await DeployAsync(deploymentParameters); } diff --git a/test/Common.FunctionalTests/Inprocess/EventLogTests.cs b/test/Common.FunctionalTests/Inprocess/EventLogTests.cs index a2476cea1b..d8353181d3 100644 --- a/test/Common.FunctionalTests/Inprocess/EventLogTests.cs +++ b/test/Common.FunctionalTests/Inprocess/EventLogTests.cs @@ -9,12 +9,20 @@ using Xunit; namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests { + [Collection(PublishedSitesCollection.Name)] public class EventLogTests : IISFunctionalTestBase { + private readonly PublishedSitesFixture _fixture; + + public EventLogTests(PublishedSitesFixture fixture) + { + _fixture = fixture; + } + [ConditionalFact] public async Task CheckStartupEventLogMessage() { - var deploymentParameters = Helpers.GetBaseDeploymentParameters(publish: true); + var deploymentParameters = _fixture.GetBaseDeploymentParameters(publish: true); var deploymentResult = await DeployAsync(deploymentParameters); await Helpers.AssertStarts(deploymentResult); @@ -26,7 +34,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests [ConditionalFact] public async Task CheckShutdownEventLogMessage() { - var deploymentParameters = Helpers.GetBaseDeploymentParameters(publish: true); + var deploymentParameters = _fixture.GetBaseDeploymentParameters(publish: true); deploymentParameters.GracefulShutdown = true; var deploymentResult = await DeployAsync(deploymentParameters); await Helpers.AssertStarts(deploymentResult); diff --git a/test/Common.FunctionalTests/Inprocess/LoggingTests.cs b/test/Common.FunctionalTests/Inprocess/LoggingTests.cs index 15e9c8c1d9..0ff23a392f 100644 --- a/test/Common.FunctionalTests/Inprocess/LoggingTests.cs +++ b/test/Common.FunctionalTests/Inprocess/LoggingTests.cs @@ -14,14 +14,22 @@ using Xunit; namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests { + [Collection(PublishedSitesCollection.Name)] public class LoggingTests : IISFunctionalTestBase { + private readonly PublishedSitesFixture _fixture; + + public LoggingTests(PublishedSitesFixture fixture) + { + _fixture = fixture; + } + [ConditionalTheory] [InlineData("CheckErrLogFile")] [InlineData("CheckLogFile")] public async Task CheckStdoutLoggingToFile(string path) { - var deploymentParameters = Helpers.GetBaseDeploymentParameters(publish: true); + var deploymentParameters = _fixture.GetBaseDeploymentParameters(publish: true); deploymentParameters.WebConfigActionList.Add( WebConfigHelpers.AddOrModifyAspNetCoreSection("stdoutLogEnabled", "true")); @@ -63,7 +71,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests [ConditionalFact] public async Task InvalidFilePathForLogs_ServerStillRuns() { - var deploymentParameters = Helpers.GetBaseDeploymentParameters(publish: true); + var deploymentParameters = _fixture.GetBaseDeploymentParameters(publish: true); deploymentParameters.WebConfigActionList.Add( WebConfigHelpers.AddOrModifyAspNetCoreSection("stdoutLogEnabled", "true")); @@ -82,7 +90,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests var tempFile = Path.GetTempFileName(); try { - var deploymentParameters = Helpers.GetBaseDeploymentParameters(publish: true); + var deploymentParameters = _fixture.GetBaseDeploymentParameters(publish: true); deploymentParameters.EnvironmentVariables["ASPNETCORE_MODULE_DEBUG_FILE"] = tempFile; deploymentParameters.AddDebugLogToWebConfig(tempFile); @@ -107,7 +115,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests [InlineData("CheckLogFile")] public async Task CheckStdoutLoggingToPipe_DoesNotCrashProcess(string path) { - var deploymentParameters = Helpers.GetBaseDeploymentParameters(publish: true); + var deploymentParameters = _fixture.GetBaseDeploymentParameters(publish: true); deploymentParameters.GracefulShutdown = true; var deploymentResult = await DeployAsync(deploymentParameters); @@ -126,7 +134,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests [InlineData("CheckLogFile")] public async Task CheckStdoutLoggingToPipeWithFirstWrite(string path) { - var deploymentParameters = Helpers.GetBaseDeploymentParameters(publish: true); + var deploymentParameters = _fixture.GetBaseDeploymentParameters(publish: true); deploymentParameters.GracefulShutdown = true; var firstWriteString = path + path; @@ -156,7 +164,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests try { - var deploymentParameters = Helpers.GetBaseDeploymentParameters(publish: true); + var deploymentParameters = _fixture.GetBaseDeploymentParameters(publish: true); deploymentParameters.EnvironmentVariables["ASPNETCORE_MODULE_DEBUG_FILE"] = firstTempFile; deploymentParameters.AddDebugLogToWebConfig(secondTempFile); diff --git a/test/Common.FunctionalTests/Inprocess/StartupExceptionTests.cs b/test/Common.FunctionalTests/Inprocess/StartupExceptionTests.cs index 93683b8a78..980341dbc4 100644 --- a/test/Common.FunctionalTests/Inprocess/StartupExceptionTests.cs +++ b/test/Common.FunctionalTests/Inprocess/StartupExceptionTests.cs @@ -10,8 +10,16 @@ using Xunit; namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests { + [Collection(PublishedSitesCollection.Name)] public class StartupExceptionTests : IISFunctionalTestBase { + private readonly PublishedSitesFixture _fixture; + + public StartupExceptionTests(PublishedSitesFixture fixture) + { + _fixture = fixture; + } + [ConditionalTheory] [InlineData("CheckLogFile")] [InlineData("CheckErrLogFile")] @@ -21,7 +29,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests // Reason is because by default for IISExpress, we expect there to not be a web.config file. // However, for IIS, we need a web.config file because the default on generated on publish // doesn't include V2. We can remove the publish flag once IIS supports non-publish running - var deploymentParameters = Helpers.GetBaseDeploymentParameters("StartupExceptionWebsite", publish: true); + var deploymentParameters = _fixture.GetBaseDeploymentParameters(_fixture.StartupExceptionWebsite, publish: true); var randomNumberString = new Random(Guid.NewGuid().GetHashCode()).Next(10000000).ToString(); deploymentParameters.WebConfigBasedEnvironmentVariables["ASPNETCORE_INPROCESS_STARTUP_VALUE"] = path; @@ -45,7 +53,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests [InlineData("CheckOversizedStdOutWrites")] public async Task CheckStdoutWithLargeWrites(string path) { - var deploymentParameters = Helpers.GetBaseDeploymentParameters("StartupExceptionWebsite", publish: true); + var deploymentParameters = _fixture.GetBaseDeploymentParameters(_fixture.StartupExceptionWebsite, publish: true); deploymentParameters.WebConfigBasedEnvironmentVariables["ASPNETCORE_INPROCESS_STARTUP_VALUE"] = path; var deploymentResult = await DeployAsync(deploymentParameters); @@ -62,7 +70,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests [ConditionalFact] public async Task Gets500_30_ErrorPage() { - var deploymentParameters = Helpers.GetBaseDeploymentParameters("StartupExceptionWebsite", publish: true); + var deploymentParameters = _fixture.GetBaseDeploymentParameters(_fixture.StartupExceptionWebsite, publish: true); var deploymentResult = await DeployAsync(deploymentParameters); diff --git a/test/Common.FunctionalTests/OutOfProcess/HelloWorldTest.cs b/test/Common.FunctionalTests/OutOfProcess/HelloWorldTest.cs index e868207bb8..d2a56caea5 100644 --- a/test/Common.FunctionalTests/OutOfProcess/HelloWorldTest.cs +++ b/test/Common.FunctionalTests/OutOfProcess/HelloWorldTest.cs @@ -2,21 +2,22 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; -using System.IO; using System.Threading.Tasks; using Microsoft.AspNetCore.Server.IIS.FunctionalTests.Utilities; using Microsoft.AspNetCore.Server.IntegrationTesting; -using Microsoft.AspNetCore.Server.IntegrationTesting.IIS; using Microsoft.AspNetCore.Testing.xunit; using Xunit; -using Xunit.Abstractions; namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests { + [Collection(PublishedSitesCollection.Name)] public class HelloWorldTests : IISFunctionalTestBase { - public HelloWorldTests(ITestOutputHelper output = null) : base(output) + private readonly PublishedSitesFixture _fixture; + + public HelloWorldTests(PublishedSitesFixture fixture) { + _fixture = fixture; } public static TestMatrix TestVariants @@ -31,10 +32,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests { // The default in hosting sets windows auth to true. // Set it to the IISExpress.config file - var deploymentParameters = new IISDeploymentParameters(variant) - { - ApplicationPath = Helpers.GetOutOfProcessTestSitesPath() - }; + var deploymentParameters = _fixture.GetBaseDeploymentParameters(variant); var deploymentResult = await DeployAsync(deploymentParameters); diff --git a/test/Common.FunctionalTests/PublishedSitesFixture.cs b/test/Common.FunctionalTests/PublishedSitesFixture.cs new file mode 100644 index 0000000000..90104f6652 --- /dev/null +++ b/test/Common.FunctionalTests/PublishedSitesFixture.cs @@ -0,0 +1,70 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +using System; +using Microsoft.AspNetCore.Server.IntegrationTesting; +using Microsoft.AspNetCore.Server.IntegrationTesting.IIS; +using Xunit; + +namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests +{ + /// + /// This type just maps collection names to available fixtures + /// + [CollectionDefinition(Name)] + public class PublishedSitesCollection : ICollectionFixture + { + public const string Name = nameof(PublishedSitesCollection); + } + + public class PublishedSitesFixture : IDisposable + { + public CachingApplicationPublisher InProcessTestSite { get; } = new CachingApplicationPublisher(Helpers.GetInProcessTestSitesPath()); + public CachingApplicationPublisher OutOfProcessTestSite { get; } = new CachingApplicationPublisher(Helpers.GetOutOfProcessTestSitesPath()); + public CachingApplicationPublisher StartupExceptionWebsite { get; } = new CachingApplicationPublisher(Helpers.GetTestWebSitePath("StartupExceptionWebsite")); + public CachingApplicationPublisher OverriddenServerWebSite { get; } = new CachingApplicationPublisher(Helpers.GetTestWebSitePath("OverriddenServerWebSite")); + + public void Dispose() + { + InProcessTestSite.Dispose(); + OutOfProcessTestSite.Dispose(); + StartupExceptionWebsite.Dispose(); + OverriddenServerWebSite.Dispose(); + } + + public IISDeploymentParameters GetBaseDeploymentParameters(HostingModel hostingModel = HostingModel.InProcess, bool publish = false) + { + var publisher = hostingModel == HostingModel.InProcess ? InProcessTestSite : OutOfProcessTestSite; + return GetBaseDeploymentParameters(publisher, hostingModel, publish); + } + public IISDeploymentParameters GetBaseDeploymentParameters(TestVariant variant, bool publish = false) + { + var publisher = variant.HostingModel == HostingModel.InProcess ? InProcessTestSite : OutOfProcessTestSite; + return GetBaseDeploymentParameters(publisher, new DeploymentParameters(variant), publish); + } + + public IISDeploymentParameters GetBaseDeploymentParameters(ApplicationPublisher publisher, HostingModel hostingModel = HostingModel.InProcess, bool publish = false) + { + return GetBaseDeploymentParameters( + publisher, + new DeploymentParameters(publisher.ApplicationPath, DeployerSelector.ServerType, RuntimeFlavor.CoreClr, RuntimeArchitecture.x64) + { + HostingModel = hostingModel + }, + publish); + } + + public IISDeploymentParameters GetBaseDeploymentParameters(ApplicationPublisher publisher, DeploymentParameters baseParameters, bool publish = false) + { + return new IISDeploymentParameters(baseParameters) + { + ApplicationPublisher = publisher, + ApplicationPath = publisher.ApplicationPath, + TargetFramework = Tfm.NetCoreApp22, + ApplicationType = ApplicationType.Portable, + AncmVersion = AncmVersion.AspNetCoreModuleV2, + PublishApplicationBeforeDeployment = publish, + }; + } + } +} diff --git a/test/Common.FunctionalTests/Utilities/FunctionalTestsBase.cs b/test/Common.FunctionalTests/Utilities/FunctionalTestsBase.cs index d23b7836e5..171bbbf22f 100644 --- a/test/Common.FunctionalTests/Utilities/FunctionalTestsBase.cs +++ b/test/Common.FunctionalTests/Utilities/FunctionalTestsBase.cs @@ -1,6 +1,7 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +using System; using System.IO; using System.Threading.Tasks; using Microsoft.AspNetCore.Server.IntegrationTesting.IIS; @@ -31,6 +32,10 @@ namespace Microsoft.AspNetCore.Server.IntegrationTesting parameters.ServerConfigTemplateContent = parameters.ServerConfigTemplateContent ?? File.ReadAllText("IISExpress.config"); } + if (parameters.ApplicationPublisher == null) + { + throw new InvalidOperationException("All tests should use ApplicationPublisher"); + } _deployer = IISApplicationDeployerFactory.Create(parameters, LoggerFactory); diff --git a/test/Common.FunctionalTests/Utilities/Helpers.cs b/test/Common.FunctionalTests/Utilities/Helpers.cs index c067ff46e6..77eb37d524 100644 --- a/test/Common.FunctionalTests/Utilities/Helpers.cs +++ b/test/Common.FunctionalTests/Utilities/Helpers.cs @@ -25,24 +25,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests public static string GetInProcessTestSitesPath() => GetTestWebSitePath("InProcessWebSite"); public static string GetOutOfProcessTestSitesPath() => GetTestWebSitePath("OutOfProcessWebSite"); - - // Defaults to inprocess specific deployment parameters - public static IISDeploymentParameters GetBaseDeploymentParameters(string site = null, HostingModel hostingModel = HostingModel.InProcess, bool publish = false) - { - if (site == null) - { - site = hostingModel == HostingModel.InProcess ? "InProcessWebSite" : "OutOfProcessWebSite"; - } - - return new IISDeploymentParameters(GetTestWebSitePath(site), DeployerSelector.ServerType, RuntimeFlavor.CoreClr, RuntimeArchitecture.x64) - { - TargetFramework = Tfm.NetCoreApp22, - ApplicationType = ApplicationType.Portable, - AncmVersion = AncmVersion.AspNetCoreModuleV2, - HostingModel = hostingModel, - PublishApplicationBeforeDeployment = publish, - }; - } + public static async Task AssertStarts(IISDeploymentResult deploymentResult, string path = "/HelloWorld") { diff --git a/test/IISExpress.FunctionalTests/InProcess/AuthenticationTests.cs b/test/IISExpress.FunctionalTests/InProcess/AuthenticationTests.cs index 5105b753c8..af442c4521 100644 --- a/test/IISExpress.FunctionalTests/InProcess/AuthenticationTests.cs +++ b/test/IISExpress.FunctionalTests/InProcess/AuthenticationTests.cs @@ -11,13 +11,20 @@ using Xunit; namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests { + [Collection(PublishedSitesCollection.Name)] public class AuthenticationTests : IISFunctionalTestBase { + private readonly PublishedSitesFixture _fixture; + + public AuthenticationTests(PublishedSitesFixture fixture) + { + _fixture = fixture; + } [ConditionalFact] public async Task Authentication_InProcess() { - var deploymentParameters = Helpers.GetBaseDeploymentParameters(publish: true); + var deploymentParameters = _fixture.GetBaseDeploymentParameters(publish: true); deploymentParameters.AddWindowsAuthToServerConfig(); var deploymentResult = await DeployAsync(deploymentParameters); diff --git a/test/IISExpress.FunctionalTests/InProcess/ShutdownTests.cs b/test/IISExpress.FunctionalTests/InProcess/ShutdownTests.cs index 45c9e080aa..1e397731e7 100644 --- a/test/IISExpress.FunctionalTests/InProcess/ShutdownTests.cs +++ b/test/IISExpress.FunctionalTests/InProcess/ShutdownTests.cs @@ -9,21 +9,23 @@ using Microsoft.AspNetCore.Server.IIS.FunctionalTests.Utilities; using Microsoft.AspNetCore.Server.IntegrationTesting; using Microsoft.AspNetCore.Testing.xunit; using Xunit; -using Xunit.Abstractions; namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests { + [Collection(PublishedSitesCollection.Name)] public class ShutdownTests : IISFunctionalTestBase { + private readonly PublishedSitesFixture _fixture; - public ShutdownTests(ITestOutputHelper output) : base(output) + public ShutdownTests(PublishedSitesFixture fixture) { + _fixture = fixture; } [ConditionalFact] public async Task ServerShutsDownWhenMainExits() { - var parameters = Helpers.GetBaseDeploymentParameters(publish: true); + var parameters = _fixture.GetBaseDeploymentParameters(publish: true); var result = await DeployAsync(parameters); try { @@ -39,7 +41,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests [ConditionalFact] public async Task GracefulShutdown_DoesNotCrashProcess() { - var parameters = Helpers.GetBaseDeploymentParameters(publish: true); + var parameters = _fixture.GetBaseDeploymentParameters(publish: true); parameters.GracefulShutdown = true; var result = await DeployAsync(parameters); @@ -51,7 +53,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests [ConditionalFact] public async Task ForcefulShutdown_DoesrashProcess() { - var parameters = Helpers.GetBaseDeploymentParameters(publish: true); + var parameters = _fixture.GetBaseDeploymentParameters(publish: true); var result = await DeployAsync(parameters); var response = await result.RetryingHttpClient.GetAsync("/HelloWorld"); diff --git a/test/IISExpress.FunctionalTests/InProcess/StartupTests.cs b/test/IISExpress.FunctionalTests/InProcess/StartupTests.cs index 36812d3f2e..218cb4b174 100644 --- a/test/IISExpress.FunctionalTests/InProcess/StartupTests.cs +++ b/test/IISExpress.FunctionalTests/InProcess/StartupTests.cs @@ -11,18 +11,21 @@ using Microsoft.AspNetCore.Server.IntegrationTesting; using Microsoft.AspNetCore.Server.IntegrationTesting.IIS; using Microsoft.AspNetCore.Testing.xunit; using Xunit; -using Xunit.Abstractions; namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests { + [Collection(PublishedSitesCollection.Name)] public class StartupTests : IISFunctionalTestBase { - private readonly string _dotnetLocation = DotNetCommands.GetDotNetExecutable(RuntimeArchitecture.x64); + private readonly PublishedSitesFixture _fixture; - public StartupTests(ITestOutputHelper output) : base(output) + public StartupTests(PublishedSitesFixture fixture) { + _fixture = fixture; } + private readonly string _dotnetLocation = DotNetCommands.GetDotNetExecutable(RuntimeArchitecture.x64); + [ConditionalFact] public async Task ExpandEnvironmentVariableInWebConfig() { @@ -42,7 +45,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests [InlineData(".\\dotnet.exe")] public async Task InvalidProcessPath_ExpectServerError(string path) { - var deploymentParameters = GetBaseDeploymentParameters(); + var deploymentParameters = _fixture.GetBaseDeploymentParameters(publish: true); deploymentParameters.WebConfigActionList.Add(WebConfigHelpers.AddOrModifyAspNetCoreSection("processPath", path)); @@ -99,7 +102,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests private async Task AssertStarts(Action preDeploy = null) { - var deploymentParameters = GetBaseDeploymentParameters(); + var deploymentParameters = _fixture.GetBaseDeploymentParameters(publish: true); preDeploy?.Invoke(deploymentParameters); @@ -121,11 +124,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests [MemberData(nameof(TestVariants))] public async Task HelloWorld(TestVariant variant) { - var deploymentParameters = new IISDeploymentParameters(variant) - { - ApplicationPath = Helpers.GetInProcessTestSitesPath(), - PublishApplicationBeforeDeployment = true - }; + var deploymentParameters = _fixture.GetBaseDeploymentParameters(variant, publish: true); var deploymentResult = await DeployAsync(deploymentParameters); @@ -138,7 +137,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests [ConditionalFact] public async Task DetectsOveriddenServer() { - var deploymentResult = await DeployAsync(GetBaseDeploymentParameters("OverriddenServerWebSite")); + var deploymentResult = await DeployAsync(_fixture.GetBaseDeploymentParameters(_fixture.OverriddenServerWebSite, publish: true)); var response = await deploymentResult.HttpClient.GetAsync("/"); Assert.False(response.IsSuccessStatusCode); @@ -150,7 +149,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests [ConditionalFact] public async Task CheckInvalidHostingModelParameter() { - var deploymentParameters = GetBaseDeploymentParameters(); + var deploymentParameters = _fixture.GetBaseDeploymentParameters(publish: true); deploymentParameters.WebConfigActionList.Add(WebConfigHelpers.AddOrModifyAspNetCoreSection("hostingModel", "bogus")); var deploymentResult = await DeployAsync(deploymentParameters); @@ -161,18 +160,5 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests EventLogHelpers.VerifyEventLogEvent(TestSink, "Unknown hosting model 'bogus'. Please specify either hostingModel=\"inprocess\" or hostingModel=\"outofprocess\" in the web.config file."); } - - // Defaults to inprocess specific deployment parameters - public static IISDeploymentParameters GetBaseDeploymentParameters(string site = "InProcessWebSite") - { - return new IISDeploymentParameters(Helpers.GetTestWebSitePath(site), DeployerSelector.ServerType, RuntimeFlavor.CoreClr, RuntimeArchitecture.x64) - { - TargetFramework = Tfm.NetCoreApp22, - ApplicationType = ApplicationType.Portable, - AncmVersion = AncmVersion.AspNetCoreModuleV2, - HostingModel = HostingModel.InProcess, - PublishApplicationBeforeDeployment = site == "InProcessWebSite", - }; - } } } diff --git a/test/IISExpress.FunctionalTests/OutOfProcess/GlobalVersionTests.cs b/test/IISExpress.FunctionalTests/OutOfProcess/GlobalVersionTests.cs index 8ad7a70665..3ab5918753 100644 --- a/test/IISExpress.FunctionalTests/OutOfProcess/GlobalVersionTests.cs +++ b/test/IISExpress.FunctionalTests/OutOfProcess/GlobalVersionTests.cs @@ -13,13 +13,20 @@ using Xunit; namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests { + [Collection(PublishedSitesCollection.Name)] public class GlobalVersionTests : IISFunctionalTestBase { + private readonly PublishedSitesFixture _fixture; + + public GlobalVersionTests(PublishedSitesFixture fixture) + { + _fixture = fixture; + } + private const string _aspNetCoreDll = "aspnetcorev2_outofprocess.dll"; private const string _handlerVersion20 = "2.0.0"; private const string _helloWorldRequest = "HelloWorld"; private const string _helloWorldResponse = "Hello World"; - private const string _outOfProcessVersionVariable = "/p:AspNetCoreModuleOutOfProcessVersion="; [ConditionalFact] public async Task GlobalVersion_DefaultWorks() @@ -65,11 +72,14 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests public async Task GlobalVersion_NewVersionNumber(string version) { var deploymentParameters = GetGlobalVersionBaseDeploymentParameters(); - deploymentParameters.AdditionalPublishParameters = $"{_outOfProcessVersionVariable}{version}"; deploymentParameters.HandlerSettings["handlerVersion"] = version; var deploymentResult = await DeployAsync(deploymentParameters); + var originalANCMPath = GetANCMRequestHandlerPath(deploymentResult, _handlerVersion20); + var newANCMPath = GetANCMRequestHandlerPath(deploymentResult, version); + Directory.Move(originalANCMPath, newANCMPath); + var response = await deploymentResult.RetryingHttpClient.GetAsync(_helloWorldRequest); var responseText = await response.Content.ReadAsStringAsync(); Assert.Equal(_helloWorldResponse, responseText); @@ -89,9 +99,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests var newANCMPath = GetANCMRequestHandlerPath(deploymentResult, version); - var di = Directory.CreateDirectory(Path.GetDirectoryName(newANCMPath)); - - File.Copy(originalANCMPath, newANCMPath, true); + CopyDirectory(originalANCMPath, newANCMPath); deploymentResult.RetryingHttpClient.DefaultRequestHeaders.Add("ANCMRHPath", newANCMPath); var response = await deploymentResult.RetryingHttpClient.GetAsync("CheckRequestHandlerVersion"); @@ -125,9 +133,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests var newANCMPath = GetANCMRequestHandlerPath(deploymentResult, version); - var di = Directory.CreateDirectory(Path.GetDirectoryName(newANCMPath)); - - File.Copy(originalANCMPath, newANCMPath, true); + CopyDirectory(originalANCMPath, newANCMPath); deploymentResult.RetryingHttpClient.DefaultRequestHeaders.Add("ANCMRHPath", newANCMPath); response = await deploymentResult.RetryingHttpClient.GetAsync("CheckRequestHandlerVersion"); @@ -139,23 +145,25 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests private IISDeploymentParameters GetGlobalVersionBaseDeploymentParameters() { - return new IISDeploymentParameters(Helpers.GetOutOfProcessTestSitesPath(), DeployerSelector.ServerType, RuntimeFlavor.CoreClr, RuntimeArchitecture.x64) + return _fixture.GetBaseDeploymentParameters(HostingModel.OutOfProcess, publish: true); + } + + private void CopyDirectory(string from, string to) + { + var toInfo = new DirectoryInfo(to); + toInfo.Create(); + + foreach (var file in new DirectoryInfo(from).GetFiles()) { - TargetFramework = Tfm.NetCoreApp22, - ApplicationType = ApplicationType.Portable, - AncmVersion = AncmVersion.AspNetCoreModuleV2, - HostingModel = HostingModel.OutOfProcess, - PublishApplicationBeforeDeployment = true, - AdditionalPublishParameters = $"{_outOfProcessVersionVariable}{_handlerVersion20}" - }; + file.CopyTo(Path.Combine(toInfo.FullName, file.Name)); + } } private string GetANCMRequestHandlerPath(IISDeploymentResult deploymentResult, string version) { return Path.Combine(deploymentResult.ContentRoot, deploymentResult.DeploymentParameters.RuntimeArchitecture.ToString(), - version, - _aspNetCoreDll); + version); } private void AssertLoadedVersion(string version) diff --git a/test/IISExpress.FunctionalTests/OutOfProcess/HttpsTest.cs b/test/IISExpress.FunctionalTests/OutOfProcess/HttpsTest.cs index ff9996c851..91c5291b0a 100644 --- a/test/IISExpress.FunctionalTests/OutOfProcess/HttpsTest.cs +++ b/test/IISExpress.FunctionalTests/OutOfProcess/HttpsTest.cs @@ -18,10 +18,14 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests // So these tests always have to use ports in this range, and we can't rely on OS-allocated ports without a whole lot of ceremony around // creating self-signed certificates and registering SSL bindings with HTTP.sys // Test specific to IISExpress + [Collection(PublishedSitesCollection.Name)] public class HttpsTest : IISFunctionalTestBase { - public HttpsTest(ITestOutputHelper output) : base(output) + private readonly PublishedSitesFixture _fixture; + + public HttpsTest(PublishedSitesFixture fixture) { + _fixture = fixture; } public static TestMatrix TestVariants @@ -34,12 +38,8 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests public async Task HttpsHelloWorld(TestVariant variant) { var port = TestPortHelper.GetNextSSLPort(); - var deploymentParameters = new IISDeploymentParameters(variant) - { - ApplicationPath = Helpers.GetOutOfProcessTestSitesPath(), - ApplicationBaseUriHint = $"https://localhost:{port}/" - }; - + var deploymentParameters = _fixture.GetBaseDeploymentParameters(variant); + deploymentParameters.ApplicationBaseUriHint = $"https://localhost:{port}/"; deploymentParameters.AddHttpsToServerConfig(); var deploymentResult = await DeployAsync(deploymentParameters); @@ -73,12 +73,8 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests private async Task HttpsHelloWorldCerts(TestVariant variant, bool sendClientCert) { var port = TestPortHelper.GetNextSSLPort(); - var deploymentParameters = new IISDeploymentParameters(variant) - { - ApplicationPath = Helpers.GetOutOfProcessTestSitesPath(), - ApplicationBaseUriHint = $"https://localhost:{port}/", - }; - + var deploymentParameters = _fixture.GetBaseDeploymentParameters(variant); + deploymentParameters.ApplicationBaseUriHint = $"https://localhost:{port}/"; deploymentParameters.AddHttpsToServerConfig(); var deploymentResult = await DeployAsync(deploymentParameters); diff --git a/test/IISExpress.FunctionalTests/OutOfProcess/NtlmAuthentationTest.cs b/test/IISExpress.FunctionalTests/OutOfProcess/NtlmAuthentationTest.cs index 437f019f52..b67b3b103a 100644 --- a/test/IISExpress.FunctionalTests/OutOfProcess/NtlmAuthentationTest.cs +++ b/test/IISExpress.FunctionalTests/OutOfProcess/NtlmAuthentationTest.cs @@ -13,14 +13,19 @@ using Xunit.Abstractions; namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests { + [Collection(PublishedSitesCollection.Name)] public class NtlmAuthenticationTests : IISFunctionalTestBase { // Test only runs on IISExpress today as our CI machines do not have // Windows auth installed globally. // TODO either enable windows auth on our CI or use containers to test this // behavior - public NtlmAuthenticationTests(ITestOutputHelper output) : base(output) + + private readonly PublishedSitesFixture _fixture; + + public NtlmAuthenticationTests(PublishedSitesFixture fixture) { + _fixture = fixture; } public static TestMatrix TestVariants @@ -32,11 +37,8 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests [MemberData(nameof(TestVariants))] public async Task NtlmAuthentication(TestVariant variant) { - var deploymentParameters = new IISDeploymentParameters(variant) - { - ApplicationPath = Helpers.GetOutOfProcessTestSitesPath(), - ApplicationBaseUriHint = $"http://localhost:0/" - }; + var deploymentParameters = _fixture.GetBaseDeploymentParameters(variant); + deploymentParameters.ApplicationBaseUriHint = $"https://localhost:0/"; deploymentParameters.AddWindowsAuthToServerConfig(); diff --git a/test/IISExpress.FunctionalTests/OutOfProcess/WindowsAuthTests.cs b/test/IISExpress.FunctionalTests/OutOfProcess/WindowsAuthTests.cs index 038f57029d..b46b314d08 100644 --- a/test/IISExpress.FunctionalTests/OutOfProcess/WindowsAuthTests.cs +++ b/test/IISExpress.FunctionalTests/OutOfProcess/WindowsAuthTests.cs @@ -12,10 +12,14 @@ using Xunit.Abstractions; namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests { + [Collection(PublishedSitesCollection.Name)] public class WindowsAuthTests : IISFunctionalTestBase { - public WindowsAuthTests(ITestOutputHelper output = null) : base(output) + private readonly PublishedSitesFixture _fixture; + + public WindowsAuthTests(PublishedSitesFixture fixture) { + _fixture = fixture; } public static TestMatrix TestVariants @@ -28,10 +32,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests [MemberData(nameof(TestVariants))] public async Task WindowsAuthTest(TestVariant variant) { - var deploymentParameters = new IISDeploymentParameters(variant) - { - ApplicationPath = Helpers.GetOutOfProcessTestSitesPath(), - }; + var deploymentParameters = _fixture.GetBaseDeploymentParameters(variant); deploymentParameters.AddWindowsAuthToServerConfig(); // The default in hosting sets windows auth to true. diff --git a/test/IISExpress.FunctionalTests/UpgradeFeatureDetectionTests.cs b/test/IISExpress.FunctionalTests/UpgradeFeatureDetectionTests.cs index 316a87f9b3..492ae8db87 100644 --- a/test/IISExpress.FunctionalTests/UpgradeFeatureDetectionTests.cs +++ b/test/IISExpress.FunctionalTests/UpgradeFeatureDetectionTests.cs @@ -9,16 +9,18 @@ using Microsoft.AspNetCore.Server.IntegrationTesting; using Microsoft.AspNetCore.Server.IntegrationTesting.IIS; using Microsoft.AspNetCore.Testing.xunit; using Xunit; -using Xunit.Abstractions; namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests { + [Collection(PublishedSitesCollection.Name)] public class UpgradeFeatureDetectionTests : IISFunctionalTestBase { private readonly string _isWebsocketsSupported = Environment.OSVersion.Version >= new Version(6, 2) ? "Enabled" : "Disabled"; + private readonly PublishedSitesFixture _fixture; - public UpgradeFeatureDetectionTests(ITestOutputHelper output) : base(output) + public UpgradeFeatureDetectionTests(PublishedSitesFixture fixture) { + _fixture = fixture; } [ConditionalFact] @@ -60,14 +62,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests private async Task UpgradeFeatureDetectionDeployer(bool disableWebSocket, string sitePath, string expected, HostingModel hostingModel) { - var deploymentParameters = new IISDeploymentParameters(sitePath, DeployerSelector.ServerType, RuntimeFlavor.CoreClr, RuntimeArchitecture.x64) - { - TargetFramework = Tfm.NetCoreApp22, - ApplicationType = ApplicationType.Portable, - AncmVersion = AncmVersion.AspNetCoreModuleV2, - HostingModel = hostingModel, - PublishApplicationBeforeDeployment = hostingModel == HostingModel.InProcess - }; + var deploymentParameters = _fixture.GetBaseDeploymentParameters(hostingModel, publish: true); if (disableWebSocket) { From f4c71da99602c046cc7be8438bdd7f43a8a21557 Mon Sep 17 00:00:00 2001 From: Pavel Krymets Date: Wed, 1 Aug 2018 14:37:23 -0700 Subject: [PATCH 6/8] Reduce msbuild invocations while building native (#1135) --- IISIntegration.sln | 240 +++++++++++++++++++++++++++++++++++++++++++++ build/repo.targets | 7 +- 2 files changed, 245 insertions(+), 2 deletions(-) diff --git a/IISIntegration.sln b/IISIntegration.sln index ba7d809f5f..549f17f75b 100644 --- a/IISIntegration.sln +++ b/IISIntegration.sln @@ -129,6 +129,12 @@ Global Debug|Any CPU = Debug|Any CPU Debug|x64 = Debug|x64 Debug|x86 = Debug|x86 + NativeDebug|Any CPU = NativeDebug|Any CPU + NativeDebug|x64 = NativeDebug|x64 + NativeDebug|x86 = NativeDebug|x86 + NativeRelease|Any CPU = NativeRelease|Any CPU + NativeRelease|x64 = NativeRelease|x64 + NativeRelease|x86 = NativeRelease|x86 Release|Any CPU = Release|Any CPU Release|x64 = Release|x64 Release|x86 = Release|x86 @@ -140,6 +146,14 @@ Global {E4E2BDC4-A9C6-4AE9-B429-032EC83EDE64}.Debug|x64.Build.0 = Debug|Any CPU {E4E2BDC4-A9C6-4AE9-B429-032EC83EDE64}.Debug|x86.ActiveCfg = Debug|Any CPU {E4E2BDC4-A9C6-4AE9-B429-032EC83EDE64}.Debug|x86.Build.0 = Debug|Any CPU + {E4E2BDC4-A9C6-4AE9-B429-032EC83EDE64}.NativeDebug|Any CPU.ActiveCfg = Debug|Any CPU + {E4E2BDC4-A9C6-4AE9-B429-032EC83EDE64}.NativeDebug|Any CPU.Build.0 = Debug|Any CPU + {E4E2BDC4-A9C6-4AE9-B429-032EC83EDE64}.NativeDebug|x64.ActiveCfg = Debug|Any CPU + {E4E2BDC4-A9C6-4AE9-B429-032EC83EDE64}.NativeDebug|x86.ActiveCfg = Debug|Any CPU + {E4E2BDC4-A9C6-4AE9-B429-032EC83EDE64}.NativeRelease|Any CPU.ActiveCfg = Release|Any CPU + {E4E2BDC4-A9C6-4AE9-B429-032EC83EDE64}.NativeRelease|Any CPU.Build.0 = Release|Any CPU + {E4E2BDC4-A9C6-4AE9-B429-032EC83EDE64}.NativeRelease|x64.ActiveCfg = Release|Any CPU + {E4E2BDC4-A9C6-4AE9-B429-032EC83EDE64}.NativeRelease|x86.ActiveCfg = Release|Any CPU {E4E2BDC4-A9C6-4AE9-B429-032EC83EDE64}.Release|Any CPU.ActiveCfg = Release|Any CPU {E4E2BDC4-A9C6-4AE9-B429-032EC83EDE64}.Release|Any CPU.Build.0 = Release|Any CPU {E4E2BDC4-A9C6-4AE9-B429-032EC83EDE64}.Release|x64.ActiveCfg = Release|Any CPU @@ -152,6 +166,14 @@ Global {8B3446E8-E6A8-4591-AA63-A95837C6E97C}.Debug|x64.Build.0 = Debug|Any CPU {8B3446E8-E6A8-4591-AA63-A95837C6E97C}.Debug|x86.ActiveCfg = Debug|Any CPU {8B3446E8-E6A8-4591-AA63-A95837C6E97C}.Debug|x86.Build.0 = Debug|Any CPU + {8B3446E8-E6A8-4591-AA63-A95837C6E97C}.NativeDebug|Any CPU.ActiveCfg = Debug|Any CPU + {8B3446E8-E6A8-4591-AA63-A95837C6E97C}.NativeDebug|Any CPU.Build.0 = Debug|Any CPU + {8B3446E8-E6A8-4591-AA63-A95837C6E97C}.NativeDebug|x64.ActiveCfg = Debug|Any CPU + {8B3446E8-E6A8-4591-AA63-A95837C6E97C}.NativeDebug|x86.ActiveCfg = Debug|Any CPU + {8B3446E8-E6A8-4591-AA63-A95837C6E97C}.NativeRelease|Any CPU.ActiveCfg = Release|Any CPU + {8B3446E8-E6A8-4591-AA63-A95837C6E97C}.NativeRelease|Any CPU.Build.0 = Release|Any CPU + {8B3446E8-E6A8-4591-AA63-A95837C6E97C}.NativeRelease|x64.ActiveCfg = Release|Any CPU + {8B3446E8-E6A8-4591-AA63-A95837C6E97C}.NativeRelease|x86.ActiveCfg = Release|Any CPU {8B3446E8-E6A8-4591-AA63-A95837C6E97C}.Release|Any CPU.ActiveCfg = Release|Any CPU {8B3446E8-E6A8-4591-AA63-A95837C6E97C}.Release|Any CPU.Build.0 = Release|Any CPU {8B3446E8-E6A8-4591-AA63-A95837C6E97C}.Release|x64.ActiveCfg = Release|Any CPU @@ -164,6 +186,14 @@ Global {4106DB10-E09F-480E-9CE6-B39235512EE6}.Debug|x64.Build.0 = Debug|Any CPU {4106DB10-E09F-480E-9CE6-B39235512EE6}.Debug|x86.ActiveCfg = Debug|Any CPU {4106DB10-E09F-480E-9CE6-B39235512EE6}.Debug|x86.Build.0 = Debug|Any CPU + {4106DB10-E09F-480E-9CE6-B39235512EE6}.NativeDebug|Any CPU.ActiveCfg = Debug|Any CPU + {4106DB10-E09F-480E-9CE6-B39235512EE6}.NativeDebug|Any CPU.Build.0 = Debug|Any CPU + {4106DB10-E09F-480E-9CE6-B39235512EE6}.NativeDebug|x64.ActiveCfg = Debug|Any CPU + {4106DB10-E09F-480E-9CE6-B39235512EE6}.NativeDebug|x86.ActiveCfg = Debug|Any CPU + {4106DB10-E09F-480E-9CE6-B39235512EE6}.NativeRelease|Any CPU.ActiveCfg = Release|Any CPU + {4106DB10-E09F-480E-9CE6-B39235512EE6}.NativeRelease|Any CPU.Build.0 = Release|Any CPU + {4106DB10-E09F-480E-9CE6-B39235512EE6}.NativeRelease|x64.ActiveCfg = Release|Any CPU + {4106DB10-E09F-480E-9CE6-B39235512EE6}.NativeRelease|x86.ActiveCfg = Release|Any CPU {4106DB10-E09F-480E-9CE6-B39235512EE6}.Release|Any CPU.ActiveCfg = Release|Any CPU {4106DB10-E09F-480E-9CE6-B39235512EE6}.Release|Any CPU.Build.0 = Release|Any CPU {4106DB10-E09F-480E-9CE6-B39235512EE6}.Release|x64.ActiveCfg = Release|Any CPU @@ -176,6 +206,14 @@ Global {4E3E1F5C-CD52-4CC0-A35F-D1FA1685D2FA}.Debug|x64.Build.0 = Debug|Any CPU {4E3E1F5C-CD52-4CC0-A35F-D1FA1685D2FA}.Debug|x86.ActiveCfg = Debug|Any CPU {4E3E1F5C-CD52-4CC0-A35F-D1FA1685D2FA}.Debug|x86.Build.0 = Debug|Any CPU + {4E3E1F5C-CD52-4CC0-A35F-D1FA1685D2FA}.NativeDebug|Any CPU.ActiveCfg = Debug|Any CPU + {4E3E1F5C-CD52-4CC0-A35F-D1FA1685D2FA}.NativeDebug|Any CPU.Build.0 = Debug|Any CPU + {4E3E1F5C-CD52-4CC0-A35F-D1FA1685D2FA}.NativeDebug|x64.ActiveCfg = Debug|Any CPU + {4E3E1F5C-CD52-4CC0-A35F-D1FA1685D2FA}.NativeDebug|x86.ActiveCfg = Debug|Any CPU + {4E3E1F5C-CD52-4CC0-A35F-D1FA1685D2FA}.NativeRelease|Any CPU.ActiveCfg = Release|Any CPU + {4E3E1F5C-CD52-4CC0-A35F-D1FA1685D2FA}.NativeRelease|Any CPU.Build.0 = Release|Any CPU + {4E3E1F5C-CD52-4CC0-A35F-D1FA1685D2FA}.NativeRelease|x64.ActiveCfg = Release|Any CPU + {4E3E1F5C-CD52-4CC0-A35F-D1FA1685D2FA}.NativeRelease|x86.ActiveCfg = Release|Any CPU {4E3E1F5C-CD52-4CC0-A35F-D1FA1685D2FA}.Release|Any CPU.ActiveCfg = Release|Any CPU {4E3E1F5C-CD52-4CC0-A35F-D1FA1685D2FA}.Release|Any CPU.Build.0 = Release|Any CPU {4E3E1F5C-CD52-4CC0-A35F-D1FA1685D2FA}.Release|x64.ActiveCfg = Release|Any CPU @@ -188,6 +226,14 @@ Global {9BC4AFCB-325D-4C81-8228-8CF301CE2F97}.Debug|x64.Build.0 = Debug|x64 {9BC4AFCB-325D-4C81-8228-8CF301CE2F97}.Debug|x86.ActiveCfg = Debug|x86 {9BC4AFCB-325D-4C81-8228-8CF301CE2F97}.Debug|x86.Build.0 = Debug|x86 + {9BC4AFCB-325D-4C81-8228-8CF301CE2F97}.NativeDebug|Any CPU.ActiveCfg = Debug|x64 + {9BC4AFCB-325D-4C81-8228-8CF301CE2F97}.NativeDebug|Any CPU.Build.0 = Debug|x64 + {9BC4AFCB-325D-4C81-8228-8CF301CE2F97}.NativeDebug|x64.ActiveCfg = Debug|x64 + {9BC4AFCB-325D-4C81-8228-8CF301CE2F97}.NativeDebug|x86.ActiveCfg = Debug|x86 + {9BC4AFCB-325D-4C81-8228-8CF301CE2F97}.NativeRelease|Any CPU.ActiveCfg = Release|x64 + {9BC4AFCB-325D-4C81-8228-8CF301CE2F97}.NativeRelease|Any CPU.Build.0 = Release|x64 + {9BC4AFCB-325D-4C81-8228-8CF301CE2F97}.NativeRelease|x64.ActiveCfg = Release|x64 + {9BC4AFCB-325D-4C81-8228-8CF301CE2F97}.NativeRelease|x86.ActiveCfg = Release|x86 {9BC4AFCB-325D-4C81-8228-8CF301CE2F97}.Release|Any CPU.ActiveCfg = Release|x64 {9BC4AFCB-325D-4C81-8228-8CF301CE2F97}.Release|Any CPU.Build.0 = Release|x64 {9BC4AFCB-325D-4C81-8228-8CF301CE2F97}.Release|x64.ActiveCfg = Release|x64 @@ -200,6 +246,14 @@ Global {679FA2A2-898B-4320-884E-C2D294A97CE1}.Debug|x64.Build.0 = Debug|x64 {679FA2A2-898B-4320-884E-C2D294A97CE1}.Debug|x86.ActiveCfg = Debug|x86 {679FA2A2-898B-4320-884E-C2D294A97CE1}.Debug|x86.Build.0 = Debug|x86 + {679FA2A2-898B-4320-884E-C2D294A97CE1}.NativeDebug|Any CPU.ActiveCfg = Debug|x64 + {679FA2A2-898B-4320-884E-C2D294A97CE1}.NativeDebug|Any CPU.Build.0 = Debug|x64 + {679FA2A2-898B-4320-884E-C2D294A97CE1}.NativeDebug|x64.ActiveCfg = Debug|x64 + {679FA2A2-898B-4320-884E-C2D294A97CE1}.NativeDebug|x86.ActiveCfg = Debug|x86 + {679FA2A2-898B-4320-884E-C2D294A97CE1}.NativeRelease|Any CPU.ActiveCfg = Release|x64 + {679FA2A2-898B-4320-884E-C2D294A97CE1}.NativeRelease|Any CPU.Build.0 = Release|x64 + {679FA2A2-898B-4320-884E-C2D294A97CE1}.NativeRelease|x64.ActiveCfg = Release|x64 + {679FA2A2-898B-4320-884E-C2D294A97CE1}.NativeRelease|x86.ActiveCfg = Release|x86 {679FA2A2-898B-4320-884E-C2D294A97CE1}.Release|Any CPU.ActiveCfg = Release|x64 {679FA2A2-898B-4320-884E-C2D294A97CE1}.Release|Any CPU.Build.0 = Release|x64 {679FA2A2-898B-4320-884E-C2D294A97CE1}.Release|x64.ActiveCfg = Release|x64 @@ -212,6 +266,14 @@ Global {46A8612B-418B-4D70-B3A7-A21DD0627473}.Debug|x64.Build.0 = Debug|Any CPU {46A8612B-418B-4D70-B3A7-A21DD0627473}.Debug|x86.ActiveCfg = Debug|Any CPU {46A8612B-418B-4D70-B3A7-A21DD0627473}.Debug|x86.Build.0 = Debug|Any CPU + {46A8612B-418B-4D70-B3A7-A21DD0627473}.NativeDebug|Any CPU.ActiveCfg = Debug|Any CPU + {46A8612B-418B-4D70-B3A7-A21DD0627473}.NativeDebug|Any CPU.Build.0 = Debug|Any CPU + {46A8612B-418B-4D70-B3A7-A21DD0627473}.NativeDebug|x64.ActiveCfg = Debug|Any CPU + {46A8612B-418B-4D70-B3A7-A21DD0627473}.NativeDebug|x86.ActiveCfg = Debug|Any CPU + {46A8612B-418B-4D70-B3A7-A21DD0627473}.NativeRelease|Any CPU.ActiveCfg = Release|Any CPU + {46A8612B-418B-4D70-B3A7-A21DD0627473}.NativeRelease|Any CPU.Build.0 = Release|Any CPU + {46A8612B-418B-4D70-B3A7-A21DD0627473}.NativeRelease|x64.ActiveCfg = Release|Any CPU + {46A8612B-418B-4D70-B3A7-A21DD0627473}.NativeRelease|x86.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|x64.ActiveCfg = Release|Any CPU @@ -224,6 +286,14 @@ Global {13FD8F12-FFBE-4D01-B4AC-444F2994B04F}.Debug|x64.Build.0 = Debug|x64 {13FD8F12-FFBE-4D01-B4AC-444F2994B04F}.Debug|x86.ActiveCfg = Debug|x86 {13FD8F12-FFBE-4D01-B4AC-444F2994B04F}.Debug|x86.Build.0 = Debug|x86 + {13FD8F12-FFBE-4D01-B4AC-444F2994B04F}.NativeDebug|Any CPU.ActiveCfg = Debug|x64 + {13FD8F12-FFBE-4D01-B4AC-444F2994B04F}.NativeDebug|Any CPU.Build.0 = Debug|x64 + {13FD8F12-FFBE-4D01-B4AC-444F2994B04F}.NativeDebug|x64.ActiveCfg = Debug|x64 + {13FD8F12-FFBE-4D01-B4AC-444F2994B04F}.NativeDebug|x86.ActiveCfg = Debug|x86 + {13FD8F12-FFBE-4D01-B4AC-444F2994B04F}.NativeRelease|Any CPU.ActiveCfg = Release|x64 + {13FD8F12-FFBE-4D01-B4AC-444F2994B04F}.NativeRelease|Any CPU.Build.0 = Release|x64 + {13FD8F12-FFBE-4D01-B4AC-444F2994B04F}.NativeRelease|x64.ActiveCfg = Release|x64 + {13FD8F12-FFBE-4D01-B4AC-444F2994B04F}.NativeRelease|x86.ActiveCfg = Release|x86 {13FD8F12-FFBE-4D01-B4AC-444F2994B04F}.Release|Any CPU.ActiveCfg = Release|x64 {13FD8F12-FFBE-4D01-B4AC-444F2994B04F}.Release|Any CPU.Build.0 = Release|x64 {13FD8F12-FFBE-4D01-B4AC-444F2994B04F}.Release|x64.ActiveCfg = Release|x64 @@ -236,6 +306,14 @@ Global {064D860B-4D7C-4B1D-918F-E020F1B99E2A}.Debug|x64.Build.0 = Debug|Any CPU {064D860B-4D7C-4B1D-918F-E020F1B99E2A}.Debug|x86.ActiveCfg = Debug|Any CPU {064D860B-4D7C-4B1D-918F-E020F1B99E2A}.Debug|x86.Build.0 = Debug|Any CPU + {064D860B-4D7C-4B1D-918F-E020F1B99E2A}.NativeDebug|Any CPU.ActiveCfg = Debug|Any CPU + {064D860B-4D7C-4B1D-918F-E020F1B99E2A}.NativeDebug|Any CPU.Build.0 = Debug|Any CPU + {064D860B-4D7C-4B1D-918F-E020F1B99E2A}.NativeDebug|x64.ActiveCfg = Debug|Any CPU + {064D860B-4D7C-4B1D-918F-E020F1B99E2A}.NativeDebug|x86.ActiveCfg = Debug|Any CPU + {064D860B-4D7C-4B1D-918F-E020F1B99E2A}.NativeRelease|Any CPU.ActiveCfg = Release|Any CPU + {064D860B-4D7C-4B1D-918F-E020F1B99E2A}.NativeRelease|Any CPU.Build.0 = Release|Any CPU + {064D860B-4D7C-4B1D-918F-E020F1B99E2A}.NativeRelease|x64.ActiveCfg = Release|Any CPU + {064D860B-4D7C-4B1D-918F-E020F1B99E2A}.NativeRelease|x86.ActiveCfg = Release|Any CPU {064D860B-4D7C-4B1D-918F-E020F1B99E2A}.Release|Any CPU.ActiveCfg = Release|Any CPU {064D860B-4D7C-4B1D-918F-E020F1B99E2A}.Release|Any CPU.Build.0 = Release|Any CPU {064D860B-4D7C-4B1D-918F-E020F1B99E2A}.Release|x64.ActiveCfg = Release|Any CPU @@ -248,6 +326,14 @@ Global {FC2A97F8-A749-4C04-97D1-97500066A820}.Debug|x64.Build.0 = Debug|x64 {FC2A97F8-A749-4C04-97D1-97500066A820}.Debug|x86.ActiveCfg = Debug|x86 {FC2A97F8-A749-4C04-97D1-97500066A820}.Debug|x86.Build.0 = Debug|x86 + {FC2A97F8-A749-4C04-97D1-97500066A820}.NativeDebug|Any CPU.ActiveCfg = Debug|x64 + {FC2A97F8-A749-4C04-97D1-97500066A820}.NativeDebug|Any CPU.Build.0 = Debug|x64 + {FC2A97F8-A749-4C04-97D1-97500066A820}.NativeDebug|x64.ActiveCfg = Debug|x64 + {FC2A97F8-A749-4C04-97D1-97500066A820}.NativeDebug|x86.ActiveCfg = Debug|x86 + {FC2A97F8-A749-4C04-97D1-97500066A820}.NativeRelease|Any CPU.ActiveCfg = Release|x64 + {FC2A97F8-A749-4C04-97D1-97500066A820}.NativeRelease|Any CPU.Build.0 = Release|x64 + {FC2A97F8-A749-4C04-97D1-97500066A820}.NativeRelease|x64.ActiveCfg = Release|x64 + {FC2A97F8-A749-4C04-97D1-97500066A820}.NativeRelease|x86.ActiveCfg = Release|x86 {FC2A97F8-A749-4C04-97D1-97500066A820}.Release|Any CPU.ActiveCfg = Release|x64 {FC2A97F8-A749-4C04-97D1-97500066A820}.Release|Any CPU.Build.0 = Release|x64 {FC2A97F8-A749-4C04-97D1-97500066A820}.Release|x64.ActiveCfg = Release|x64 @@ -259,6 +345,16 @@ Global {1EAC8125-1765-4E2D-8CBE-56DC98A1C8C1}.Debug|x64.Build.0 = Debug|x64 {1EAC8125-1765-4E2D-8CBE-56DC98A1C8C1}.Debug|x86.ActiveCfg = Debug|Win32 {1EAC8125-1765-4E2D-8CBE-56DC98A1C8C1}.Debug|x86.Build.0 = Debug|Win32 + {1EAC8125-1765-4E2D-8CBE-56DC98A1C8C1}.NativeDebug|Any CPU.ActiveCfg = Debug|Win32 + {1EAC8125-1765-4E2D-8CBE-56DC98A1C8C1}.NativeDebug|x64.ActiveCfg = Debug|x64 + {1EAC8125-1765-4E2D-8CBE-56DC98A1C8C1}.NativeDebug|x64.Build.0 = Debug|x64 + {1EAC8125-1765-4E2D-8CBE-56DC98A1C8C1}.NativeDebug|x86.ActiveCfg = Debug|Win32 + {1EAC8125-1765-4E2D-8CBE-56DC98A1C8C1}.NativeDebug|x86.Build.0 = Debug|Win32 + {1EAC8125-1765-4E2D-8CBE-56DC98A1C8C1}.NativeRelease|Any CPU.ActiveCfg = Release|Win32 + {1EAC8125-1765-4E2D-8CBE-56DC98A1C8C1}.NativeRelease|x64.ActiveCfg = Release|x64 + {1EAC8125-1765-4E2D-8CBE-56DC98A1C8C1}.NativeRelease|x64.Build.0 = Release|x64 + {1EAC8125-1765-4E2D-8CBE-56DC98A1C8C1}.NativeRelease|x86.ActiveCfg = Release|Win32 + {1EAC8125-1765-4E2D-8CBE-56DC98A1C8C1}.NativeRelease|x86.Build.0 = Release|Win32 {1EAC8125-1765-4E2D-8CBE-56DC98A1C8C1}.Release|Any CPU.ActiveCfg = Release|Win32 {1EAC8125-1765-4E2D-8CBE-56DC98A1C8C1}.Release|x64.ActiveCfg = Release|x64 {1EAC8125-1765-4E2D-8CBE-56DC98A1C8C1}.Release|x64.Build.0 = Release|x64 @@ -269,6 +365,16 @@ Global {4787A64F-9A3E-4867-A55A-70CB4B2B2FFE}.Debug|x64.Build.0 = Debug|x64 {4787A64F-9A3E-4867-A55A-70CB4B2B2FFE}.Debug|x86.ActiveCfg = Debug|Win32 {4787A64F-9A3E-4867-A55A-70CB4B2B2FFE}.Debug|x86.Build.0 = Debug|Win32 + {4787A64F-9A3E-4867-A55A-70CB4B2B2FFE}.NativeDebug|Any CPU.ActiveCfg = Debug|Win32 + {4787A64F-9A3E-4867-A55A-70CB4B2B2FFE}.NativeDebug|x64.ActiveCfg = Debug|x64 + {4787A64F-9A3E-4867-A55A-70CB4B2B2FFE}.NativeDebug|x64.Build.0 = Debug|x64 + {4787A64F-9A3E-4867-A55A-70CB4B2B2FFE}.NativeDebug|x86.ActiveCfg = Debug|Win32 + {4787A64F-9A3E-4867-A55A-70CB4B2B2FFE}.NativeDebug|x86.Build.0 = Debug|Win32 + {4787A64F-9A3E-4867-A55A-70CB4B2B2FFE}.NativeRelease|Any CPU.ActiveCfg = Release|Win32 + {4787A64F-9A3E-4867-A55A-70CB4B2B2FFE}.NativeRelease|x64.ActiveCfg = Release|x64 + {4787A64F-9A3E-4867-A55A-70CB4B2B2FFE}.NativeRelease|x64.Build.0 = Release|x64 + {4787A64F-9A3E-4867-A55A-70CB4B2B2FFE}.NativeRelease|x86.ActiveCfg = Release|Win32 + {4787A64F-9A3E-4867-A55A-70CB4B2B2FFE}.NativeRelease|x86.Build.0 = Release|Win32 {4787A64F-9A3E-4867-A55A-70CB4B2B2FFE}.Release|Any CPU.ActiveCfg = Release|Win32 {4787A64F-9A3E-4867-A55A-70CB4B2B2FFE}.Release|x64.ActiveCfg = Release|x64 {4787A64F-9A3E-4867-A55A-70CB4B2B2FFE}.Release|x64.Build.0 = Release|x64 @@ -279,6 +385,16 @@ Global {439824F9-1455-4CC4-BD79-B44FA0A16552}.Debug|x64.Build.0 = Debug|x64 {439824F9-1455-4CC4-BD79-B44FA0A16552}.Debug|x86.ActiveCfg = Debug|Win32 {439824F9-1455-4CC4-BD79-B44FA0A16552}.Debug|x86.Build.0 = Debug|Win32 + {439824F9-1455-4CC4-BD79-B44FA0A16552}.NativeDebug|Any CPU.ActiveCfg = Debug|Win32 + {439824F9-1455-4CC4-BD79-B44FA0A16552}.NativeDebug|x64.ActiveCfg = Debug|x64 + {439824F9-1455-4CC4-BD79-B44FA0A16552}.NativeDebug|x64.Build.0 = Debug|x64 + {439824F9-1455-4CC4-BD79-B44FA0A16552}.NativeDebug|x86.ActiveCfg = Debug|Win32 + {439824F9-1455-4CC4-BD79-B44FA0A16552}.NativeDebug|x86.Build.0 = Debug|Win32 + {439824F9-1455-4CC4-BD79-B44FA0A16552}.NativeRelease|Any CPU.ActiveCfg = Release|Win32 + {439824F9-1455-4CC4-BD79-B44FA0A16552}.NativeRelease|x64.ActiveCfg = Release|x64 + {439824F9-1455-4CC4-BD79-B44FA0A16552}.NativeRelease|x64.Build.0 = Release|x64 + {439824F9-1455-4CC4-BD79-B44FA0A16552}.NativeRelease|x86.ActiveCfg = Release|Win32 + {439824F9-1455-4CC4-BD79-B44FA0A16552}.NativeRelease|x86.Build.0 = Release|Win32 {439824F9-1455-4CC4-BD79-B44FA0A16552}.Release|Any CPU.ActiveCfg = Release|Win32 {439824F9-1455-4CC4-BD79-B44FA0A16552}.Release|x64.ActiveCfg = Release|x64 {439824F9-1455-4CC4-BD79-B44FA0A16552}.Release|x64.Build.0 = Release|x64 @@ -289,6 +405,16 @@ Global {EC82302F-D2F0-4727-99D1-EABC0DD9DC3B}.Debug|x64.Build.0 = Debug|x64 {EC82302F-D2F0-4727-99D1-EABC0DD9DC3B}.Debug|x86.ActiveCfg = Debug|Win32 {EC82302F-D2F0-4727-99D1-EABC0DD9DC3B}.Debug|x86.Build.0 = Debug|Win32 + {EC82302F-D2F0-4727-99D1-EABC0DD9DC3B}.NativeDebug|Any CPU.ActiveCfg = Debug|Win32 + {EC82302F-D2F0-4727-99D1-EABC0DD9DC3B}.NativeDebug|x64.ActiveCfg = Debug|x64 + {EC82302F-D2F0-4727-99D1-EABC0DD9DC3B}.NativeDebug|x64.Build.0 = Debug|x64 + {EC82302F-D2F0-4727-99D1-EABC0DD9DC3B}.NativeDebug|x86.ActiveCfg = Debug|Win32 + {EC82302F-D2F0-4727-99D1-EABC0DD9DC3B}.NativeDebug|x86.Build.0 = Debug|Win32 + {EC82302F-D2F0-4727-99D1-EABC0DD9DC3B}.NativeRelease|Any CPU.ActiveCfg = Release|Win32 + {EC82302F-D2F0-4727-99D1-EABC0DD9DC3B}.NativeRelease|x64.ActiveCfg = Release|x64 + {EC82302F-D2F0-4727-99D1-EABC0DD9DC3B}.NativeRelease|x64.Build.0 = Release|x64 + {EC82302F-D2F0-4727-99D1-EABC0DD9DC3B}.NativeRelease|x86.ActiveCfg = Release|Win32 + {EC82302F-D2F0-4727-99D1-EABC0DD9DC3B}.NativeRelease|x86.Build.0 = Release|Win32 {EC82302F-D2F0-4727-99D1-EABC0DD9DC3B}.Release|Any CPU.ActiveCfg = Release|Win32 {EC82302F-D2F0-4727-99D1-EABC0DD9DC3B}.Release|x64.ActiveCfg = Release|x64 {EC82302F-D2F0-4727-99D1-EABC0DD9DC3B}.Release|x64.Build.0 = Release|x64 @@ -299,6 +425,16 @@ Global {55494E58-E061-4C4C-A0A8-837008E72F85}.Debug|x64.Build.0 = Debug|x64 {55494E58-E061-4C4C-A0A8-837008E72F85}.Debug|x86.ActiveCfg = Debug|Win32 {55494E58-E061-4C4C-A0A8-837008E72F85}.Debug|x86.Build.0 = Debug|Win32 + {55494E58-E061-4C4C-A0A8-837008E72F85}.NativeDebug|Any CPU.ActiveCfg = Debug|Win32 + {55494E58-E061-4C4C-A0A8-837008E72F85}.NativeDebug|x64.ActiveCfg = Debug|x64 + {55494E58-E061-4C4C-A0A8-837008E72F85}.NativeDebug|x64.Build.0 = Debug|x64 + {55494E58-E061-4C4C-A0A8-837008E72F85}.NativeDebug|x86.ActiveCfg = Debug|Win32 + {55494E58-E061-4C4C-A0A8-837008E72F85}.NativeDebug|x86.Build.0 = Debug|Win32 + {55494E58-E061-4C4C-A0A8-837008E72F85}.NativeRelease|Any CPU.ActiveCfg = Release|Win32 + {55494E58-E061-4C4C-A0A8-837008E72F85}.NativeRelease|x64.ActiveCfg = Release|x64 + {55494E58-E061-4C4C-A0A8-837008E72F85}.NativeRelease|x64.Build.0 = Release|x64 + {55494E58-E061-4C4C-A0A8-837008E72F85}.NativeRelease|x86.ActiveCfg = Release|Win32 + {55494E58-E061-4C4C-A0A8-837008E72F85}.NativeRelease|x86.Build.0 = Release|Win32 {55494E58-E061-4C4C-A0A8-837008E72F85}.Release|Any CPU.ActiveCfg = Release|Win32 {55494E58-E061-4C4C-A0A8-837008E72F85}.Release|x64.ActiveCfg = Release|x64 {55494E58-E061-4C4C-A0A8-837008E72F85}.Release|x64.Build.0 = Release|x64 @@ -309,6 +445,16 @@ Global {09D9D1D6-2951-4E14-BC35-76A23CF9391A}.Debug|x64.Build.0 = Debug|x64 {09D9D1D6-2951-4E14-BC35-76A23CF9391A}.Debug|x86.ActiveCfg = Debug|Win32 {09D9D1D6-2951-4E14-BC35-76A23CF9391A}.Debug|x86.Build.0 = Debug|Win32 + {09D9D1D6-2951-4E14-BC35-76A23CF9391A}.NativeDebug|Any CPU.ActiveCfg = Debug|Win32 + {09D9D1D6-2951-4E14-BC35-76A23CF9391A}.NativeDebug|x64.ActiveCfg = Debug|x64 + {09D9D1D6-2951-4E14-BC35-76A23CF9391A}.NativeDebug|x64.Build.0 = Debug|x64 + {09D9D1D6-2951-4E14-BC35-76A23CF9391A}.NativeDebug|x86.ActiveCfg = Debug|Win32 + {09D9D1D6-2951-4E14-BC35-76A23CF9391A}.NativeDebug|x86.Build.0 = Debug|Win32 + {09D9D1D6-2951-4E14-BC35-76A23CF9391A}.NativeRelease|Any CPU.ActiveCfg = Release|Win32 + {09D9D1D6-2951-4E14-BC35-76A23CF9391A}.NativeRelease|x64.ActiveCfg = Release|x64 + {09D9D1D6-2951-4E14-BC35-76A23CF9391A}.NativeRelease|x64.Build.0 = Release|x64 + {09D9D1D6-2951-4E14-BC35-76A23CF9391A}.NativeRelease|x86.ActiveCfg = Release|Win32 + {09D9D1D6-2951-4E14-BC35-76A23CF9391A}.NativeRelease|x86.Build.0 = Release|Win32 {09D9D1D6-2951-4E14-BC35-76A23CF9391A}.Release|Any CPU.ActiveCfg = Release|Win32 {09D9D1D6-2951-4E14-BC35-76A23CF9391A}.Release|x64.ActiveCfg = Release|x64 {09D9D1D6-2951-4E14-BC35-76A23CF9391A}.Release|x64.Build.0 = Release|x64 @@ -320,6 +466,14 @@ Global {42E60F88-E23F-417A-8143-0CCEC05E1D02}.Debug|x64.Build.0 = Debug|x64 {42E60F88-E23F-417A-8143-0CCEC05E1D02}.Debug|x86.ActiveCfg = Debug|x86 {42E60F88-E23F-417A-8143-0CCEC05E1D02}.Debug|x86.Build.0 = Debug|x86 + {42E60F88-E23F-417A-8143-0CCEC05E1D02}.NativeDebug|Any CPU.ActiveCfg = Debug|x64 + {42E60F88-E23F-417A-8143-0CCEC05E1D02}.NativeDebug|Any CPU.Build.0 = Debug|x64 + {42E60F88-E23F-417A-8143-0CCEC05E1D02}.NativeDebug|x64.ActiveCfg = Debug|x64 + {42E60F88-E23F-417A-8143-0CCEC05E1D02}.NativeDebug|x86.ActiveCfg = Debug|x86 + {42E60F88-E23F-417A-8143-0CCEC05E1D02}.NativeRelease|Any CPU.ActiveCfg = Release|x64 + {42E60F88-E23F-417A-8143-0CCEC05E1D02}.NativeRelease|Any CPU.Build.0 = Release|x64 + {42E60F88-E23F-417A-8143-0CCEC05E1D02}.NativeRelease|x64.ActiveCfg = Release|x64 + {42E60F88-E23F-417A-8143-0CCEC05E1D02}.NativeRelease|x86.ActiveCfg = Release|x86 {42E60F88-E23F-417A-8143-0CCEC05E1D02}.Release|Any CPU.ActiveCfg = Release|x64 {42E60F88-E23F-417A-8143-0CCEC05E1D02}.Release|Any CPU.Build.0 = Release|x64 {42E60F88-E23F-417A-8143-0CCEC05E1D02}.Release|x64.ActiveCfg = Release|x64 @@ -332,6 +486,14 @@ Global {48F46909-E76A-4788-BCE1-E543C0E140FE}.Debug|x64.Build.0 = Debug|Any CPU {48F46909-E76A-4788-BCE1-E543C0E140FE}.Debug|x86.ActiveCfg = Debug|Any CPU {48F46909-E76A-4788-BCE1-E543C0E140FE}.Debug|x86.Build.0 = Debug|Any CPU + {48F46909-E76A-4788-BCE1-E543C0E140FE}.NativeDebug|Any CPU.ActiveCfg = Debug|Any CPU + {48F46909-E76A-4788-BCE1-E543C0E140FE}.NativeDebug|Any CPU.Build.0 = Debug|Any CPU + {48F46909-E76A-4788-BCE1-E543C0E140FE}.NativeDebug|x64.ActiveCfg = Debug|Any CPU + {48F46909-E76A-4788-BCE1-E543C0E140FE}.NativeDebug|x86.ActiveCfg = Debug|Any CPU + {48F46909-E76A-4788-BCE1-E543C0E140FE}.NativeRelease|Any CPU.ActiveCfg = Release|Any CPU + {48F46909-E76A-4788-BCE1-E543C0E140FE}.NativeRelease|Any CPU.Build.0 = Release|Any CPU + {48F46909-E76A-4788-BCE1-E543C0E140FE}.NativeRelease|x64.ActiveCfg = Release|Any CPU + {48F46909-E76A-4788-BCE1-E543C0E140FE}.NativeRelease|x86.ActiveCfg = Release|Any CPU {48F46909-E76A-4788-BCE1-E543C0E140FE}.Release|Any CPU.ActiveCfg = Release|Any CPU {48F46909-E76A-4788-BCE1-E543C0E140FE}.Release|Any CPU.Build.0 = Release|Any CPU {48F46909-E76A-4788-BCE1-E543C0E140FE}.Release|x64.ActiveCfg = Release|Any CPU @@ -343,6 +505,16 @@ Global {D57EA297-6DC2-4BC0-8C91-334863327863}.Debug|x64.Build.0 = Debug|x64 {D57EA297-6DC2-4BC0-8C91-334863327863}.Debug|x86.ActiveCfg = Debug|Win32 {D57EA297-6DC2-4BC0-8C91-334863327863}.Debug|x86.Build.0 = Debug|Win32 + {D57EA297-6DC2-4BC0-8C91-334863327863}.NativeDebug|Any CPU.ActiveCfg = Debug|Win32 + {D57EA297-6DC2-4BC0-8C91-334863327863}.NativeDebug|x64.ActiveCfg = Debug|x64 + {D57EA297-6DC2-4BC0-8C91-334863327863}.NativeDebug|x64.Build.0 = Debug|x64 + {D57EA297-6DC2-4BC0-8C91-334863327863}.NativeDebug|x86.ActiveCfg = Debug|Win32 + {D57EA297-6DC2-4BC0-8C91-334863327863}.NativeDebug|x86.Build.0 = Debug|Win32 + {D57EA297-6DC2-4BC0-8C91-334863327863}.NativeRelease|Any CPU.ActiveCfg = Release|Win32 + {D57EA297-6DC2-4BC0-8C91-334863327863}.NativeRelease|x64.ActiveCfg = Release|x64 + {D57EA297-6DC2-4BC0-8C91-334863327863}.NativeRelease|x64.Build.0 = Release|x64 + {D57EA297-6DC2-4BC0-8C91-334863327863}.NativeRelease|x86.ActiveCfg = Release|Win32 + {D57EA297-6DC2-4BC0-8C91-334863327863}.NativeRelease|x86.Build.0 = Release|Win32 {D57EA297-6DC2-4BC0-8C91-334863327863}.Release|Any CPU.ActiveCfg = Release|Win32 {D57EA297-6DC2-4BC0-8C91-334863327863}.Release|x64.ActiveCfg = Release|x64 {D57EA297-6DC2-4BC0-8C91-334863327863}.Release|x64.Build.0 = Release|x64 @@ -353,6 +525,16 @@ Global {7F87406C-A3C8-4139-A68D-E4C344294A67}.Debug|x64.Build.0 = Debug|x64 {7F87406C-A3C8-4139-A68D-E4C344294A67}.Debug|x86.ActiveCfg = Debug|Win32 {7F87406C-A3C8-4139-A68D-E4C344294A67}.Debug|x86.Build.0 = Debug|Win32 + {7F87406C-A3C8-4139-A68D-E4C344294A67}.NativeDebug|Any CPU.ActiveCfg = Debug|Win32 + {7F87406C-A3C8-4139-A68D-E4C344294A67}.NativeDebug|x64.ActiveCfg = Debug|x64 + {7F87406C-A3C8-4139-A68D-E4C344294A67}.NativeDebug|x64.Build.0 = Debug|x64 + {7F87406C-A3C8-4139-A68D-E4C344294A67}.NativeDebug|x86.ActiveCfg = Debug|Win32 + {7F87406C-A3C8-4139-A68D-E4C344294A67}.NativeDebug|x86.Build.0 = Debug|Win32 + {7F87406C-A3C8-4139-A68D-E4C344294A67}.NativeRelease|Any CPU.ActiveCfg = Release|Win32 + {7F87406C-A3C8-4139-A68D-E4C344294A67}.NativeRelease|x64.ActiveCfg = Release|x64 + {7F87406C-A3C8-4139-A68D-E4C344294A67}.NativeRelease|x64.Build.0 = Release|x64 + {7F87406C-A3C8-4139-A68D-E4C344294A67}.NativeRelease|x86.ActiveCfg = Release|Win32 + {7F87406C-A3C8-4139-A68D-E4C344294A67}.NativeRelease|x86.Build.0 = Release|Win32 {7F87406C-A3C8-4139-A68D-E4C344294A67}.Release|Any CPU.ActiveCfg = Release|Win32 {7F87406C-A3C8-4139-A68D-E4C344294A67}.Release|x64.ActiveCfg = Release|x64 {7F87406C-A3C8-4139-A68D-E4C344294A67}.Release|x64.Build.0 = Release|x64 @@ -363,6 +545,12 @@ Global {340C59FC-C682-4CBA-81F8-791821EC8EDE}.Debug|x64.Build.0 = Debug|x64 {340C59FC-C682-4CBA-81F8-791821EC8EDE}.Debug|x86.ActiveCfg = Debug|x86 {340C59FC-C682-4CBA-81F8-791821EC8EDE}.Debug|x86.Build.0 = Debug|x86 + {340C59FC-C682-4CBA-81F8-791821EC8EDE}.NativeDebug|Any CPU.ActiveCfg = Debug|x86 + {340C59FC-C682-4CBA-81F8-791821EC8EDE}.NativeDebug|x64.ActiveCfg = Debug|x64 + {340C59FC-C682-4CBA-81F8-791821EC8EDE}.NativeDebug|x86.ActiveCfg = Debug|x86 + {340C59FC-C682-4CBA-81F8-791821EC8EDE}.NativeRelease|Any CPU.ActiveCfg = Release|x86 + {340C59FC-C682-4CBA-81F8-791821EC8EDE}.NativeRelease|x64.ActiveCfg = Release|x64 + {340C59FC-C682-4CBA-81F8-791821EC8EDE}.NativeRelease|x86.ActiveCfg = Release|x86 {340C59FC-C682-4CBA-81F8-791821EC8EDE}.Release|Any CPU.ActiveCfg = Release|x86 {340C59FC-C682-4CBA-81F8-791821EC8EDE}.Release|x64.ActiveCfg = Release|x64 {340C59FC-C682-4CBA-81F8-791821EC8EDE}.Release|x64.Build.0 = Release|x64 @@ -373,6 +561,16 @@ Global {CAC1267B-8778-4257-AAC6-CAF481723B01}.Debug|x64.Build.0 = Debug|x64 {CAC1267B-8778-4257-AAC6-CAF481723B01}.Debug|x86.ActiveCfg = Debug|Win32 {CAC1267B-8778-4257-AAC6-CAF481723B01}.Debug|x86.Build.0 = Debug|Win32 + {CAC1267B-8778-4257-AAC6-CAF481723B01}.NativeDebug|Any CPU.ActiveCfg = Debug|Win32 + {CAC1267B-8778-4257-AAC6-CAF481723B01}.NativeDebug|x64.ActiveCfg = Debug|x64 + {CAC1267B-8778-4257-AAC6-CAF481723B01}.NativeDebug|x64.Build.0 = Debug|x64 + {CAC1267B-8778-4257-AAC6-CAF481723B01}.NativeDebug|x86.ActiveCfg = Debug|Win32 + {CAC1267B-8778-4257-AAC6-CAF481723B01}.NativeDebug|x86.Build.0 = Debug|Win32 + {CAC1267B-8778-4257-AAC6-CAF481723B01}.NativeRelease|Any CPU.ActiveCfg = Release|Win32 + {CAC1267B-8778-4257-AAC6-CAF481723B01}.NativeRelease|x64.ActiveCfg = Release|x64 + {CAC1267B-8778-4257-AAC6-CAF481723B01}.NativeRelease|x64.Build.0 = Release|x64 + {CAC1267B-8778-4257-AAC6-CAF481723B01}.NativeRelease|x86.ActiveCfg = Release|Win32 + {CAC1267B-8778-4257-AAC6-CAF481723B01}.NativeRelease|x86.Build.0 = Release|Win32 {CAC1267B-8778-4257-AAC6-CAF481723B01}.Release|Any CPU.ActiveCfg = Release|Win32 {CAC1267B-8778-4257-AAC6-CAF481723B01}.Release|x64.ActiveCfg = Release|x64 {CAC1267B-8778-4257-AAC6-CAF481723B01}.Release|x64.Build.0 = Release|x64 @@ -383,6 +581,16 @@ Global {1533E271-F61B-441B-8B74-59FB61DF0552}.Debug|x64.Build.0 = Debug|x64 {1533E271-F61B-441B-8B74-59FB61DF0552}.Debug|x86.ActiveCfg = Debug|Win32 {1533E271-F61B-441B-8B74-59FB61DF0552}.Debug|x86.Build.0 = Debug|Win32 + {1533E271-F61B-441B-8B74-59FB61DF0552}.NativeDebug|Any CPU.ActiveCfg = Debug|Win32 + {1533E271-F61B-441B-8B74-59FB61DF0552}.NativeDebug|x64.ActiveCfg = Debug|x64 + {1533E271-F61B-441B-8B74-59FB61DF0552}.NativeDebug|x64.Build.0 = Debug|x64 + {1533E271-F61B-441B-8B74-59FB61DF0552}.NativeDebug|x86.ActiveCfg = Debug|Win32 + {1533E271-F61B-441B-8B74-59FB61DF0552}.NativeDebug|x86.Build.0 = Debug|Win32 + {1533E271-F61B-441B-8B74-59FB61DF0552}.NativeRelease|Any CPU.ActiveCfg = Release|Win32 + {1533E271-F61B-441B-8B74-59FB61DF0552}.NativeRelease|x64.ActiveCfg = Release|x64 + {1533E271-F61B-441B-8B74-59FB61DF0552}.NativeRelease|x64.Build.0 = Release|x64 + {1533E271-F61B-441B-8B74-59FB61DF0552}.NativeRelease|x86.ActiveCfg = Release|Win32 + {1533E271-F61B-441B-8B74-59FB61DF0552}.NativeRelease|x86.Build.0 = Release|Win32 {1533E271-F61B-441B-8B74-59FB61DF0552}.Release|Any CPU.ActiveCfg = Release|Win32 {1533E271-F61B-441B-8B74-59FB61DF0552}.Release|x64.ActiveCfg = Release|x64 {1533E271-F61B-441B-8B74-59FB61DF0552}.Release|x64.Build.0 = Release|x64 @@ -394,6 +602,14 @@ Global {1F0C8D9B-F47B-41F3-9FC9-6954B6DC7712}.Debug|x64.Build.0 = Debug|Any CPU {1F0C8D9B-F47B-41F3-9FC9-6954B6DC7712}.Debug|x86.ActiveCfg = Debug|Any CPU {1F0C8D9B-F47B-41F3-9FC9-6954B6DC7712}.Debug|x86.Build.0 = Debug|Any CPU + {1F0C8D9B-F47B-41F3-9FC9-6954B6DC7712}.NativeDebug|Any CPU.ActiveCfg = Debug|Any CPU + {1F0C8D9B-F47B-41F3-9FC9-6954B6DC7712}.NativeDebug|Any CPU.Build.0 = Debug|Any CPU + {1F0C8D9B-F47B-41F3-9FC9-6954B6DC7712}.NativeDebug|x64.ActiveCfg = Debug|Any CPU + {1F0C8D9B-F47B-41F3-9FC9-6954B6DC7712}.NativeDebug|x86.ActiveCfg = Debug|Any CPU + {1F0C8D9B-F47B-41F3-9FC9-6954B6DC7712}.NativeRelease|Any CPU.ActiveCfg = Release|Any CPU + {1F0C8D9B-F47B-41F3-9FC9-6954B6DC7712}.NativeRelease|Any CPU.Build.0 = Release|Any CPU + {1F0C8D9B-F47B-41F3-9FC9-6954B6DC7712}.NativeRelease|x64.ActiveCfg = Release|Any CPU + {1F0C8D9B-F47B-41F3-9FC9-6954B6DC7712}.NativeRelease|x86.ActiveCfg = Release|Any CPU {1F0C8D9B-F47B-41F3-9FC9-6954B6DC7712}.Release|Any CPU.ActiveCfg = Release|Any CPU {1F0C8D9B-F47B-41F3-9FC9-6954B6DC7712}.Release|Any CPU.Build.0 = Release|Any CPU {1F0C8D9B-F47B-41F3-9FC9-6954B6DC7712}.Release|x64.ActiveCfg = Release|Any CPU @@ -406,6 +622,14 @@ Global {CE4FB142-91FB-4B34-BC96-A31120EF4009}.Debug|x64.Build.0 = Debug|Any CPU {CE4FB142-91FB-4B34-BC96-A31120EF4009}.Debug|x86.ActiveCfg = Debug|Any CPU {CE4FB142-91FB-4B34-BC96-A31120EF4009}.Debug|x86.Build.0 = Debug|Any CPU + {CE4FB142-91FB-4B34-BC96-A31120EF4009}.NativeDebug|Any CPU.ActiveCfg = Debug|Any CPU + {CE4FB142-91FB-4B34-BC96-A31120EF4009}.NativeDebug|Any CPU.Build.0 = Debug|Any CPU + {CE4FB142-91FB-4B34-BC96-A31120EF4009}.NativeDebug|x64.ActiveCfg = Debug|Any CPU + {CE4FB142-91FB-4B34-BC96-A31120EF4009}.NativeDebug|x86.ActiveCfg = Debug|Any CPU + {CE4FB142-91FB-4B34-BC96-A31120EF4009}.NativeRelease|Any CPU.ActiveCfg = Release|Any CPU + {CE4FB142-91FB-4B34-BC96-A31120EF4009}.NativeRelease|Any CPU.Build.0 = Release|Any CPU + {CE4FB142-91FB-4B34-BC96-A31120EF4009}.NativeRelease|x64.ActiveCfg = Release|Any CPU + {CE4FB142-91FB-4B34-BC96-A31120EF4009}.NativeRelease|x86.ActiveCfg = Release|Any CPU {CE4FB142-91FB-4B34-BC96-A31120EF4009}.Release|Any CPU.ActiveCfg = Release|Any CPU {CE4FB142-91FB-4B34-BC96-A31120EF4009}.Release|Any CPU.Build.0 = Release|Any CPU {CE4FB142-91FB-4B34-BC96-A31120EF4009}.Release|x64.ActiveCfg = Release|Any CPU @@ -418,6 +642,14 @@ Global {A091777D-66B3-42E1-B95C-85322DE40706}.Debug|x64.Build.0 = Debug|Any CPU {A091777D-66B3-42E1-B95C-85322DE40706}.Debug|x86.ActiveCfg = Debug|Any CPU {A091777D-66B3-42E1-B95C-85322DE40706}.Debug|x86.Build.0 = Debug|Any CPU + {A091777D-66B3-42E1-B95C-85322DE40706}.NativeDebug|Any CPU.ActiveCfg = Debug|Any CPU + {A091777D-66B3-42E1-B95C-85322DE40706}.NativeDebug|Any CPU.Build.0 = Debug|Any CPU + {A091777D-66B3-42E1-B95C-85322DE40706}.NativeDebug|x64.ActiveCfg = Debug|Any CPU + {A091777D-66B3-42E1-B95C-85322DE40706}.NativeDebug|x86.ActiveCfg = Debug|Any CPU + {A091777D-66B3-42E1-B95C-85322DE40706}.NativeRelease|Any CPU.ActiveCfg = Release|Any CPU + {A091777D-66B3-42E1-B95C-85322DE40706}.NativeRelease|Any CPU.Build.0 = Release|Any CPU + {A091777D-66B3-42E1-B95C-85322DE40706}.NativeRelease|x64.ActiveCfg = Release|Any CPU + {A091777D-66B3-42E1-B95C-85322DE40706}.NativeRelease|x86.ActiveCfg = Release|Any CPU {A091777D-66B3-42E1-B95C-85322DE40706}.Release|Any CPU.ActiveCfg = Release|Any CPU {A091777D-66B3-42E1-B95C-85322DE40706}.Release|Any CPU.Build.0 = Release|Any CPU {A091777D-66B3-42E1-B95C-85322DE40706}.Release|x64.ActiveCfg = Release|Any CPU @@ -430,6 +662,14 @@ Global {A641A208-2974-4E48-BCFF-54E3AAFA4FB9}.Debug|x64.Build.0 = Debug|Any CPU {A641A208-2974-4E48-BCFF-54E3AAFA4FB9}.Debug|x86.ActiveCfg = Debug|Any CPU {A641A208-2974-4E48-BCFF-54E3AAFA4FB9}.Debug|x86.Build.0 = Debug|Any CPU + {A641A208-2974-4E48-BCFF-54E3AAFA4FB9}.NativeDebug|Any CPU.ActiveCfg = Debug|Any CPU + {A641A208-2974-4E48-BCFF-54E3AAFA4FB9}.NativeDebug|Any CPU.Build.0 = Debug|Any CPU + {A641A208-2974-4E48-BCFF-54E3AAFA4FB9}.NativeDebug|x64.ActiveCfg = Debug|Any CPU + {A641A208-2974-4E48-BCFF-54E3AAFA4FB9}.NativeDebug|x86.ActiveCfg = Debug|Any CPU + {A641A208-2974-4E48-BCFF-54E3AAFA4FB9}.NativeRelease|Any CPU.ActiveCfg = Release|Any CPU + {A641A208-2974-4E48-BCFF-54E3AAFA4FB9}.NativeRelease|Any CPU.Build.0 = Release|Any CPU + {A641A208-2974-4E48-BCFF-54E3AAFA4FB9}.NativeRelease|x64.ActiveCfg = Release|Any CPU + {A641A208-2974-4E48-BCFF-54E3AAFA4FB9}.NativeRelease|x86.ActiveCfg = Release|Any CPU {A641A208-2974-4E48-BCFF-54E3AAFA4FB9}.Release|Any CPU.ActiveCfg = Release|Any CPU {A641A208-2974-4E48-BCFF-54E3AAFA4FB9}.Release|Any CPU.Build.0 = Release|Any CPU {A641A208-2974-4E48-BCFF-54E3AAFA4FB9}.Release|x64.ActiveCfg = Release|Any CPU diff --git a/build/repo.targets b/build/repo.targets index 27117d706f..5fe12660fe 100644 --- a/build/repo.targets +++ b/build/repo.targets @@ -47,11 +47,11 @@ - -p:Configuration=$(Configuration) -v:m -nologo -clp:NoSummary -p:CommitHash=$(CommitHash) + -p:Configuration=Native$(Configuration) -v:m -nologo -clp:NoSummary -p:CommitHash=$(CommitHash) -m - + + + -p:Configuration=$(Configuration) -v:m -nologo -clp:NoSummary + From 8ea2cd90819bdf9ac11fac5ce41bd3fa73fb0ea0 Mon Sep 17 00:00:00 2001 From: Pavel Krymets Date: Wed, 1 Aug 2018 15:40:45 -0700 Subject: [PATCH 7/8] Ship shim with integration testing (#1129) --- build/assets.props | 269 ++++++++++++++++++ build/launchSettings.json | 8 +- build/repo.targets | 40 +-- build/testsite.props | 36 +-- .../Properties/launchSettings.json | 8 +- .../Microsoft.AspNetCore.Server.IIS.csproj | 42 ++- .../IISApplication.cs | 14 +- .../IISDeployer.cs | 2 +- .../IISDeployerBase.cs | 12 +- .../IISDeploymentParameterExtensions.cs | 9 +- .../IISDeploymentParameters.cs | 16 +- .../IISExpressDeployer.cs | 21 +- ...tCore.Server.IntegrationTesting.IIS.csproj | 32 ++- .../WebConfigHelpers.cs | 10 +- .../IIS.FunctionalTests.csproj | 11 +- test/IIS.Tests/IIS.Tests.csproj | 11 +- .../IISExpress.FunctionalTests.csproj | 11 +- .../OutOfProcess/GlobalVersionTests.cs | 43 ++- .../InProcessWebSite/InProcessWebSite.csproj | 6 +- .../Properties/launchSettings.json | 8 +- .../Properties/launchSettings.json | 8 +- .../OverriddenServerWebSite.csproj | 5 +- .../Properties/launchSettings.json | 8 +- .../Properties/launchSettings.json | 8 +- .../StartupExceptionWebSite.csproj | 5 +- .../Properties/launchSettings.json | 8 +- .../StressTestWebSite.csproj | 1 + tools/GenerateNativeAssets.ps1 | 150 ++++++++++ 28 files changed, 636 insertions(+), 166 deletions(-) create mode 100644 build/assets.props create mode 100644 tools/GenerateNativeAssets.ps1 diff --git a/build/assets.props b/build/assets.props new file mode 100644 index 0000000000..13b30556bd --- /dev/null +++ b/build/assets.props @@ -0,0 +1,269 @@ + + + + true + x64 + $(Platform) + Win32 + $(NativePlatform) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + $(MSBuildThisFileDirectory)..\src\AspNetCoreModuleV1\AspNetCore\bin\$(Configuration)\$(NativeVCPlatform)\aspnetcore.dll + $(MSBuildThisFileDirectory)..\src\AspNetCoreModuleV2\AspNetCore\bin\$(Configuration)\$(NativeVCPlatform)\aspnetcorev2.dll + $(MSBuildThisFileDirectory)..\src\AspNetCoreModuleV2\InProcessRequestHandler\bin\$(Configuration)\$(NativeVCPlatform)\aspnetcorev2_inprocess.dll + $(MSBuildThisFileDirectory)..\src\AspNetCoreModuleV2\OutOfProcessRequestHandler\bin\$(Configuration)\$(NativeVCPlatform)\aspnetcorev2_outofprocess.dll + + diff --git a/build/launchSettings.json b/build/launchSettings.json index 943d2ad712..8cd1df05e6 100644 --- a/build/launchSettings.json +++ b/build/launchSettings.json @@ -15,8 +15,8 @@ "nativeDebugging": true, "environmentVariables": { "IIS_SITE_PATH": "$(MSBuildThisFileDirectory)", - "ANCM_PATH": "$(TargetDir)$(AncmPath)", - "ANCMV2_PATH": "$(TargetDir)$(AncmV2Path)", + "ANCM_PATH": "$(AncmPath)", + "ANCMV2_PATH": "$(AncmV2Path)", "LAUNCHER_ARGS": "$(TargetPath)", "ASPNETCORE_ENVIRONMENT": "Development", "LAUNCHER_PATH": "$(DotNetPath)", @@ -29,8 +29,8 @@ "commandLineArgs": "$(IISArguments)", "environmentVariables": { "IIS_SITE_PATH": "$(MSBuildThisFileDirectory)", - "ANCM_PATH": "$(TargetDir)$(AncmPath)", - "ANCMV2_PATH": "$(TargetDir)$(AncmV2Path)", + "ANCM_PATH": "$(AncmPath)", + "ANCMV2_PATH": "$(AncmV2Path)", "LAUNCHER_ARGS": "$(TargetPath)", "ASPNETCORE_ENVIRONMENT": "Development", "LAUNCHER_PATH": "$(DotNetPath)", diff --git a/build/repo.targets b/build/repo.targets index 5fe12660fe..5a2620ec75 100644 --- a/build/repo.targets +++ b/build/repo.targets @@ -1,7 +1,7 @@ - InitializeComponents;$(PrepareDependsOn) + $(PrepareDependsOn) $(GetArtifactInfoDependsOn);GetNativeArtifactsInfo BuildNativeAssets;$(CompileDependsOn) $(PackageDependsOn);PackageNativeProjects @@ -14,36 +14,8 @@ - - - - - - - - - - - - - - - + + @@ -62,7 +34,7 @@ Condition="'$(VisualStudioMSBuildx86Path)' != ''" /> - + NuGetPackage @@ -116,8 +88,8 @@ BasePath="$(RepositoryRoot)" /> - - + + diff --git a/build/testsite.props b/build/testsite.props index 3f84d67f31..d412ac84b3 100644 --- a/build/testsite.props +++ b/build/testsite.props @@ -5,11 +5,11 @@ x64;x86 $(MSBuildThisFileDirectory)applicationhost.config $(MSBuildThisFileDirectory)applicationhost.iis.config - x64 - $(Platform) false - + + + $(MSBuildProgramFiles32)\IIS Express\iisexpress.exe $(SystemRoot)\SysWOW64\inetsrv\w3wp.exe @@ -22,30 +22,21 @@ x64 + - $(NativePlatform)\ - + - - - - - - - - - - - + /config:"$(IISExpressAppHostConfig)" /systray:false -h "$(IISAppHostConfig)" - $(NativePlatform)\aspnetcore.dll - $(NativePlatform)\aspnetcorev2.dll + $(AspNetCoreModuleV1ShimDll) + $(AspNetCoreModuleV2ShimDll) $(NativePlatform)\aspnetcorev2_inprocess.dll $(userprofile)\.dotnet\$(NativePlatform)\dotnet.exe @@ -62,8 +53,7 @@ - - + $(MSBuildThisFileDirectory)..\test\TestTasks\bin\$(Configuration)\$(TargetFramework)\TestTasks $(InjectDepsAssembly) @@ -82,11 +72,11 @@ - + - + diff --git a/samples/NativeIISSample/Properties/launchSettings.json b/samples/NativeIISSample/Properties/launchSettings.json index 943d2ad712..8cd1df05e6 100644 --- a/samples/NativeIISSample/Properties/launchSettings.json +++ b/samples/NativeIISSample/Properties/launchSettings.json @@ -15,8 +15,8 @@ "nativeDebugging": true, "environmentVariables": { "IIS_SITE_PATH": "$(MSBuildThisFileDirectory)", - "ANCM_PATH": "$(TargetDir)$(AncmPath)", - "ANCMV2_PATH": "$(TargetDir)$(AncmV2Path)", + "ANCM_PATH": "$(AncmPath)", + "ANCMV2_PATH": "$(AncmV2Path)", "LAUNCHER_ARGS": "$(TargetPath)", "ASPNETCORE_ENVIRONMENT": "Development", "LAUNCHER_PATH": "$(DotNetPath)", @@ -29,8 +29,8 @@ "commandLineArgs": "$(IISArguments)", "environmentVariables": { "IIS_SITE_PATH": "$(MSBuildThisFileDirectory)", - "ANCM_PATH": "$(TargetDir)$(AncmPath)", - "ANCMV2_PATH": "$(TargetDir)$(AncmV2Path)", + "ANCM_PATH": "$(AncmPath)", + "ANCMV2_PATH": "$(AncmV2Path)", "LAUNCHER_ARGS": "$(TargetPath)", "ASPNETCORE_ENVIRONMENT": "Development", "LAUNCHER_PATH": "$(DotNetPath)", diff --git a/src/Microsoft.AspNetCore.Server.IIS/Microsoft.AspNetCore.Server.IIS.csproj b/src/Microsoft.AspNetCore.Server.IIS/Microsoft.AspNetCore.Server.IIS.csproj index c2fa16aa42..6025b459fb 100644 --- a/src/Microsoft.AspNetCore.Server.IIS/Microsoft.AspNetCore.Server.IIS.csproj +++ b/src/Microsoft.AspNetCore.Server.IIS/Microsoft.AspNetCore.Server.IIS.csproj @@ -12,6 +12,8 @@ netcoreapp2.2 + + @@ -23,12 +25,40 @@ - - - - + - - + + + + + + + + + + + + + + + + + + + diff --git a/src/Microsoft.AspNetCore.Server.IntegrationTesting.IIS/IISApplication.cs b/src/Microsoft.AspNetCore.Server.IntegrationTesting.IIS/IISApplication.cs index aa35ac92da..4a3caadd8e 100644 --- a/src/Microsoft.AspNetCore.Server.IntegrationTesting.IIS/IISApplication.cs +++ b/src/Microsoft.AspNetCore.Server.IntegrationTesting.IIS/IISApplication.cs @@ -5,6 +5,7 @@ using System; using System.Diagnostics; using System.IO; using System.Linq; +using System.Reflection; using System.Runtime.InteropServices; using System.Threading.Tasks; using System.Xml.Linq; @@ -71,7 +72,7 @@ namespace Microsoft.AspNetCore.Server.IntegrationTesting ConfigureSite(contentRoot, port); - ConfigureAppHostConfig(contentRoot); + ConfigureAppHostConfig(); _serverManager.CommitChanges(); @@ -280,11 +281,11 @@ namespace Microsoft.AspNetCore.Server.IntegrationTesting return site; } - private Configuration ConfigureAppHostConfig(string dllRoot) + private Configuration ConfigureAppHostConfig() { var config = _serverManager.GetApplicationHostConfiguration(); - SetGlobalModuleSection(config, dllRoot); + SetGlobalModuleSection(config); SetModulesSection(config); @@ -305,9 +306,9 @@ namespace Microsoft.AspNetCore.Server.IntegrationTesting appPool.Stop(); } - private void SetGlobalModuleSection(Configuration config, string dllRoot) + private void SetGlobalModuleSection(Configuration config) { - var ancmFile = GetAncmLocation(dllRoot); + var ancmFile = GetAncmLocation(); var globalModulesSection = config.GetSection("system.webServer/globalModules"); var globalConfigElement = globalModulesSection @@ -355,8 +356,9 @@ namespace Microsoft.AspNetCore.Server.IntegrationTesting } } - private string GetAncmLocation(string dllRoot) + private string GetAncmLocation() { + var dllRoot = AppContext.BaseDirectory; var arch = _deploymentParameters.RuntimeArchitecture == RuntimeArchitecture.x64 ? $@"x64\{_ancmDllName}" : $@"x86\{_ancmDllName}"; var ancmFile = Path.Combine(dllRoot, arch); if (!File.Exists(Environment.ExpandEnvironmentVariables(ancmFile))) diff --git a/src/Microsoft.AspNetCore.Server.IntegrationTesting.IIS/IISDeployer.cs b/src/Microsoft.AspNetCore.Server.IntegrationTesting.IIS/IISDeployer.cs index ffbc8ba034..4e6c71c1c4 100644 --- a/src/Microsoft.AspNetCore.Server.IntegrationTesting.IIS/IISDeployer.cs +++ b/src/Microsoft.AspNetCore.Server.IntegrationTesting.IIS/IISDeployer.cs @@ -77,7 +77,7 @@ namespace Microsoft.AspNetCore.Server.IntegrationTesting.IIS DefaultWebConfigActions.Add(WebConfigHelpers.AddOrModifyHandlerSection( key: "modules", value: DeploymentParameters.AncmVersion.ToString())); - RunWebConfigActions(); + RunWebConfigActions(contentRoot); } var uri = TestUriHelper.BuildTestUri(ServerType.IIS, DeploymentParameters.ApplicationBaseUriHint); diff --git a/src/Microsoft.AspNetCore.Server.IntegrationTesting.IIS/IISDeployerBase.cs b/src/Microsoft.AspNetCore.Server.IntegrationTesting.IIS/IISDeployerBase.cs index 5042a192e3..8dcc3e135e 100644 --- a/src/Microsoft.AspNetCore.Server.IntegrationTesting.IIS/IISDeployerBase.cs +++ b/src/Microsoft.AspNetCore.Server.IntegrationTesting.IIS/IISDeployerBase.cs @@ -16,7 +16,7 @@ namespace Microsoft.AspNetCore.Server.IntegrationTesting.IIS { public IISDeploymentParameters IISDeploymentParameters { get; } - protected List> DefaultWebConfigActions { get; } = new List>(); + protected List> DefaultWebConfigActions { get; } = new List>(); public IISDeployerBase(IISDeploymentParameters deploymentParameters, ILoggerFactory loggerFactory) : base(deploymentParameters, loggerFactory) @@ -24,7 +24,7 @@ namespace Microsoft.AspNetCore.Server.IntegrationTesting.IIS IISDeploymentParameters = deploymentParameters; } - public void RunWebConfigActions() + public void RunWebConfigActions(string contentRoot) { if (IISDeploymentParameters == null) { @@ -42,19 +42,19 @@ namespace Microsoft.AspNetCore.Server.IntegrationTesting.IIS foreach (var action in DefaultWebConfigActions) { - action.Invoke(xElement); + action.Invoke(xElement, contentRoot); } foreach (var action in IISDeploymentParameters.WebConfigActionList) { - action.Invoke(xElement); + action.Invoke(xElement, contentRoot); } webconfig.Save(path); } - public string RunServerConfigActions(string serverConfigString) + public string RunServerConfigActions(string serverConfigString, string contentRoot) { if (IISDeploymentParameters == null) { @@ -66,7 +66,7 @@ namespace Microsoft.AspNetCore.Server.IntegrationTesting.IIS foreach (var action in IISDeploymentParameters.ServerConfigActionList) { - action.Invoke(xElement); + action.Invoke(xElement, contentRoot); } return xElement.ToString(); } diff --git a/src/Microsoft.AspNetCore.Server.IntegrationTesting.IIS/IISDeploymentParameterExtensions.cs b/src/Microsoft.AspNetCore.Server.IntegrationTesting.IIS/IISDeploymentParameterExtensions.cs index ff2365a82a..f1e90f1a24 100644 --- a/src/Microsoft.AspNetCore.Server.IntegrationTesting.IIS/IISDeploymentParameterExtensions.cs +++ b/src/Microsoft.AspNetCore.Server.IntegrationTesting.IIS/IISDeploymentParameterExtensions.cs @@ -16,13 +16,18 @@ namespace Microsoft.AspNetCore.Server.IntegrationTesting.IIS } public static void AddServerConfigAction(this IISDeploymentParameters parameters, Action action) + { + parameters.ServerConfigActionList.Add((config, _) => action(config)); + } + + public static void AddServerConfigAction(this IISDeploymentParameters parameters, Action action) { parameters.ServerConfigActionList.Add(action); } public static void AddHttpsToServerConfig(this IISDeploymentParameters parameters) { - parameters.ServerConfigActionList.Add( + parameters.AddServerConfigAction( element => { element.Descendants("binding") @@ -37,7 +42,7 @@ namespace Microsoft.AspNetCore.Server.IntegrationTesting.IIS public static void AddWindowsAuthToServerConfig(this IISDeploymentParameters parameters) { - parameters.ServerConfigActionList.Add( + parameters.AddServerConfigAction( element => { element.Descendants("windowsAuthentication") diff --git a/src/Microsoft.AspNetCore.Server.IntegrationTesting.IIS/IISDeploymentParameters.cs b/src/Microsoft.AspNetCore.Server.IntegrationTesting.IIS/IISDeploymentParameters.cs index a22116d557..8d96236295 100644 --- a/src/Microsoft.AspNetCore.Server.IntegrationTesting.IIS/IISDeploymentParameters.cs +++ b/src/Microsoft.AspNetCore.Server.IntegrationTesting.IIS/IISDeploymentParameters.cs @@ -48,14 +48,14 @@ namespace Microsoft.AspNetCore.Server.IntegrationTesting.IIS } } - private IList> CreateDefaultWebConfigActionList() + private IList> CreateDefaultWebConfigActionList() { - return new List>() { AddWebConfigEnvironmentVariables(), AddHandlerSettings() }; + return new List>() { AddWebConfigEnvironmentVariables(), AddHandlerSettings() }; } - public IList> WebConfigActionList { get; } + public IList> WebConfigActionList { get; } - public IList> ServerConfigActionList { get; } = new List>(); + public IList> ServerConfigActionList { get; } = new List>(); public IDictionary WebConfigBasedEnvironmentVariables { get; set; } = new Dictionary(); @@ -63,9 +63,9 @@ namespace Microsoft.AspNetCore.Server.IntegrationTesting.IIS public bool GracefulShutdown { get; set; } - private Action AddWebConfigEnvironmentVariables() + private Action AddWebConfigEnvironmentVariables() { - return xElement => + return (xElement, _) => { if (WebConfigBasedEnvironmentVariables.Count == 0) { @@ -86,9 +86,9 @@ namespace Microsoft.AspNetCore.Server.IntegrationTesting.IIS }; } - private Action AddHandlerSettings() + private Action AddHandlerSettings() { - return xElement => + return (xElement, _) => { if (HandlerSettings.Count == 0) { diff --git a/src/Microsoft.AspNetCore.Server.IntegrationTesting.IIS/IISExpressDeployer.cs b/src/Microsoft.AspNetCore.Server.IntegrationTesting.IIS/IISExpressDeployer.cs index 6d99edf0fd..ff02771ec0 100644 --- a/src/Microsoft.AspNetCore.Server.IntegrationTesting.IIS/IISExpressDeployer.cs +++ b/src/Microsoft.AspNetCore.Server.IntegrationTesting.IIS/IISExpressDeployer.cs @@ -6,6 +6,7 @@ using System.Diagnostics; using System.Globalization; using System.IO; using System.Linq; +using System.Reflection; using System.Runtime.InteropServices; using System.Text.RegularExpressions; using System.Threading; @@ -57,7 +58,6 @@ namespace Microsoft.AspNetCore.Server.IntegrationTesting.IIS { DotnetPublish(); contentRoot = DeploymentParameters.PublishedApplicationRootPath; - dllRoot = contentRoot; } else { @@ -93,7 +93,7 @@ namespace Microsoft.AspNetCore.Server.IntegrationTesting.IIS var testUri = TestUriHelper.BuildTestUri(ServerType.IISExpress, DeploymentParameters.ApplicationBaseUriHint); // Launch the host process. - var (actualUri, hostExitToken) = await StartIISExpressAsync(testUri, contentRoot, dllRoot); + var (actualUri, hostExitToken) = await StartIISExpressAsync(testUri, contentRoot); Logger.LogInformation("Application ready at URL: {appUrl}", actualUri); @@ -145,7 +145,7 @@ namespace Microsoft.AspNetCore.Server.IntegrationTesting.IIS return dllRoot; } - private async Task<(Uri url, CancellationToken hostExitToken)> StartIISExpressAsync(Uri uri, string contentRoot, string dllRoot) + private async Task<(Uri url, CancellationToken hostExitToken)> StartIISExpressAsync(Uri uri, string contentRoot) { using (Logger.BeginScope("StartIISExpress")) { @@ -156,7 +156,7 @@ namespace Microsoft.AspNetCore.Server.IntegrationTesting.IIS } Logger.LogInformation("Attempting to start IIS Express on port: {port}", port); - PrepareConfig(contentRoot, dllRoot, port); + PrepareConfig(contentRoot, port); var parameters = string.IsNullOrEmpty(DeploymentParameters.ServerConfigLocation) ? string.Format("/port:{0} /path:\"{1}\" /trace:error /systray:false", uri.Port, contentRoot) : @@ -257,7 +257,7 @@ namespace Microsoft.AspNetCore.Server.IntegrationTesting.IIS } } - private void PrepareConfig(string contentRoot, string dllRoot, int port) + private void PrepareConfig(string contentRoot, int port) { // Config is required. If not present then fall back to one we carry with us. if (string.IsNullOrEmpty(DeploymentParameters.ServerConfigTemplateContent)) @@ -273,8 +273,8 @@ namespace Microsoft.AspNetCore.Server.IntegrationTesting.IIS // Pass on the applicationhost.config to iis express. With this don't need to pass in the /path /port switches as they are in the applicationHost.config // We take a copy of the original specified applicationHost.Config to prevent modifying the one in the repo. - serverConfig = ModifyANCMPathInConfig(replaceFlag: "[ANCMPath]", dllName: "aspnetcore.dll", serverConfig, dllRoot); - serverConfig = ModifyANCMPathInConfig(replaceFlag: "[ANCMV2Path]", dllName: "aspnetcorev2.dll", serverConfig, dllRoot); + serverConfig = ModifyANCMPathInConfig(replaceFlag: "[ANCMPath]", dllName: "aspnetcore.dll", serverConfig); + serverConfig = ModifyANCMPathInConfig(replaceFlag: "[ANCMV2Path]", dllName: "aspnetcorev2.dll", serverConfig); serverConfig = ReplacePlaceholder(serverConfig, "[PORT]", port.ToString(CultureInfo.InvariantCulture)); serverConfig = ReplacePlaceholder(serverConfig, "[ApplicationPhysicalPath]", contentRoot); @@ -291,7 +291,7 @@ namespace Microsoft.AspNetCore.Server.IntegrationTesting.IIS value: DeploymentParameters.AncmVersion.ToString())); ModifyDotNetExePathInWebConfig(); serverConfig = RemoveRedundantElements(serverConfig); - RunWebConfigActions(); + RunWebConfigActions(contentRoot); } else { @@ -299,7 +299,7 @@ namespace Microsoft.AspNetCore.Server.IntegrationTesting.IIS serverConfig = ReplacePlaceholder(serverConfig, "[HostingModel]", DeploymentParameters.HostingModel.ToString()); serverConfig = ReplacePlaceholder(serverConfig, "[AspNetCoreModule]", DeploymentParameters.AncmVersion.ToString()); } - serverConfig = RunServerConfigActions(serverConfig); + serverConfig = RunServerConfigActions(serverConfig, contentRoot); DeploymentParameters.ServerConfigLocation = Path.GetTempFileName(); Logger.LogDebug("Saving Config to {configPath}", DeploymentParameters.ServerConfigLocation); @@ -317,8 +317,9 @@ namespace Microsoft.AspNetCore.Server.IntegrationTesting.IIS return content; } - private string ModifyANCMPathInConfig(string replaceFlag, string dllName, string serverConfig, string dllRoot) + private string ModifyANCMPathInConfig(string replaceFlag, string dllName, string serverConfig) { + var dllRoot = AppContext.BaseDirectory; if (serverConfig.Contains(replaceFlag)) { var arch = DeploymentParameters.RuntimeArchitecture == RuntimeArchitecture.x64 ? $@"x64\{dllName}" : $@"x86\{dllName}"; diff --git a/src/Microsoft.AspNetCore.Server.IntegrationTesting.IIS/Microsoft.AspNetCore.Server.IntegrationTesting.IIS.csproj b/src/Microsoft.AspNetCore.Server.IntegrationTesting.IIS/Microsoft.AspNetCore.Server.IntegrationTesting.IIS.csproj index 363de4e34f..766b470a50 100644 --- a/src/Microsoft.AspNetCore.Server.IntegrationTesting.IIS/Microsoft.AspNetCore.Server.IntegrationTesting.IIS.csproj +++ b/src/Microsoft.AspNetCore.Server.IntegrationTesting.IIS/Microsoft.AspNetCore.Server.IntegrationTesting.IIS.csproj @@ -9,14 +9,44 @@ aspnetcore;iis + + - + + + + + + + + + + + + + + + + + + + diff --git a/src/Microsoft.AspNetCore.Server.IntegrationTesting.IIS/WebConfigHelpers.cs b/src/Microsoft.AspNetCore.Server.IntegrationTesting.IIS/WebConfigHelpers.cs index 8d2af5eb1d..31f103fee2 100644 --- a/src/Microsoft.AspNetCore.Server.IntegrationTesting.IIS/WebConfigHelpers.cs +++ b/src/Microsoft.AspNetCore.Server.IntegrationTesting.IIS/WebConfigHelpers.cs @@ -9,20 +9,20 @@ namespace Microsoft.AspNetCore.Server.IntegrationTesting.IIS { public static class WebConfigHelpers { - public static Action AddOrModifyAspNetCoreSection(string key, string value) + public static Action AddOrModifyAspNetCoreSection(string key, string value) => AddAction(key, value, section: "aspNetCore"); - public static Action AddAction(string key, string value, string section) + public static Action AddAction(string key, string value, string section) { - return (element) => + return (element, _) => { element.Descendants(section).SingleOrDefault().SetAttributeValue(key, value); }; } - public static Action AddOrModifyHandlerSection(string key, string value) + public static Action AddOrModifyHandlerSection(string key, string value) { - return element => + return (element, _) => { element.Descendants("handlers") .FirstOrDefault() diff --git a/test/IIS.FunctionalTests/IIS.FunctionalTests.csproj b/test/IIS.FunctionalTests/IIS.FunctionalTests.csproj index 73c2d11f70..dfe65f9b56 100644 --- a/test/IIS.FunctionalTests/IIS.FunctionalTests.csproj +++ b/test/IIS.FunctionalTests/IIS.FunctionalTests.csproj @@ -10,8 +10,6 @@ - - @@ -23,13 +21,6 @@ - - - - - - - @@ -45,7 +36,7 @@ - + PreserveNewest diff --git a/test/IIS.Tests/IIS.Tests.csproj b/test/IIS.Tests/IIS.Tests.csproj index 1037d93c25..614a286626 100644 --- a/test/IIS.Tests/IIS.Tests.csproj +++ b/test/IIS.Tests/IIS.Tests.csproj @@ -1,22 +1,16 @@ - + netcoreapp2.2 + - - - - - - - @@ -31,6 +25,7 @@ + diff --git a/test/IISExpress.FunctionalTests/IISExpress.FunctionalTests.csproj b/test/IISExpress.FunctionalTests/IISExpress.FunctionalTests.csproj index 3ae8fcffe8..455f453431 100644 --- a/test/IISExpress.FunctionalTests/IISExpress.FunctionalTests.csproj +++ b/test/IISExpress.FunctionalTests/IISExpress.FunctionalTests.csproj @@ -9,8 +9,6 @@ - - @@ -22,13 +20,6 @@ - - - - - - - @@ -44,7 +35,7 @@ - + PreserveNewest diff --git a/test/IISExpress.FunctionalTests/OutOfProcess/GlobalVersionTests.cs b/test/IISExpress.FunctionalTests/OutOfProcess/GlobalVersionTests.cs index 3ab5918753..7ad5d9c9f6 100644 --- a/test/IISExpress.FunctionalTests/OutOfProcess/GlobalVersionTests.cs +++ b/test/IISExpress.FunctionalTests/OutOfProcess/GlobalVersionTests.cs @@ -23,7 +23,6 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests _fixture = fixture; } - private const string _aspNetCoreDll = "aspnetcorev2_outofprocess.dll"; private const string _handlerVersion20 = "2.0.0"; private const string _helloWorldRequest = "HelloWorld"; private const string _helloWorldResponse = "Hello World"; @@ -72,6 +71,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests public async Task GlobalVersion_NewVersionNumber(string version) { var deploymentParameters = GetGlobalVersionBaseDeploymentParameters(); + CopyShimToOutput(deploymentParameters); deploymentParameters.HandlerSettings["handlerVersion"] = version; var deploymentResult = await DeployAsync(deploymentParameters); @@ -92,7 +92,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests public async Task GlobalVersion_MultipleRequestHandlers_PicksHighestOne(string version) { var deploymentParameters = GetGlobalVersionBaseDeploymentParameters(); - + CopyShimToOutput(deploymentParameters); var deploymentResult = await DeployAsync(deploymentParameters); var originalANCMPath = GetANCMRequestHandlerPath(deploymentResult, _handlerVersion20); @@ -115,6 +115,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests public async Task GlobalVersion_MultipleRequestHandlers_UpgradeWorks(string version) { var deploymentParameters = GetGlobalVersionBaseDeploymentParameters(); + CopyShimToOutput(deploymentParameters); var deploymentResult = await DeployAsync(deploymentParameters); var originalANCMPath = GetANCMRequestHandlerPath(deploymentResult, _handlerVersion20); @@ -170,5 +171,43 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests { Assert.Contains(TestSink.Writes, context => context.Message.Contains(version + @"\aspnetcorev2_outofprocess.dll")); } + + private static void CopyShimToOutput(IISDeploymentParameters parameters) + { + parameters.AddServerConfigAction( + (config, contentRoot) => { + var moduleNodes = config.DescendantNodesAndSelf() + .OfType() + .Where(element => + element.Name == "add" && + element.Attribute("name")?.Value.StartsWith("AspNetCoreModule") == true && + element.Attribute("image") != null); + + var sourceDirectory = new DirectoryInfo(Path.GetDirectoryName(moduleNodes.First().Attribute("image").Value)); + var destinationDirectory = new DirectoryInfo(Path.Combine(contentRoot, sourceDirectory.Name)); + destinationDirectory.Create(); + foreach (var element in moduleNodes) + { + var imageAttribute = element.Attribute("image"); + imageAttribute.Value = imageAttribute.Value.Replace(sourceDirectory.FullName, destinationDirectory.FullName); + } + CopyFiles(sourceDirectory, destinationDirectory); + }); + } + + private static void CopyFiles(DirectoryInfo source, DirectoryInfo target) + { + foreach (DirectoryInfo directoryInfo in source.GetDirectories()) + { + CopyFiles(directoryInfo, target.CreateSubdirectory(directoryInfo.Name)); + } + + foreach (FileInfo fileInfo in source.GetFiles()) + { + var destFileName = Path.Combine(target.FullName, fileInfo.Name); + fileInfo.CopyTo(destFileName); + } + } + } } diff --git a/test/WebSites/InProcessWebSite/InProcessWebSite.csproj b/test/WebSites/InProcessWebSite/InProcessWebSite.csproj index b6d09409c1..393574d9c8 100644 --- a/test/WebSites/InProcessWebSite/InProcessWebSite.csproj +++ b/test/WebSites/InProcessWebSite/InProcessWebSite.csproj @@ -1,10 +1,12 @@ - - + netcoreapp2.2 + true + + diff --git a/test/WebSites/InProcessWebSite/Properties/launchSettings.json b/test/WebSites/InProcessWebSite/Properties/launchSettings.json index 943d2ad712..8cd1df05e6 100644 --- a/test/WebSites/InProcessWebSite/Properties/launchSettings.json +++ b/test/WebSites/InProcessWebSite/Properties/launchSettings.json @@ -15,8 +15,8 @@ "nativeDebugging": true, "environmentVariables": { "IIS_SITE_PATH": "$(MSBuildThisFileDirectory)", - "ANCM_PATH": "$(TargetDir)$(AncmPath)", - "ANCMV2_PATH": "$(TargetDir)$(AncmV2Path)", + "ANCM_PATH": "$(AncmPath)", + "ANCMV2_PATH": "$(AncmV2Path)", "LAUNCHER_ARGS": "$(TargetPath)", "ASPNETCORE_ENVIRONMENT": "Development", "LAUNCHER_PATH": "$(DotNetPath)", @@ -29,8 +29,8 @@ "commandLineArgs": "$(IISArguments)", "environmentVariables": { "IIS_SITE_PATH": "$(MSBuildThisFileDirectory)", - "ANCM_PATH": "$(TargetDir)$(AncmPath)", - "ANCMV2_PATH": "$(TargetDir)$(AncmV2Path)", + "ANCM_PATH": "$(AncmPath)", + "ANCMV2_PATH": "$(AncmV2Path)", "LAUNCHER_ARGS": "$(TargetPath)", "ASPNETCORE_ENVIRONMENT": "Development", "LAUNCHER_PATH": "$(DotNetPath)", diff --git a/test/WebSites/OutOfProcessWebSite/Properties/launchSettings.json b/test/WebSites/OutOfProcessWebSite/Properties/launchSettings.json index 943d2ad712..8cd1df05e6 100644 --- a/test/WebSites/OutOfProcessWebSite/Properties/launchSettings.json +++ b/test/WebSites/OutOfProcessWebSite/Properties/launchSettings.json @@ -15,8 +15,8 @@ "nativeDebugging": true, "environmentVariables": { "IIS_SITE_PATH": "$(MSBuildThisFileDirectory)", - "ANCM_PATH": "$(TargetDir)$(AncmPath)", - "ANCMV2_PATH": "$(TargetDir)$(AncmV2Path)", + "ANCM_PATH": "$(AncmPath)", + "ANCMV2_PATH": "$(AncmV2Path)", "LAUNCHER_ARGS": "$(TargetPath)", "ASPNETCORE_ENVIRONMENT": "Development", "LAUNCHER_PATH": "$(DotNetPath)", @@ -29,8 +29,8 @@ "commandLineArgs": "$(IISArguments)", "environmentVariables": { "IIS_SITE_PATH": "$(MSBuildThisFileDirectory)", - "ANCM_PATH": "$(TargetDir)$(AncmPath)", - "ANCMV2_PATH": "$(TargetDir)$(AncmV2Path)", + "ANCM_PATH": "$(AncmPath)", + "ANCMV2_PATH": "$(AncmV2Path)", "LAUNCHER_ARGS": "$(TargetPath)", "ASPNETCORE_ENVIRONMENT": "Development", "LAUNCHER_PATH": "$(DotNetPath)", diff --git a/test/WebSites/OverriddenServerWebSite/OverriddenServerWebSite.csproj b/test/WebSites/OverriddenServerWebSite/OverriddenServerWebSite.csproj index 2b9db3ce4a..f7108dadc4 100644 --- a/test/WebSites/OverriddenServerWebSite/OverriddenServerWebSite.csproj +++ b/test/WebSites/OverriddenServerWebSite/OverriddenServerWebSite.csproj @@ -1,11 +1,12 @@ - - netcoreapp2.2 + true + + diff --git a/test/WebSites/OverriddenServerWebSite/Properties/launchSettings.json b/test/WebSites/OverriddenServerWebSite/Properties/launchSettings.json index 943d2ad712..8cd1df05e6 100644 --- a/test/WebSites/OverriddenServerWebSite/Properties/launchSettings.json +++ b/test/WebSites/OverriddenServerWebSite/Properties/launchSettings.json @@ -15,8 +15,8 @@ "nativeDebugging": true, "environmentVariables": { "IIS_SITE_PATH": "$(MSBuildThisFileDirectory)", - "ANCM_PATH": "$(TargetDir)$(AncmPath)", - "ANCMV2_PATH": "$(TargetDir)$(AncmV2Path)", + "ANCM_PATH": "$(AncmPath)", + "ANCMV2_PATH": "$(AncmV2Path)", "LAUNCHER_ARGS": "$(TargetPath)", "ASPNETCORE_ENVIRONMENT": "Development", "LAUNCHER_PATH": "$(DotNetPath)", @@ -29,8 +29,8 @@ "commandLineArgs": "$(IISArguments)", "environmentVariables": { "IIS_SITE_PATH": "$(MSBuildThisFileDirectory)", - "ANCM_PATH": "$(TargetDir)$(AncmPath)", - "ANCMV2_PATH": "$(TargetDir)$(AncmV2Path)", + "ANCM_PATH": "$(AncmPath)", + "ANCMV2_PATH": "$(AncmV2Path)", "LAUNCHER_ARGS": "$(TargetPath)", "ASPNETCORE_ENVIRONMENT": "Development", "LAUNCHER_PATH": "$(DotNetPath)", diff --git a/test/WebSites/StartupExceptionWebSite/Properties/launchSettings.json b/test/WebSites/StartupExceptionWebSite/Properties/launchSettings.json index 943d2ad712..8cd1df05e6 100644 --- a/test/WebSites/StartupExceptionWebSite/Properties/launchSettings.json +++ b/test/WebSites/StartupExceptionWebSite/Properties/launchSettings.json @@ -15,8 +15,8 @@ "nativeDebugging": true, "environmentVariables": { "IIS_SITE_PATH": "$(MSBuildThisFileDirectory)", - "ANCM_PATH": "$(TargetDir)$(AncmPath)", - "ANCMV2_PATH": "$(TargetDir)$(AncmV2Path)", + "ANCM_PATH": "$(AncmPath)", + "ANCMV2_PATH": "$(AncmV2Path)", "LAUNCHER_ARGS": "$(TargetPath)", "ASPNETCORE_ENVIRONMENT": "Development", "LAUNCHER_PATH": "$(DotNetPath)", @@ -29,8 +29,8 @@ "commandLineArgs": "$(IISArguments)", "environmentVariables": { "IIS_SITE_PATH": "$(MSBuildThisFileDirectory)", - "ANCM_PATH": "$(TargetDir)$(AncmPath)", - "ANCMV2_PATH": "$(TargetDir)$(AncmV2Path)", + "ANCM_PATH": "$(AncmPath)", + "ANCMV2_PATH": "$(AncmV2Path)", "LAUNCHER_ARGS": "$(TargetPath)", "ASPNETCORE_ENVIRONMENT": "Development", "LAUNCHER_PATH": "$(DotNetPath)", diff --git a/test/WebSites/StartupExceptionWebSite/StartupExceptionWebSite.csproj b/test/WebSites/StartupExceptionWebSite/StartupExceptionWebSite.csproj index d279ce41b4..922196815f 100644 --- a/test/WebSites/StartupExceptionWebSite/StartupExceptionWebSite.csproj +++ b/test/WebSites/StartupExceptionWebSite/StartupExceptionWebSite.csproj @@ -1,11 +1,12 @@  - - netcoreapp2.2 + true + + diff --git a/test/WebSites/StressTestWebSite/Properties/launchSettings.json b/test/WebSites/StressTestWebSite/Properties/launchSettings.json index 943d2ad712..8cd1df05e6 100644 --- a/test/WebSites/StressTestWebSite/Properties/launchSettings.json +++ b/test/WebSites/StressTestWebSite/Properties/launchSettings.json @@ -15,8 +15,8 @@ "nativeDebugging": true, "environmentVariables": { "IIS_SITE_PATH": "$(MSBuildThisFileDirectory)", - "ANCM_PATH": "$(TargetDir)$(AncmPath)", - "ANCMV2_PATH": "$(TargetDir)$(AncmV2Path)", + "ANCM_PATH": "$(AncmPath)", + "ANCMV2_PATH": "$(AncmV2Path)", "LAUNCHER_ARGS": "$(TargetPath)", "ASPNETCORE_ENVIRONMENT": "Development", "LAUNCHER_PATH": "$(DotNetPath)", @@ -29,8 +29,8 @@ "commandLineArgs": "$(IISArguments)", "environmentVariables": { "IIS_SITE_PATH": "$(MSBuildThisFileDirectory)", - "ANCM_PATH": "$(TargetDir)$(AncmPath)", - "ANCMV2_PATH": "$(TargetDir)$(AncmV2Path)", + "ANCM_PATH": "$(AncmPath)", + "ANCMV2_PATH": "$(AncmV2Path)", "LAUNCHER_ARGS": "$(TargetPath)", "ASPNETCORE_ENVIRONMENT": "Development", "LAUNCHER_PATH": "$(DotNetPath)", diff --git a/test/WebSites/StressTestWebSite/StressTestWebSite.csproj b/test/WebSites/StressTestWebSite/StressTestWebSite.csproj index 8c1b6b08e7..9a1ed0692f 100644 --- a/test/WebSites/StressTestWebSite/StressTestWebSite.csproj +++ b/test/WebSites/StressTestWebSite/StressTestWebSite.csproj @@ -4,6 +4,7 @@ $(StandardTestTfms) + true diff --git a/tools/GenerateNativeAssets.ps1 b/tools/GenerateNativeAssets.ps1 new file mode 100644 index 0000000000..f4b98959ed --- /dev/null +++ b/tools/GenerateNativeAssets.ps1 @@ -0,0 +1,150 @@ +$targetFile = Join-Path (Split-Path -parent $PSCommandPath) "..\build\assets.props"; + +$platforms = @( + @{ + Platform = "x64"; + VCPlatform = "x64"; + }, + @{ + Platform = "x86"; + VCPlatform = "Win32"; + } +); +$srcDir = "`$(MSBuildThisFileDirectory)..\src"; +$projects = @( + @{ + ProjectDirectory = "$srcDir\AspNetCoreModuleV1\AspNetCore"; + ProjectName = "AspNetCore.vcxproj"; + NativeAsset = "aspnetcore"; + BaseOutputPath = "AspNetCoreModuleV1" + PropetyName = "AspNetCoreModuleV1Shim" + }, + @{ + ProjectDirectory = "$srcDir\AspNetCoreModuleV2\AspNetCore"; + ProjectName = "`AspNetCore.vcxproj"; + NativeAsset = "aspnetcorev2"; + BaseOutputPath = "AspNetCoreModuleV2" + PropetyName = "AspNetCoreModuleV2Shim" + }, + @{ + ProjectDirectory = "$srcDir\AspNetCoreModuleV2\InProcessRequestHandler"; + ProjectName = "InProcessRequestHandler.vcxproj"; + NativeAsset = "aspnetcorev2_inprocess"; + BaseOutputPath = "AspNetCoreModuleV2"; + PropetyName = "AspNetCoreModuleV2InProcessHandler" + }, + @{ + ProjectDirectory = "$srcDir\AspNetCoreModuleV2\OutOfProcessRequestHandler"; + ProjectName = "OutOfProcessRequestHandler.vcxproj"; + NativeAsset = "aspnetcorev2_outofprocess"; + BaseOutputPath = "AspNetCoreModuleV2"; + PackageSubPath = "`$(AspNetCoreModuleOutOfProcessVersion)\"; + PropetyName = "AspNetCoreModuleV2OutOfProcessHandler" + } +); +$currentPlatform = @{ + Platform = "`$(NativePlatform)"; + VCPlatform = "`$(NativeVCPlatform)"; +}; +$components = @(); +$shimComponents = @(); +$inProcessComponents = @(); +$runShimComponents = @(); +$runInProcessComponents = @(); +$properties = @(); + +function CopyProperties($from, $to) +{ + foreach ($key in $from.Keys) + { + $to.Add($key, $from.$key); + } +} + +function Write-Group($group, $name) +{ + return $( + foreach ($item in $group){ + " <$name$(foreach ($pair in $item.GetEnumerator()) { + "`n $($pair.Key)=`"`"$($pair.Value)`"`""}) + />`n"}); +} +function Write-Properties($group) +{ + return $( + foreach ($item in $group){ + "`n <$($item.Name)>$($item.Value)"}); +} + +function New-Component($project, $platform) +{ + $component = [ordered]@{}; + CopyProperties -from $platform -to $component; + CopyProperties -from $project -to $component; + CopyProperties -from @{ + Include = "$($project.ProjectDirectory)\$($project.ProjectName)"; + DllLocation = "$($project.ProjectDirectory)\bin\`$(Configuration)\$($platform.VCPlatform)\$($project.NativeAsset).dll"; + PdbLocation = "$($project.ProjectDirectory)\bin\`$(Configuration)\$($platform.VCPlatform)\$($project.NativeAsset).pdb"; + } -to $component; + + return $component; +} + +foreach ($project in $projects) +{ + foreach ($platform in $platforms) + { + $component = New-Component $project $platform; + $components += $component; + + if ($project.ProjectName.Contains("InProcess")) + { + $inProcessComponents += $component; + } + else + { + $shimComponents += $component; + } + } + + $properties += @{ + Name = "$($project.PropetyName)Dll"; + Value = "$($project.ProjectDirectory)\bin\`$(Configuration)\`$(NativeVCPlatform)\$($project.NativeAsset).dll"; + }; + + $runComponent = New-Component $project $currentPlatform; + + if ($project.ProjectName.Contains("InProcess")) + { + $runInProcessComponents += $runComponent; + } + else + { + $runShimComponents += $runComponent; + } +} + +$content = @" + + + + true + x64 + `$(Platform) + Win32 + `$(NativePlatform) + + +$(Write-Group $components "Components" ) +$(Write-Group $shimComponents "ShimComponents") +$(Write-Group $inProcessComponents "InProcessComponents") +$(Write-Group $runShimComponents "RunShimComponents") +$(Write-Group $runInProcessComponents "RunInProcessComponents") + + +$(Write-Properties $properties) + + +"@; + +[IO.File]::WriteAllLines($targetFile, $content) From 9cec10e3053b931921f33caef2a08533d689857a Mon Sep 17 00:00:00 2001 From: Pavel Krymets Date: Thu, 2 Aug 2018 08:20:21 -0700 Subject: [PATCH 8/8] Update deps --- build/dependencies.props | 50 ++++++++++++++++++++-------------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/build/dependencies.props b/build/dependencies.props index b23adbabd4..1fec602126 100644 --- a/build/dependencies.props +++ b/build/dependencies.props @@ -5,37 +5,37 @@ 0.10.13 3.0.0-alpha1-10015 - 3.0.0-alpha1-10173 - 3.0.0-alpha1-10173 - 3.0.0-alpha1-10173 - 3.0.0-alpha1-10173 - 3.0.0-alpha1-10173 - 3.0.0-alpha1-10173 - 3.0.0-alpha1-10173 - 3.0.0-alpha1-10173 - 3.0.0-alpha1-10173 - 0.7.0-alpha1-10173 - 3.0.0-alpha1-10173 - 3.0.0-alpha1-10173 - 3.0.0-alpha1-10173 - 3.0.0-alpha1-10173 + 3.0.0-alpha1-10207 + 3.0.0-alpha1-10207 + 3.0.0-alpha1-10207 + 3.0.0-alpha1-10207 + 3.0.0-alpha1-10207 + 3.0.0-alpha1-10207 + 3.0.0-alpha1-10207 + 3.0.0-alpha1-10207 + 3.0.0-alpha1-10207 + 0.7.0-alpha1-10207 + 3.0.0-alpha1-10207 + 3.0.0-alpha1-10207 + 3.0.0-alpha1-10207 + 3.0.0-alpha1-10207 15.6.82 15.6.82 - 3.0.0-alpha1-10173 - 3.0.0-alpha1-10173 - 3.0.0-alpha1-10173 - 3.0.0-alpha1-10173 - 3.0.0-alpha1-10173 - 3.0.0-alpha1-10173 - 3.0.0-alpha1-10173 - 3.0.0-alpha1-10173 - 3.0.0-alpha1-10173 - 3.0.0-alpha1-10173 + 3.0.0-alpha1-10207 + 3.0.0-alpha1-10207 + 3.0.0-alpha1-10207 + 3.0.0-alpha1-10207 + 3.0.0-alpha1-10207 + 3.0.0-alpha1-10207 + 3.0.0-alpha1-10207 + 3.0.0-alpha1-10207 + 3.0.0-alpha1-10207 + 3.0.0-alpha1-10207 2.0.9 2.1.2 2.2.0-preview1-26618-02 1.0.1 - 3.0.0-alpha1-10173 + 3.0.0-alpha1-10207 15.6.1 11.1.0 2.0.3