MvcPrecompilation 259 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751
  1. commit 7f1a987adaf246e03ffd1a58ab75b5e09b8d9b00
  2. Author: Pranav K <[email protected]>
  3. Date: Wed Nov 15 11:03:08 2017 -0800
  4. Update samples and tests to target netcoreapp2.1
  5. diff --git a/Directory.Build.props b/Directory.Build.props
  6. index d875d2bcb93..3ecf4afdd90 100644
  7. --- a/Directory.Build.props
  8. +++ b/Directory.Build.props
  9. @@ -1,4 +1,8 @@
  10. <Project>
  11. + <Import
  12. + Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), AspNetCoreSettings.props))\AspNetCoreSettings.props"
  13. + Condition=" '$(CI)' != 'true' AND '$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), AspNetCoreSettings.props))' != '' " />
  14. +
  15. <Import Project="version.props" />
  16. <Import Project="build\dependencies.props" />
  17. diff --git a/build/dependencies.props b/build/dependencies.props
  18. index 2f9e96ca984..775eb2d4d98 100644
  19. --- a/build/dependencies.props
  20. +++ b/build/dependencies.props
  21. @@ -4,20 +4,20 @@
  22. </PropertyGroup>
  23. <PropertyGroup Label="Package Versions">
  24. <InternalAspNetCoreSdkPackageVersion>2.1.0-preview1-15551</InternalAspNetCoreSdkPackageVersion>
  25. - <MicrosoftAspNetCoreAuthenticationCookiesPackageVersion>2.1.0-preview1-27498</MicrosoftAspNetCoreAuthenticationCookiesPackageVersion>
  26. - <MicrosoftAspNetCoreHostingPackageVersion>2.1.0-preview1-27498</MicrosoftAspNetCoreHostingPackageVersion>
  27. - <MicrosoftAspNetCoreMvcPackageVersion>2.1.0-preview1-27498</MicrosoftAspNetCoreMvcPackageVersion>
  28. - <MicrosoftAspNetCoreMvcRazorPagesPackageVersion>2.1.0-preview1-27498</MicrosoftAspNetCoreMvcRazorPagesPackageVersion>
  29. - <MicrosoftAspNetCoreRazorRuntimePackageVersion>2.1.0-preview1-27498</MicrosoftAspNetCoreRazorRuntimePackageVersion>
  30. + <MicrosoftAspNetCoreAuthenticationCookiesPackageVersion>2.1.0-preview1-27579</MicrosoftAspNetCoreAuthenticationCookiesPackageVersion>
  31. + <MicrosoftAspNetCoreHostingPackageVersion>2.1.0-preview1-27579</MicrosoftAspNetCoreHostingPackageVersion>
  32. + <MicrosoftAspNetCoreMvcPackageVersion>2.1.0-preview1-27579</MicrosoftAspNetCoreMvcPackageVersion>
  33. + <MicrosoftAspNetCoreMvcRazorPagesPackageVersion>2.1.0-preview1-27579</MicrosoftAspNetCoreMvcRazorPagesPackageVersion>
  34. + <MicrosoftAspNetCoreRazorRuntimePackageVersion>2.1.0-preview1-27579</MicrosoftAspNetCoreRazorRuntimePackageVersion>
  35. <MicrosoftAspNetCoreServerIntegrationTestingPackageVersion>0.5.0-preview1-27498</MicrosoftAspNetCoreServerIntegrationTestingPackageVersion>
  36. - <MicrosoftAspNetCoreServerKestrelPackageVersion>2.1.0-preview1-27498</MicrosoftAspNetCoreServerKestrelPackageVersion>
  37. - <MicrosoftAspNetCoreTestingPackageVersion>2.1.0-preview1-27498</MicrosoftAspNetCoreTestingPackageVersion>
  38. + <MicrosoftAspNetCoreServerKestrelPackageVersion>2.1.0-preview1-27579</MicrosoftAspNetCoreServerKestrelPackageVersion>
  39. + <MicrosoftAspNetCoreTestingPackageVersion>2.1.0-preview1-27579</MicrosoftAspNetCoreTestingPackageVersion>
  40. <MicrosoftBuildTasksCorePackageVersion>15.3.409</MicrosoftBuildTasksCorePackageVersion>
  41. - <MicrosoftExtensionsCommandLineUtilsSourcesPackageVersion>2.1.0-preview1-27498</MicrosoftExtensionsCommandLineUtilsSourcesPackageVersion>
  42. - <MicrosoftExtensionsConfigurationCommandLinePackageVersion>2.1.0-preview1-27498</MicrosoftExtensionsConfigurationCommandLinePackageVersion>
  43. - <MicrosoftExtensionsLoggingConsolePackageVersion>2.1.0-preview1-27498</MicrosoftExtensionsLoggingConsolePackageVersion>
  44. - <MicrosoftExtensionsLoggingPackageVersion>2.1.0-preview1-27498</MicrosoftExtensionsLoggingPackageVersion>
  45. - <MicrosoftExtensionsLoggingTestingPackageVersion>2.1.0-preview1-27498</MicrosoftExtensionsLoggingTestingPackageVersion>
  46. + <MicrosoftExtensionsCommandLineUtilsSourcesPackageVersion>2.1.0-preview1-27579</MicrosoftExtensionsCommandLineUtilsSourcesPackageVersion>
  47. + <MicrosoftExtensionsConfigurationCommandLinePackageVersion>2.1.0-preview1-27579</MicrosoftExtensionsConfigurationCommandLinePackageVersion>
  48. + <MicrosoftExtensionsLoggingConsolePackageVersion>2.1.0-preview1-27579</MicrosoftExtensionsLoggingConsolePackageVersion>
  49. + <MicrosoftExtensionsLoggingPackageVersion>2.1.0-preview1-27579</MicrosoftExtensionsLoggingPackageVersion>
  50. + <MicrosoftExtensionsLoggingTestingPackageVersion>2.1.0-preview1-27579</MicrosoftExtensionsLoggingTestingPackageVersion>
  51. <MicrosoftNETCoreApp20PackageVersion>2.0.0</MicrosoftNETCoreApp20PackageVersion>
  52. <MicrosoftNETTestSdkPackageVersion>15.3.0</MicrosoftNETTestSdkPackageVersion>
  53. <XunitPackageVersion>2.3.0</XunitPackageVersion>
  54. diff --git a/korebuild-lock.txt b/korebuild-lock.txt
  55. index 86352477bbe..95f46130145 100644
  56. --- a/korebuild-lock.txt
  57. +++ b/korebuild-lock.txt
  58. @@ -1,2 +1,2 @@
  59. -version:2.1.0-preview1-15551
  60. -commithash:8fad9553b48533fddbb16a423ea55b9710ea2e63
  61. +version:2.1.0-preview1-15567
  62. +commithash:903e3104807b1bb8cddd28bdef205b1e2dc021d1
  63. diff --git a/test/Directory.Build.props b/test/Directory.Build.props
  64. index c867cbd1126..7ec143f84df 100644
  65. --- a/test/Directory.Build.props
  66. +++ b/test/Directory.Build.props
  67. @@ -1,6 +1,13 @@
  68. <Project>
  69. <Import Project="..\Directory.Build.props" />
  70. + <PropertyGroup>
  71. + <DeveloperBuildTestTfms>netcoreapp2.1</DeveloperBuildTestTfms>
  72. + <StandardTestTfms>$(DeveloperBuildTestTfms)</StandardTestTfms>
  73. + <StandardTestTfms Condition=" '$(DeveloperBuild)' != 'true' ">netcoreapp2.1;netcoreapp2.0</StandardTestTfms>
  74. + <StandardTestTfms Condition=" '$(DeveloperBuild)' != 'true' AND '$(OS)' == 'Windows_NT' ">$(StandardTestTfms);net461</StandardTestTfms>
  75. + </PropertyGroup>
  76. +
  77. <ItemGroup>
  78. <PackageReference Include="Internal.AspNetCore.Sdk" PrivateAssets="All" Version="$(InternalAspNetCoreSdkPackageVersion)" />
  79. <PackageReference Include="Microsoft.AspNetCore.Testing" Version="$(MicrosoftAspNetCoreTestingPackageVersion)" />
  80. diff --git a/test/FunctionalTests/ApplicationConsumingPrecompiledViews_CoreCLR.cs b/test/FunctionalTests/CoreCLRTests/ApplicationConsumingPrecompiledViews_CoreCLR.cs
  81. similarity index 100%
  82. rename from test/FunctionalTests/ApplicationConsumingPrecompiledViews_CoreCLR.cs
  83. rename to test/FunctionalTests/CoreCLRTests/ApplicationConsumingPrecompiledViews_CoreCLR.cs
  84. diff --git a/test/FunctionalTests/ApplicationUsingRelativePathsTest_CoreCLR.cs b/test/FunctionalTests/CoreCLRTests/ApplicationUsingRelativePathsTest_CoreCLR.cs
  85. similarity index 100%
  86. rename from test/FunctionalTests/ApplicationUsingRelativePathsTest_CoreCLR.cs
  87. rename to test/FunctionalTests/CoreCLRTests/ApplicationUsingRelativePathsTest_CoreCLR.cs
  88. diff --git a/test/FunctionalTests/ApplicationWithConfigureMvcTest_CoreCLR.cs b/test/FunctionalTests/CoreCLRTests/ApplicationWithConfigureMvcTest_CoreCLR.cs
  89. similarity index 100%
  90. rename from test/FunctionalTests/ApplicationWithConfigureMvcTest_CoreCLR.cs
  91. rename to test/FunctionalTests/CoreCLRTests/ApplicationWithConfigureMvcTest_CoreCLR.cs
  92. diff --git a/test/FunctionalTests/ApplicationWithCustomInputFilesTest_CoreCLR.cs b/test/FunctionalTests/CoreCLRTests/ApplicationWithCustomInputFilesTest_CoreCLR.cs
  93. similarity index 100%
  94. rename from test/FunctionalTests/ApplicationWithCustomInputFilesTest_CoreCLR.cs
  95. rename to test/FunctionalTests/CoreCLRTests/ApplicationWithCustomInputFilesTest_CoreCLR.cs
  96. diff --git a/test/FunctionalTests/ApplicationWithParseErrorsTest_CoreCLR.cs b/test/FunctionalTests/CoreCLRTests/ApplicationWithParseErrorsTest_CoreCLR.cs
  97. similarity index 100%
  98. rename from test/FunctionalTests/ApplicationWithParseErrorsTest_CoreCLR.cs
  99. rename to test/FunctionalTests/CoreCLRTests/ApplicationWithParseErrorsTest_CoreCLR.cs
  100. diff --git a/test/FunctionalTests/ApplicationWithTagHelpersTest_CoreCLR.cs b/test/FunctionalTests/CoreCLRTests/ApplicationWithTagHelpersTest_CoreCLR.cs
  101. similarity index 100%
  102. rename from test/FunctionalTests/ApplicationWithTagHelpersTest_CoreCLR.cs
  103. rename to test/FunctionalTests/CoreCLRTests/ApplicationWithTagHelpersTest_CoreCLR.cs
  104. diff --git a/test/FunctionalTests/CopyBuildOutputToPublishDirectory_CoreCLR.cs b/test/FunctionalTests/CoreCLRTests/CopyBuildOutputToPublishDirectory_CoreCLR.cs
  105. similarity index 100%
  106. rename from test/FunctionalTests/CopyBuildOutputToPublishDirectory_CoreCLR.cs
  107. rename to test/FunctionalTests/CoreCLRTests/CopyBuildOutputToPublishDirectory_CoreCLR.cs
  108. diff --git a/test/FunctionalTests/CopyOutputSymbolsToPublishDirectoryTest_CoreCLR.cs b/test/FunctionalTests/CoreCLRTests/CopyOutputSymbolsToPublishDirectoryTest_CoreCLR.cs
  109. similarity index 100%
  110. rename from test/FunctionalTests/CopyOutputSymbolsToPublishDirectoryTest_CoreCLR.cs
  111. rename to test/FunctionalTests/CoreCLRTests/CopyOutputSymbolsToPublishDirectoryTest_CoreCLR.cs
  112. diff --git a/test/FunctionalTests/Infrastructure/CoreCLRApplicationTestFixture.cs b/test/FunctionalTests/CoreCLRTests/CoreCLRApplicationTestFixture.cs
  113. similarity index 71%
  114. rename from test/FunctionalTests/Infrastructure/CoreCLRApplicationTestFixture.cs
  115. rename to test/FunctionalTests/CoreCLRTests/CoreCLRApplicationTestFixture.cs
  116. index 6f4c8625df1..d429b08de13 100644
  117. --- a/test/FunctionalTests/Infrastructure/CoreCLRApplicationTestFixture.cs
  118. +++ b/test/FunctionalTests/CoreCLRTests/CoreCLRApplicationTestFixture.cs
  119. @@ -7,6 +7,15 @@ namespace FunctionalTests
  120. {
  121. public class CoreCLRApplicationTestFixture<TStartup> : ApplicationTestFixture
  122. {
  123. + private const string TargetFramework =
  124. +#if NETCOREAPP2_0
  125. + "netcoreapp2.0";
  126. +#elif NETCOREAPP2_1
  127. + "netcoreapp2.1";
  128. +#else
  129. +#error Target frameworks need to be updated
  130. +#endif
  131. +
  132. public CoreCLRApplicationTestFixture()
  133. : this(typeof(TStartup).Assembly.GetName().Name, null)
  134. {
  135. @@ -17,6 +26,6 @@ namespace FunctionalTests
  136. {
  137. }
  138. - protected override DeploymentParameters GetDeploymentParameters() => base.GetDeploymentParameters(RuntimeFlavor.CoreClr);
  139. + protected override DeploymentParameters GetDeploymentParameters() => base.GetDeploymentParameters(RuntimeFlavor.CoreClr, TargetFramework);
  140. }
  141. }
  142. diff --git a/test/FunctionalTests/PublishForRidTest_CoreCLR.cs b/test/FunctionalTests/CoreCLRTests/PublishForRidTest_CoreCLR.cs
  143. similarity index 88%
  144. rename from test/FunctionalTests/PublishForRidTest_CoreCLR.cs
  145. rename to test/FunctionalTests/CoreCLRTests/PublishForRidTest_CoreCLR.cs
  146. index fdbdcc96cd4..48dec3c9653 100644
  147. --- a/test/FunctionalTests/PublishForRidTest_CoreCLR.cs
  148. +++ b/test/FunctionalTests/CoreCLRTests/PublishForRidTest_CoreCLR.cs
  149. @@ -29,10 +29,17 @@ namespace FunctionalTests
  150. var applicationName = nameof(SimpleApp);
  151. var applicationPath = ApplicationPaths.GetTestAppDirectory(applicationName);
  152. var deploymentParameters = ApplicationTestFixture.GetDeploymentParameters(
  153. - applicationPath,
  154. - applicationName,
  155. - RuntimeFlavor.CoreClr);
  156. -
  157. + applicationPath,
  158. + applicationName,
  159. + RuntimeFlavor.CoreClr,
  160. +#if NETCOREAPP2_0
  161. + "netcoreapp2.0");
  162. +#elif NETCOREAPP2_1
  163. + "netcoreapp2.1");
  164. +#else
  165. +#error Target frameworks need to be updated
  166. +#endif
  167. +
  168. // Deploy for a rid that does not exist on the current platform.
  169. if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
  170. {
  171. @@ -49,7 +56,7 @@ namespace FunctionalTests
  172. // Act
  173. var expectedFile = Path.Combine(
  174. - deploymentParameters.PublishedApplicationRootPath,
  175. + deploymentParameters.PublishedApplicationRootPath,
  176. $"{applicationName}.PrecompiledViews.dll");
  177. Assert.True(File.Exists(expectedFile), $"Expected precompiled file {expectedFile} does not exist.");
  178. }
  179. @@ -57,7 +64,7 @@ namespace FunctionalTests
  180. private class DotNetPublishDeployer : ApplicationDeployer
  181. {
  182. - public DotNetPublishDeployer(DeploymentParameters deploymentParameters, ILoggerFactory loggerFactory)
  183. + public DotNetPublishDeployer(DeploymentParameters deploymentParameters, ILoggerFactory loggerFactory)
  184. : base(deploymentParameters, loggerFactory)
  185. {
  186. }
  187. diff --git a/test/FunctionalTests/PublishWithDebugTest_CoreCLR.cs b/test/FunctionalTests/CoreCLRTests/PublishWithDebugTest_CoreCLR.cs
  188. similarity index 81%
  189. rename from test/FunctionalTests/PublishWithDebugTest_CoreCLR.cs
  190. rename to test/FunctionalTests/CoreCLRTests/PublishWithDebugTest_CoreCLR.cs
  191. index ca8658e8cfb..c66e4b68a5a 100644
  192. --- a/test/FunctionalTests/PublishWithDebugTest_CoreCLR.cs
  193. +++ b/test/FunctionalTests/CoreCLRTests/PublishWithDebugTest_CoreCLR.cs
  194. @@ -1,6 +1,7 @@
  195. // Copyright (c) .NET Foundation. All rights reserved.
  196. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
  197. +using System.IO;
  198. using System.Threading.Tasks;
  199. using Microsoft.AspNetCore.Server.IntegrationTesting;
  200. using Microsoft.Extensions.Logging.Testing;
  201. @@ -30,18 +31,19 @@ namespace FunctionalTests
  202. // Arrange
  203. var deployment = await Fixture.CreateDeploymentAsync(loggerFactory);
  204. - // Act
  205. - var response = await deployment.HttpClient.GetStringWithRetryAsync(
  206. - deployment.ApplicationBaseUri,
  207. - loggerFactory.CreateLogger(Fixture.ApplicationName));
  208. -
  209. // Assert
  210. - TestEmbeddedResource.AssertContent("SimpleAppTest.Home.Index.txt", response);
  211. + var expected = Path.Combine(deployment.ContentRoot, $"{Fixture.ApplicationName}.PrecompiledViews.dll");
  212. + Assert.True(File.Exists(expected), $"File {expected} does not exist.");
  213. }
  214. }
  215. public class TestFixture : CoreCLRApplicationTestFixture<SimpleApp.Startup>
  216. {
  217. + public TestFixture()
  218. + {
  219. + PublishOnly = true;
  220. + }
  221. +
  222. protected override DeploymentParameters GetDeploymentParameters()
  223. {
  224. var deploymentParameters = base.GetDeploymentParameters();
  225. diff --git a/test/FunctionalTests/PublishWithEmbedViewSourcesTest_CoreCLR.cs b/test/FunctionalTests/CoreCLRTests/PublishWithEmbedViewSourcesTest_CoreCLR.cs
  226. similarity index 100%
  227. rename from test/FunctionalTests/PublishWithEmbedViewSourcesTest_CoreCLR.cs
  228. rename to test/FunctionalTests/CoreCLRTests/PublishWithEmbedViewSourcesTest_CoreCLR.cs
  229. diff --git a/test/FunctionalTests/RazorPagesAppTest_CoreCLR.cs b/test/FunctionalTests/CoreCLRTests/RazorPagesAppTest_CoreCLR.cs
  230. similarity index 100%
  231. rename from test/FunctionalTests/RazorPagesAppTest_CoreCLR.cs
  232. rename to test/FunctionalTests/CoreCLRTests/RazorPagesAppTest_CoreCLR.cs
  233. diff --git a/test/FunctionalTests/SimpleAppTest_CoreCLR.cs b/test/FunctionalTests/CoreCLRTests/SimpleAppTest_CoreCLR.cs
  234. similarity index 100%
  235. rename from test/FunctionalTests/SimpleAppTest_CoreCLR.cs
  236. rename to test/FunctionalTests/CoreCLRTests/SimpleAppTest_CoreCLR.cs
  237. diff --git a/test/FunctionalTests/SimpleAppWithAssemblyRenameTest_CoreCLR.cs b/test/FunctionalTests/CoreCLRTests/SimpleAppWithAssemblyRenameTest_CoreCLR.cs
  238. similarity index 100%
  239. rename from test/FunctionalTests/SimpleAppWithAssemblyRenameTest_CoreCLR.cs
  240. rename to test/FunctionalTests/CoreCLRTests/SimpleAppWithAssemblyRenameTest_CoreCLR.cs
  241. diff --git a/test/FunctionalTests/StrongNamedAppTest_CoreCLR.cs b/test/FunctionalTests/CoreCLRTests/StrongNamedAppTest_CoreCLR.cs
  242. similarity index 100%
  243. rename from test/FunctionalTests/StrongNamedAppTest_CoreCLR.cs
  244. rename to test/FunctionalTests/CoreCLRTests/StrongNamedAppTest_CoreCLR.cs
  245. diff --git a/test/FunctionalTests/ViewCompilationOptionsTest_CoreCLR.cs b/test/FunctionalTests/CoreCLRTests/ViewCompilationOptionsTest_CoreCLR.cs
  246. similarity index 100%
  247. rename from test/FunctionalTests/ViewCompilationOptionsTest_CoreCLR.cs
  248. rename to test/FunctionalTests/CoreCLRTests/ViewCompilationOptionsTest_CoreCLR.cs
  249. diff --git a/test/FunctionalTests/ApplicationConsumingPrecompiledViews_Desktop.cs b/test/FunctionalTests/DesktopTests/ApplicationConsumingPrecompiledViews_Desktop.cs
  250. similarity index 100%
  251. rename from test/FunctionalTests/ApplicationConsumingPrecompiledViews_Desktop.cs
  252. rename to test/FunctionalTests/DesktopTests/ApplicationConsumingPrecompiledViews_Desktop.cs
  253. diff --git a/test/FunctionalTests/ApplicationUsingRelativePathsTest_Desktop.cs b/test/FunctionalTests/DesktopTests/ApplicationUsingRelativePathsTest_Desktop.cs
  254. similarity index 100%
  255. rename from test/FunctionalTests/ApplicationUsingRelativePathsTest_Desktop.cs
  256. rename to test/FunctionalTests/DesktopTests/ApplicationUsingRelativePathsTest_Desktop.cs
  257. diff --git a/test/FunctionalTests/ApplicationWithConfigureMvcTest_Desktop.cs b/test/FunctionalTests/DesktopTests/ApplicationWithConfigureMvcTest_Desktop.cs
  258. similarity index 100%
  259. rename from test/FunctionalTests/ApplicationWithConfigureMvcTest_Desktop.cs
  260. rename to test/FunctionalTests/DesktopTests/ApplicationWithConfigureMvcTest_Desktop.cs
  261. diff --git a/test/FunctionalTests/ApplicationWithCustomInputFilesTest_Desktop.cs b/test/FunctionalTests/DesktopTests/ApplicationWithCustomInputFilesTest_Desktop.cs
  262. similarity index 100%
  263. rename from test/FunctionalTests/ApplicationWithCustomInputFilesTest_Desktop.cs
  264. rename to test/FunctionalTests/DesktopTests/ApplicationWithCustomInputFilesTest_Desktop.cs
  265. diff --git a/test/FunctionalTests/ApplicationWithParseErrorsTest_Desktop.cs b/test/FunctionalTests/DesktopTests/ApplicationWithParseErrorsTest_Desktop.cs
  266. similarity index 100%
  267. rename from test/FunctionalTests/ApplicationWithParseErrorsTest_Desktop.cs
  268. rename to test/FunctionalTests/DesktopTests/ApplicationWithParseErrorsTest_Desktop.cs
  269. diff --git a/test/FunctionalTests/ApplicationWithTagHelpersTest_Desktop.cs b/test/FunctionalTests/DesktopTests/ApplicationWithTagHelpersTest_Desktop.cs
  270. similarity index 100%
  271. rename from test/FunctionalTests/ApplicationWithTagHelpersTest_Desktop.cs
  272. rename to test/FunctionalTests/DesktopTests/ApplicationWithTagHelpersTest_Desktop.cs
  273. diff --git a/test/FunctionalTests/CopyBuildOutputToPublishDirectoryTest_Desktop.cs b/test/FunctionalTests/DesktopTests/CopyBuildOutputToPublishDirectoryTest_Desktop.cs
  274. similarity index 100%
  275. rename from test/FunctionalTests/CopyBuildOutputToPublishDirectoryTest_Desktop.cs
  276. rename to test/FunctionalTests/DesktopTests/CopyBuildOutputToPublishDirectoryTest_Desktop.cs
  277. diff --git a/test/FunctionalTests/CopyOutputSymbolsToPublishDirectoryTest_Desktop.cs b/test/FunctionalTests/DesktopTests/CopyOutputSymbolsToPublishDirectoryTest_Desktop.cs
  278. similarity index 100%
  279. rename from test/FunctionalTests/CopyOutputSymbolsToPublishDirectoryTest_Desktop.cs
  280. rename to test/FunctionalTests/DesktopTests/CopyOutputSymbolsToPublishDirectoryTest_Desktop.cs
  281. diff --git a/test/FunctionalTests/Infrastructure/DesktopApplicationTestFixture.cs b/test/FunctionalTests/DesktopTests/DesktopApplicationTestFixture.cs
  282. similarity index 90%
  283. rename from test/FunctionalTests/Infrastructure/DesktopApplicationTestFixture.cs
  284. rename to test/FunctionalTests/DesktopTests/DesktopApplicationTestFixture.cs
  285. index 7e3579a017c..a95dc59e7fa 100644
  286. --- a/test/FunctionalTests/Infrastructure/DesktopApplicationTestFixture.cs
  287. +++ b/test/FunctionalTests/DesktopTests/DesktopApplicationTestFixture.cs
  288. @@ -17,6 +17,6 @@ namespace FunctionalTests
  289. {
  290. }
  291. - protected override DeploymentParameters GetDeploymentParameters() => base.GetDeploymentParameters(RuntimeFlavor.Clr);
  292. + protected override DeploymentParameters GetDeploymentParameters() => base.GetDeploymentParameters(RuntimeFlavor.Clr, "net461");
  293. }
  294. }
  295. diff --git a/test/FunctionalTests/PublishWithDebugTest_Desktop.cs b/test/FunctionalTests/DesktopTests/PublishWithDebugTest_Desktop.cs
  296. similarity index 79%
  297. rename from test/FunctionalTests/PublishWithDebugTest_Desktop.cs
  298. rename to test/FunctionalTests/DesktopTests/PublishWithDebugTest_Desktop.cs
  299. index 22c940ddbd3..0bc3ddb6ae4 100644
  300. --- a/test/FunctionalTests/PublishWithDebugTest_Desktop.cs
  301. +++ b/test/FunctionalTests/DesktopTests/PublishWithDebugTest_Desktop.cs
  302. @@ -1,6 +1,7 @@
  303. // Copyright (c) .NET Foundation. All rights reserved.
  304. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
  305. +using System.IO;
  306. using System.Threading.Tasks;
  307. using Microsoft.AspNetCore.Server.IntegrationTesting;
  308. using Microsoft.AspNetCore.Testing.xunit;
  309. @@ -26,6 +27,7 @@ namespace FunctionalTests
  310. public ApplicationTestFixture Fixture { get; }
  311. [ConditionalFact]
  312. + [Fact]
  313. public async Task PublishingInDebugWorks()
  314. {
  315. using (StartLog(out var loggerFactory))
  316. @@ -33,18 +35,19 @@ namespace FunctionalTests
  317. // Arrange
  318. var deployment = await Fixture.CreateDeploymentAsync(loggerFactory);
  319. - // Act
  320. - var response = await deployment.HttpClient.GetStringWithRetryAsync(
  321. - deployment.ApplicationBaseUri,
  322. - loggerFactory.CreateLogger(Fixture.ApplicationName));
  323. -
  324. // Assert
  325. - TestEmbeddedResource.AssertContent("SimpleAppTest.Home.Index.txt", response);
  326. + var expected = Path.Combine(deployment.ContentRoot, $"{Fixture.ApplicationName}.PrecompiledViews.dll");
  327. + Assert.True(File.Exists(expected), $"File {expected} does not exist.");
  328. }
  329. }
  330. - public class TestFixture : DesktopApplicationTestFixture<SimpleApp.Startup>
  331. + public class TestFixture : CoreCLRApplicationTestFixture<SimpleApp.Startup>
  332. {
  333. + public TestFixture()
  334. + {
  335. + PublishOnly = true;
  336. + }
  337. +
  338. protected override DeploymentParameters GetDeploymentParameters()
  339. {
  340. var deploymentParameters = base.GetDeploymentParameters();
  341. diff --git a/test/FunctionalTests/PublishWithEmbedViewSourcesTest_Desktop.cs b/test/FunctionalTests/DesktopTests/PublishWithEmbedViewSourcesTest_Desktop.cs
  342. similarity index 100%
  343. rename from test/FunctionalTests/PublishWithEmbedViewSourcesTest_Desktop.cs
  344. rename to test/FunctionalTests/DesktopTests/PublishWithEmbedViewSourcesTest_Desktop.cs
  345. diff --git a/test/FunctionalTests/RazorPagesAppTest_Desktop.cs b/test/FunctionalTests/DesktopTests/RazorPagesAppTest_Desktop.cs
  346. similarity index 100%
  347. rename from test/FunctionalTests/RazorPagesAppTest_Desktop.cs
  348. rename to test/FunctionalTests/DesktopTests/RazorPagesAppTest_Desktop.cs
  349. diff --git a/test/FunctionalTests/SimpleAppTest_Desktop.cs b/test/FunctionalTests/DesktopTests/SimpleAppTest_Desktop.cs
  350. similarity index 100%
  351. rename from test/FunctionalTests/SimpleAppTest_Desktop.cs
  352. rename to test/FunctionalTests/DesktopTests/SimpleAppTest_Desktop.cs
  353. diff --git a/test/FunctionalTests/SimpleAppWithAssemblyRenameTest_Desktop.cs b/test/FunctionalTests/DesktopTests/SimpleAppWithAssemblyRenameTest_Desktop.cs
  354. similarity index 100%
  355. rename from test/FunctionalTests/SimpleAppWithAssemblyRenameTest_Desktop.cs
  356. rename to test/FunctionalTests/DesktopTests/SimpleAppWithAssemblyRenameTest_Desktop.cs
  357. diff --git a/test/FunctionalTests/StrongNamedAppTest_Desktop.cs b/test/FunctionalTests/DesktopTests/StrongNamedAppTest_Desktop.cs
  358. similarity index 100%
  359. rename from test/FunctionalTests/StrongNamedAppTest_Desktop.cs
  360. rename to test/FunctionalTests/DesktopTests/StrongNamedAppTest_Desktop.cs
  361. diff --git a/test/FunctionalTests/ViewCompilationOptionsTest_Desktop.cs b/test/FunctionalTests/DesktopTests/ViewCompilationOptionsTest_Desktop.cs
  362. similarity index 100%
  363. rename from test/FunctionalTests/ViewCompilationOptionsTest_Desktop.cs
  364. rename to test/FunctionalTests/DesktopTests/ViewCompilationOptionsTest_Desktop.cs
  365. diff --git a/test/FunctionalTests/FunctionalTests.csproj b/test/FunctionalTests/FunctionalTests.csproj
  366. index 29ab9c41187..2ea5cec310d 100644
  367. --- a/test/FunctionalTests/FunctionalTests.csproj
  368. +++ b/test/FunctionalTests/FunctionalTests.csproj
  369. @@ -1,15 +1,21 @@
  370. <Project Sdk="Microsoft.NET.Sdk">
  371. <PropertyGroup>
  372. - <TargetFramework>netcoreapp2.0</TargetFramework>
  373. + <TargetFrameworks>netcoreapp2.1</TargetFrameworks>
  374. + <TargetFrameworks Condition="'$(DeveloperBuild)'!='true'">$(TargetFrameworks);netcoreapp2.0</TargetFrameworks>
  375. +
  376. <DefineConstants>$(DefineConstants);__remove_this_to__GENERATE_BASELINES</DefineConstants>
  377. <DefineConstants Condition="'$(GenerateBaseLines)'=='true'">$(DefineConstants);GENERATE_BASELINES</DefineConstants>
  378. <SignAssembly>false</SignAssembly>
  379. <PublicSign>false</PublicSign>
  380. + <EnableDefaultCompileItems>false</EnableDefaultCompileItems>
  381. </PropertyGroup>
  382. <ItemGroup>
  383. <EmbeddedResource Include="Resources\*" />
  384. + <Compile Include="Infrastructure\*.cs" />
  385. + <Compile Include="DesktopTests\*.cs" Condition="'$(TargetFramework)'=='net461'" />
  386. + <Compile Include="CoreCLRTests\*.cs" Condition="'$(TargetFramework)'=='netcoreapp2.0' OR '$(TargetFramework)'=='netcoreapp2.1'" />
  387. </ItemGroup>
  388. <ItemGroup>
  389. diff --git a/test/FunctionalTests/Infrastructure/ApplicationTestFixture.cs b/test/FunctionalTests/Infrastructure/ApplicationTestFixture.cs
  390. index 051f4cf2b65..56e988e05fc 100644
  391. --- a/test/FunctionalTests/Infrastructure/ApplicationTestFixture.cs
  392. +++ b/test/FunctionalTests/Infrastructure/ApplicationTestFixture.cs
  393. @@ -3,6 +3,7 @@
  394. using System;
  395. using System.Collections.Generic;
  396. +using System.Threading;
  397. using System.Threading.Tasks;
  398. using Microsoft.AspNetCore.Server.IntegrationTesting;
  399. using Microsoft.Extensions.Logging;
  400. @@ -12,7 +13,7 @@ namespace FunctionalTests
  401. public abstract class ApplicationTestFixture : IDisposable
  402. {
  403. private const string DotnetCLITelemetryOptOut = "DOTNET_CLI_TELEMETRY_OPTOUT";
  404. - private readonly object _deploymentLock = new object();
  405. + private static readonly SemaphoreSlim _deploymentLock = new SemaphoreSlim(initialCount: 1);
  406. private Task<DeploymentResult> _deploymentTask;
  407. private IApplicationDeployer _deployer;
  408. @@ -30,14 +31,20 @@ namespace FunctionalTests
  409. protected abstract DeploymentParameters GetDeploymentParameters();
  410. - protected DeploymentParameters GetDeploymentParameters(RuntimeFlavor flavor)
  411. - => GetDeploymentParameters(ApplicationPath, ApplicationName, flavor);
  412. + protected DeploymentParameters GetDeploymentParameters(RuntimeFlavor flavor, string targetFramework)
  413. + => GetDeploymentParameters(ApplicationPath, ApplicationName, flavor, targetFramework);
  414. - public static DeploymentParameters GetDeploymentParameters(string applicationPath, string applicationName, RuntimeFlavor flavor)
  415. + public static DeploymentParameters GetDeploymentParameters(string applicationPath, string applicationName, RuntimeFlavor flavor, string targetFramework)
  416. {
  417. - var telemetryOptOut = new KeyValuePair<string, string>(
  418. - DotnetCLITelemetryOptOut,
  419. - "1");
  420. + // This determines the configuration of the the test project and consequently the configuration the src projects are most likely built in.
  421. + var projectConfiguration =
  422. +#if DEBUG
  423. + "Debug";
  424. +#elif RELEASE
  425. + "Release";
  426. +#else
  427. +#error Unknown configuration
  428. +#endif
  429. var deploymentParameters = new DeploymentParameters(
  430. applicationPath,
  431. @@ -47,16 +54,18 @@ namespace FunctionalTests
  432. {
  433. ApplicationName = applicationName,
  434. PublishApplicationBeforeDeployment = true,
  435. - TargetFramework = flavor == RuntimeFlavor.Clr ? "net461" : "netcoreapp2.0",
  436. Configuration = "Release",
  437. EnvironmentVariables =
  438. {
  439. - telemetryOptOut,
  440. + new KeyValuePair<string, string>(DotnetCLITelemetryOptOut, "1"),
  441. + new KeyValuePair<string, string>("SolutionConfiguration", projectConfiguration),
  442. },
  443. PublishEnvironmentVariables =
  444. {
  445. - telemetryOptOut,
  446. + new KeyValuePair<string, string>(DotnetCLITelemetryOptOut, "1"),
  447. + new KeyValuePair<string, string>("SolutionConfiguration", projectConfiguration),
  448. },
  449. + TargetFramework = targetFramework,
  450. };
  451. return deploymentParameters;
  452. @@ -74,8 +83,9 @@ namespace FunctionalTests
  453. public async Task<DeploymentResult> CreateDeploymentAsync(ILoggerFactory loggerFactory)
  454. {
  455. - lock (_deploymentLock)
  456. + try
  457. {
  458. + await _deploymentLock.WaitAsync(TimeSpan.FromSeconds(10));
  459. if (_deploymentTask == null)
  460. {
  461. var deploymentParameters = GetDeploymentParameters();
  462. @@ -91,6 +101,10 @@ namespace FunctionalTests
  463. _deploymentTask = _deployer.DeployAsync();
  464. }
  465. }
  466. + finally
  467. + {
  468. + _deploymentLock.Release();
  469. + }
  470. return await _deploymentTask;
  471. }
  472. diff --git a/test/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Test/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Test.csproj b/test/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Test/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Test.csproj
  473. index 74c0b9d1611..06337dac6af 100644
  474. --- a/test/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Test/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Test.csproj
  475. +++ b/test/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Test/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Test.csproj
  476. @@ -1,8 +1,7 @@
  477. <Project Sdk="Microsoft.NET.Sdk">
  478. <PropertyGroup>
  479. - <TargetFrameworks>netcoreapp2.0;net461</TargetFrameworks>
  480. - <TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">netcoreapp2.0</TargetFrameworks>
  481. + <TargetFrameworks>$(StandardTestTfms)</TargetFrameworks>
  482. </PropertyGroup>
  483. <ItemGroup>
  484. diff --git a/testapps/ApplicationUsingPrecompiledViewClassLibrary/ApplicationUsingPrecompiledViewClassLibrary.csproj b/testapps/ApplicationUsingPrecompiledViewClassLibrary/ApplicationUsingPrecompiledViewClassLibrary.csproj
  485. index 9478314e473..631f5900b13 100644
  486. --- a/testapps/ApplicationUsingPrecompiledViewClassLibrary/ApplicationUsingPrecompiledViewClassLibrary.csproj
  487. +++ b/testapps/ApplicationUsingPrecompiledViewClassLibrary/ApplicationUsingPrecompiledViewClassLibrary.csproj
  488. @@ -1,8 +1,7 @@
  489. <Project Sdk="Microsoft.NET.Sdk.Web">
  490. <PropertyGroup>
  491. - <TargetFrameworks>netcoreapp2.0;net461</TargetFrameworks>
  492. - <TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">netcoreapp2.0</TargetFrameworks>
  493. + <TargetFrameworks>$(StandardTestAppTfms)</TargetFrameworks>
  494. <ClassLibraryProjectPath>..\ClassLibraryWithPrecompiledViews\ClassLibraryWithPrecompiledViews.csproj</ClassLibraryProjectPath>
  495. </PropertyGroup>
  496. diff --git a/testapps/ApplicationUsingRelativePaths/ApplicationUsingRelativePaths.csproj b/testapps/ApplicationUsingRelativePaths/ApplicationUsingRelativePaths.csproj
  497. index 85a0a8df382..f330f2386dc 100644
  498. --- a/testapps/ApplicationUsingRelativePaths/ApplicationUsingRelativePaths.csproj
  499. +++ b/testapps/ApplicationUsingRelativePaths/ApplicationUsingRelativePaths.csproj
  500. @@ -1,8 +1,7 @@
  501. <Project Sdk="Microsoft.NET.Sdk.Web">
  502. <PropertyGroup>
  503. - <TargetFrameworks>netcoreapp2.0;net461</TargetFrameworks>
  504. - <TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">netcoreapp2.0</TargetFrameworks>
  505. + <TargetFrameworks>$(StandardTestAppTfms)</TargetFrameworks>
  506. <MvcRazorCompileOnPublish>true</MvcRazorCompileOnPublish>
  507. </PropertyGroup>
  508. diff --git a/testapps/ApplicationWithConfigureMvc/ApplicationWithConfigureMvc.csproj b/testapps/ApplicationWithConfigureMvc/ApplicationWithConfigureMvc.csproj
  509. index 4aee9fb627c..f27f45283ba 100644
  510. --- a/testapps/ApplicationWithConfigureMvc/ApplicationWithConfigureMvc.csproj
  511. +++ b/testapps/ApplicationWithConfigureMvc/ApplicationWithConfigureMvc.csproj
  512. @@ -1,8 +1,7 @@
  513. <Project Sdk="Microsoft.NET.Sdk.Web">
  514. <PropertyGroup>
  515. - <TargetFrameworks>netcoreapp2.0;net461</TargetFrameworks>
  516. - <TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">netcoreapp2.0</TargetFrameworks>
  517. + <TargetFrameworks>$(StandardTestAppTfms)</TargetFrameworks>
  518. <MvcRazorCompileOnPublish>true</MvcRazorCompileOnPublish>
  519. <DefineConstants>$(DefineConstants);TEST123</DefineConstants>
  520. </PropertyGroup>
  521. diff --git a/testapps/ApplicationWithCustomInputFiles/ApplicationWithCustomInputFiles.csproj b/testapps/ApplicationWithCustomInputFiles/ApplicationWithCustomInputFiles.csproj
  522. index 95c4f130ad9..f9904ee7666 100644
  523. --- a/testapps/ApplicationWithCustomInputFiles/ApplicationWithCustomInputFiles.csproj
  524. +++ b/testapps/ApplicationWithCustomInputFiles/ApplicationWithCustomInputFiles.csproj
  525. @@ -1,8 +1,7 @@
  526. <Project Sdk="Microsoft.NET.Sdk.Web">
  527. <PropertyGroup>
  528. - <TargetFrameworks>netcoreapp2.0;net461</TargetFrameworks>
  529. - <TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">netcoreapp2.0</TargetFrameworks>
  530. + <TargetFrameworks>$(StandardTestAppTfms)</TargetFrameworks>
  531. <MvcRazorCompileOnPublish>true</MvcRazorCompileOnPublish>
  532. <MvcRazorEmbedViewSources>true</MvcRazorEmbedViewSources>
  533. </PropertyGroup>
  534. diff --git a/testapps/ApplicationWithParseErrors/ApplicationWithParseErrors.csproj b/testapps/ApplicationWithParseErrors/ApplicationWithParseErrors.csproj
  535. index 85a0a8df382..f330f2386dc 100644
  536. --- a/testapps/ApplicationWithParseErrors/ApplicationWithParseErrors.csproj
  537. +++ b/testapps/ApplicationWithParseErrors/ApplicationWithParseErrors.csproj
  538. @@ -1,8 +1,7 @@
  539. <Project Sdk="Microsoft.NET.Sdk.Web">
  540. <PropertyGroup>
  541. - <TargetFrameworks>netcoreapp2.0;net461</TargetFrameworks>
  542. - <TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">netcoreapp2.0</TargetFrameworks>
  543. + <TargetFrameworks>$(StandardTestAppTfms)</TargetFrameworks>
  544. <MvcRazorCompileOnPublish>true</MvcRazorCompileOnPublish>
  545. </PropertyGroup>
  546. diff --git a/testapps/ApplicationWithTagHelpers/ApplicationWithTagHelpers.csproj b/testapps/ApplicationWithTagHelpers/ApplicationWithTagHelpers.csproj
  547. index c6c8b6e41c1..d86ac254e60 100644
  548. --- a/testapps/ApplicationWithTagHelpers/ApplicationWithTagHelpers.csproj
  549. +++ b/testapps/ApplicationWithTagHelpers/ApplicationWithTagHelpers.csproj
  550. @@ -1,8 +1,7 @@
  551. <Project Sdk="Microsoft.NET.Sdk.Web">
  552. <PropertyGroup>
  553. - <TargetFrameworks>netcoreapp2.0;net461</TargetFrameworks>
  554. - <TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">netcoreapp2.0</TargetFrameworks>
  555. + <TargetFrameworks>$(StandardTestAppTfms)</TargetFrameworks>
  556. <MvcRazorCompileOnPublish>true</MvcRazorCompileOnPublish>
  557. </PropertyGroup>
  558. diff --git a/testapps/ClassLibraryTagHelper/ClassLibraryTagHelper.csproj b/testapps/ClassLibraryTagHelper/ClassLibraryTagHelper.csproj
  559. index f5366971887..309df3008e2 100644
  560. --- a/testapps/ClassLibraryTagHelper/ClassLibraryTagHelper.csproj
  561. +++ b/testapps/ClassLibraryTagHelper/ClassLibraryTagHelper.csproj
  562. @@ -1,8 +1,7 @@
  563. <Project Sdk="Microsoft.NET.Sdk">
  564. <PropertyGroup>
  565. - <TargetFrameworks>netstandard2.0;net461</TargetFrameworks>
  566. - <TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">netstandard2.0</TargetFrameworks>
  567. + <TargetFramework>netstandard2.0</TargetFramework>
  568. </PropertyGroup>
  569. <ItemGroup>
  570. diff --git a/testapps/ClassLibraryWithPrecompiledViews/ClassLibraryWithPrecompiledViews.csproj b/testapps/ClassLibraryWithPrecompiledViews/ClassLibraryWithPrecompiledViews.csproj
  571. index 4ba7c2f5c3b..b0e5e2f4174 100644
  572. --- a/testapps/ClassLibraryWithPrecompiledViews/ClassLibraryWithPrecompiledViews.csproj
  573. +++ b/testapps/ClassLibraryWithPrecompiledViews/ClassLibraryWithPrecompiledViews.csproj
  574. @@ -1,14 +1,14 @@
  575. <Project Sdk="Microsoft.NET.Sdk.Web">
  576. <PropertyGroup>
  577. - <TargetFrameworks>netcoreapp2.0;net461</TargetFrameworks>
  578. - <TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">netcoreapp2.0</TargetFrameworks>
  579. + <TargetFrameworks>$(StandardTestAppTfms)</TargetFrameworks>
  580. <MvcRazorOutputPath Condition="'$(TargetFramework)'!=''">obj\precompiled\$(TargetFramework)</MvcRazorOutputPath>
  581. <TestIncludeViewCompilationTargets>true</TestIncludeViewCompilationTargets>
  582. </PropertyGroup>
  583. <ItemGroup>
  584. <PackageReference Include="Microsoft.AspNetCore.Mvc" Version="$(MicrosoftAspNetCoreMvcPackageVersion)" />
  585. + <PackageReference Include="Microsoft.AspNetCore.Hosting" Version="$(MicrosoftAspNetCoreHostingPackageVersion)" />
  586. </ItemGroup>
  587. </Project>
  588. diff --git a/testapps/Directory.Build.props b/testapps/Directory.Build.props
  589. index 0094c38ae4a..35e9c46835d 100644
  590. --- a/testapps/Directory.Build.props
  591. +++ b/testapps/Directory.Build.props
  592. @@ -1,6 +1,13 @@
  593. <Project>
  594. <Import Project="..\Directory.Build.props" />
  595. + <PropertyGroup>
  596. + <DeveloperBuildTestAppTfms>netcoreapp2.1</DeveloperBuildTestAppTfms>
  597. + <StandardTestAppTfms>$(DeveloperBuildTestAppTfms)</StandardTestAppTfms>
  598. + <StandardTestAppTfms Condition=" '$(DeveloperBuild)' != 'true' ">netcoreapp2.1;netcoreapp2.0</StandardTestAppTfms>
  599. + <StandardTestAppTfms Condition=" '$(DeveloperBuild)' != 'true' AND '$(OS)' == 'Windows_NT' ">$(StandardTestAppTfms);net461</StandardTestAppTfms>
  600. + </PropertyGroup>
  601. +
  602. <PropertyGroup>
  603. <!-- Override some repo-level properties not required for tests. -->
  604. <Version>1.0.0</Version>
  605. diff --git a/testapps/Directory.Build.targets b/testapps/Directory.Build.targets
  606. index a56638ed5cd..4b805513d64 100644
  607. --- a/testapps/Directory.Build.targets
  608. +++ b/testapps/Directory.Build.targets
  609. @@ -4,23 +4,20 @@
  610. <PropertyGroup>
  611. <_MvcViewCompilationAddDesktopReferences>false</_MvcViewCompilationAddDesktopReferences>
  612. <TestIncludeViewCompilationTargets Condition="'$(TestIncludeViewCompilationTargets)'==''">$(MvcRazorCompileOnPublish)</TestIncludeViewCompilationTargets>
  613. - <_MvcViewCompilationTasksPath>$(MSBuildThisFileDirectory)..\src\Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Tasks\bin\$(Configuration)\netstandard2.0\Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Tasks.dll</_MvcViewCompilationTasksPath>
  614. + <SolutionConfiguration Condition="'$(SolutionConfiguration)'==''">$(Configuration)</SolutionConfiguration>
  615. + <_MvcViewCompilationTasksPath>$(MSBuildThisFileDirectory)..\src\Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Tasks\bin\$(SolutionConfiguration)\netstandard2.0\Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Tasks.dll</_MvcViewCompilationTasksPath>
  616. </PropertyGroup>
  617. <Import Project="..\src\Microsoft.AspNetCore.Mvc.Razor.ViewCompilation\build\netstandard2.0\Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.targets"
  618. Condition="'$(TestIncludeViewCompilationTargets)'=='true'"/>
  619. - <ItemGroup Condition="'$(TestIncludeViewCompilationTargets)'=='true'">
  620. - <ProjectReference Include="..\..\src\Microsoft.AspNetCore.Mvc.Razor.ViewCompilation\Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.csproj" />
  621. - </ItemGroup>
  622. -
  623. <Target
  624. Name="SetMvcRazorViewCompilationBinaryPath"
  625. BeforeTargets="MvcRazorPrecompile"
  626. Condition="'$(TestIncludeViewCompilationTargets)'=='true'">
  627. <PropertyGroup>
  628. - <_MvcViewCompilationBinaryPath Condition="'$(TargetFramework)'=='netcoreapp2.0'">$(MSBuildProjectDirectory)\$(OutputPath)Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.dll</_MvcViewCompilationBinaryPath>
  629. - <_MvcViewCompilationBinaryPath Condition="'$(TargetFramework)'=='net461'">$(MSBuildProjectDirectory)\$(OutputPath)Microsoft.AspNetCore.Mvc.Razor.ViewCompilation-x86.exe</_MvcViewCompilationBinaryPath>
  630. + <_MvcViewCompilationBinaryPath Condition="'$(TargetFramework)'!='net461'">$(MSBuildThisFileDirectory)..\src\Microsoft.AspNetCore.Mvc.Razor.ViewCompilation\bin\$(SolutionConfiguration)\netcoreapp2.0\Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.dll</_MvcViewCompilationBinaryPath>
  631. + <_MvcViewCompilationBinaryPath Condition="'$(TargetFramework)'=='net461'">$(MSBuildThisFileDirectory)..\src\Microsoft.AspNetCore.Mvc.Razor.ViewCompilation\bin\$(SolutionConfiguration)\net461\win7-x86\Microsoft.AspNetCore.Mvc.Razor.ViewCompilation-x86.exe</_MvcViewCompilationBinaryPath>
  632. </PropertyGroup>
  633. </Target>
  634. </Project>
  635. diff --git a/testapps/PublishWithEmbedViewSources/PublishWithEmbedViewSources.csproj b/testapps/PublishWithEmbedViewSources/PublishWithEmbedViewSources.csproj
  636. index 9f3dc474900..1362dd84ec2 100644
  637. --- a/testapps/PublishWithEmbedViewSources/PublishWithEmbedViewSources.csproj
  638. +++ b/testapps/PublishWithEmbedViewSources/PublishWithEmbedViewSources.csproj
  639. @@ -1,8 +1,7 @@
  640. <Project Sdk="Microsoft.NET.Sdk.Web">
  641. <PropertyGroup>
  642. - <TargetFrameworks>netcoreapp2.0;net461</TargetFrameworks>
  643. - <TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">netcoreapp2.0</TargetFrameworks>
  644. + <TargetFrameworks>$(StandardTestAppTfms)</TargetFrameworks>
  645. <MvcRazorCompileOnPublish>true</MvcRazorCompileOnPublish>
  646. <MvcRazorEmbedViewSources>true</MvcRazorEmbedViewSources>
  647. </PropertyGroup>
  648. diff --git a/testapps/RazorPagesApp/RazorPagesApp.csproj b/testapps/RazorPagesApp/RazorPagesApp.csproj
  649. index 9c7c5ab6b04..5ab7219211f 100644
  650. --- a/testapps/RazorPagesApp/RazorPagesApp.csproj
  651. +++ b/testapps/RazorPagesApp/RazorPagesApp.csproj
  652. @@ -1,8 +1,7 @@
  653. <Project Sdk="Microsoft.NET.Sdk.Web">
  654. <PropertyGroup>
  655. - <TargetFrameworks>netcoreapp2.0;net461</TargetFrameworks>
  656. - <TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">netcoreapp2.0</TargetFrameworks>
  657. + <TargetFrameworks>$(StandardTestAppTfms)</TargetFrameworks>
  658. <MvcRazorCompileOnPublish>true</MvcRazorCompileOnPublish>
  659. </PropertyGroup>
  660. diff --git a/testapps/SimpleApp/SimpleApp.csproj b/testapps/SimpleApp/SimpleApp.csproj
  661. index f5f65c45cae..f57d869aebf 100644
  662. --- a/testapps/SimpleApp/SimpleApp.csproj
  663. +++ b/testapps/SimpleApp/SimpleApp.csproj
  664. @@ -1,8 +1,7 @@
  665. <Project Sdk="Microsoft.NET.Sdk.Web">
  666. <PropertyGroup>
  667. - <TargetFrameworks>netcoreapp2.0;net461</TargetFrameworks>
  668. - <TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">netcoreapp2.0</TargetFrameworks>
  669. + <TargetFrameworks>$(StandardTestAppTfms)</TargetFrameworks>
  670. <RuntimeIdentifiers>win7-x86;debian-x64</RuntimeIdentifiers>
  671. <MvcRazorCompileOnPublish>true</MvcRazorCompileOnPublish>
  672. </PropertyGroup>
  673. diff --git a/testapps/SimpleAppWithAssemblyRename/SimpleAppWithAssemblyRename.csproj b/testapps/SimpleAppWithAssemblyRename/SimpleAppWithAssemblyRename.csproj
  674. index bee405d99b0..1a8db3562d4 100644
  675. --- a/testapps/SimpleAppWithAssemblyRename/SimpleAppWithAssemblyRename.csproj
  676. +++ b/testapps/SimpleAppWithAssemblyRename/SimpleAppWithAssemblyRename.csproj
  677. @@ -2,8 +2,7 @@
  678. <PropertyGroup>
  679. <AssemblyName>NewAssemblyName</AssemblyName>
  680. - <TargetFrameworks>netcoreapp2.0;net461</TargetFrameworks>
  681. - <TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">netcoreapp2.0</TargetFrameworks>
  682. + <TargetFrameworks>$(StandardTestAppTfms)</TargetFrameworks>
  683. <MvcRazorCompileOnPublish>true</MvcRazorCompileOnPublish>
  684. </PropertyGroup>
  685. diff --git a/testapps/StrongNamedApp/StrongNamedApp.csproj b/testapps/StrongNamedApp/StrongNamedApp.csproj
  686. index d72479411d6..96917465907 100644
  687. --- a/testapps/StrongNamedApp/StrongNamedApp.csproj
  688. +++ b/testapps/StrongNamedApp/StrongNamedApp.csproj
  689. @@ -1,8 +1,7 @@
  690. <Project Sdk="Microsoft.NET.Sdk.Web">
  691. <PropertyGroup>
  692. - <TargetFrameworks>netcoreapp2.0;net461</TargetFrameworks>
  693. - <TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">netcoreapp2.0</TargetFrameworks>
  694. + <TargetFrameworks>$(StandardTestAppTfms)</TargetFrameworks>
  695. <SignAssembly>true</SignAssembly>
  696. <PublicSign Condition=" '$(OS)' != 'Windows_NT' ">true</PublicSign>
  697. <MvcRazorCompileOnPublish>true</MvcRazorCompileOnPublish>