Update test projects to use latest Roslyn.

- This is a temporary workaround until we're able to get on the latest SDK which includes the latest Roslyn bits. Without them we can't properly publish testapps in a standalone fashion without investing in temporary infrastructure.
\n\nCommit migrated from 21fcd9c2f5
This commit is contained in:
N. Taylor Mullen 2019-07-16 17:25:57 -07:00
parent b724885f38
commit d62381d659
2 changed files with 28 additions and 0 deletions

View File

@ -77,6 +77,12 @@ namespace Microsoft.AspNetCore.Razor.Design.IntegrationTests
[InitializeTestProject(originalProjectName: "SimpleMvc", targetProjectName: "Whitespace in name", baseDirectory: "")]
public async Task Build_AppWithWhitespaceInName_CanBuildSuccessfully()
{
// We need to separately restore the project in order to ensure this project uses the latest Roslyn. Without this
// the Csc task from Roslyn would have already been loaded and any update to it from nuget packages would not have
// an effect. This allows us to create our obj/Whitespace in name.csproj.nuget.g.props file (we renamed the project)
// and then properly build the project with an appropriate Csc.
await DotnetMSBuild("Restore");
var result = await DotnetMSBuild(
"Build",
"/p:_RazorForceBuildServer=true");

View File

@ -38,4 +38,26 @@
<Import Project="After.Directory.Build.props" Condition="Exists('After.Directory.Build.props')" />
<!--
NOTE, BELOW
These bits are a temporary workaround until we're able to get on the latest SDK which includes the latest Roslyn bits.
Without them we can't properly publish testapps in a standalone fashion without investing in temporary infrastructure.
-->
<PropertyGroup>
<MicrosoftNetCompilersToolsetPackageVersion>3.3.0-beta2-19365-06</MicrosoftNetCompilersToolsetPackageVersion>
<RestoreSources Condition="'$(DotNetBuildOffline)' != 'true' ">
$(RestoreSources);
https://dotnet.myget.org/F/roslyn/api/v3/index.json;
</RestoreSources>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Net.Compilers.Toolset"
Version="$(MicrosoftNetCompilersToolsetPackageVersion)"
PrivateAssets="all"
IsImplicitlyDefined="true" />
</ItemGroup>
</Project>