aspnetcore-tooling migration fixups

This commit is contained in:
John Luo 2020-05-16 18:07:24 -07:00
parent c565c2a4f1
commit 50f3a16571
75 changed files with 425 additions and 388 deletions

View File

@ -151,7 +151,7 @@ stages:
$(_InternalRuntimeDownloadArgs) $(_InternalRuntimeDownloadArgs)
displayName: Build x86 displayName: Build x86
# This is in a separate build step with -forceCoreMsbuild to workaround MAX_PATH limitations - https://github.com/Microsoft/msbuild/issues/53 # This is in a separate build step with to workaround MAX_PATH limitations - https://github.com/Microsoft/msbuild/issues/53
- script: .\src\SiteExtensions\build.cmd - script: .\src\SiteExtensions\build.cmd
-ci -ci
-nobl -nobl

View File

@ -56,6 +56,7 @@
<IncludeSymbols>true</IncludeSymbols> <IncludeSymbols>true</IncludeSymbols>
<!-- Also update the DefaultNetCoreTargetFramework defined at src/Razor/test/testassets/Directory.Build.props -->
<DefaultNetCoreTargetFramework>net5.0</DefaultNetCoreTargetFramework> <DefaultNetCoreTargetFramework>net5.0</DefaultNetCoreTargetFramework>
</PropertyGroup> </PropertyGroup>
@ -70,6 +71,9 @@
<NoWarn>$(NoWarn);NU5131</NoWarn> <NoWarn>$(NoWarn);NU5131</NoWarn>
<!-- Needed until we resolve https://github.com/dotnet/aspnetcore-internal/issues/3103 --> <!-- Needed until we resolve https://github.com/dotnet/aspnetcore-internal/issues/3103 -->
<NoWarn>$(NoWarn);NU5048</NoWarn> <NoWarn>$(NoWarn);NU5048</NoWarn>
<!-- TODO: Figure out why these warnings are occuring -->
<NoWarn Condition="'$(IsAnalyzersProject)' == 'true'">$(NoWarn);RS1024;RS1025;RS1026</NoWarn>
</PropertyGroup> </PropertyGroup>
<!-- Source code settings --> <!-- Source code settings -->

View File

@ -166,6 +166,7 @@
Exclude=" Exclude="
@(ProjectToBuild); @(ProjectToBuild);
@(ProjectToExclude); @(ProjectToExclude);
$(RepoRoot)src\Razor\test\testassets\**\*.*proj;
$(RepoRoot)**\node_modules\**\*; $(RepoRoot)**\node_modules\**\*;
$(RepoRoot)**\bin\**\*; $(RepoRoot)**\bin\**\*;
$(RepoRoot)**\obj\**\*;" $(RepoRoot)**\obj\**\*;"
@ -202,6 +203,7 @@
Exclude=" Exclude="
@(ProjectToBuild); @(ProjectToBuild);
@(ProjectToExclude); @(ProjectToExclude);
$(RepoRoot)src\Razor\test\testassets\**\*.*proj;
$(RepoRoot)**\node_modules\**\*; $(RepoRoot)**\node_modules\**\*;
$(RepoRoot)**\bin\**\*; $(RepoRoot)**\bin\**\*;
$(RepoRoot)**\obj\**\*;" $(RepoRoot)**\obj\**\*;"

View File

@ -20,13 +20,10 @@ and are generated based on the last package release.
</ItemDefinitionGroup> </ItemDefinitionGroup>
<ItemGroup Label=".NET team dependencies"> <ItemGroup Label=".NET team dependencies">
<LatestPackageReference Include="Microsoft.AspNetCore.Mvc.Razor.Extensions" Version="$(MicrosoftAspNetCoreMvcRazorExtensionsPackageVersion)" />
<LatestPackageReference Include="Microsoft.AspNetCore.Razor.Language" Version="$(MicrosoftAspNetCoreRazorLanguagePackageVersion)" />
<LatestPackageReference Include="Microsoft.Azure.SignalR" Version="$(MicrosoftAzureSignalRPackageVersion)" /> <LatestPackageReference Include="Microsoft.Azure.SignalR" Version="$(MicrosoftAzureSignalRPackageVersion)" />
<LatestPackageReference Include="Microsoft.CodeAnalysis.Common" Version="$(MicrosoftCodeAnalysisCommonPackageVersion)" /> <LatestPackageReference Include="Microsoft.CodeAnalysis.Common" Version="$(MicrosoftCodeAnalysisCommonPackageVersion)" />
<LatestPackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="$(MicrosoftCodeAnalysisCSharpWorkspacesPackageVersion)" /> <LatestPackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="$(MicrosoftCodeAnalysisCSharpWorkspacesPackageVersion)" />
<LatestPackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="$(MicrosoftCodeAnalysisCSharpPackageVersion)" /> <LatestPackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="$(MicrosoftCodeAnalysisCSharpPackageVersion)" />
<LatestPackageReference Include="Microsoft.CodeAnalysis.Razor" Version="$(MicrosoftCodeAnalysisRazorPackageVersion)" />
<LatestPackageReference Include="Microsoft.CSharp" Version="$(MicrosoftCSharpPackageVersion)" /> <LatestPackageReference Include="Microsoft.CSharp" Version="$(MicrosoftCSharpPackageVersion)" />
<LatestPackageReference Include="Microsoft.DotNet.GenAPI" Version="$(MicrosoftDotNetGenApiPackageVersion)" /> <LatestPackageReference Include="Microsoft.DotNet.GenAPI" Version="$(MicrosoftDotNetGenApiPackageVersion)" />
<LatestPackageReference Include="Microsoft.Extensions.Caching.Abstractions" Version="$(MicrosoftExtensionsCachingAbstractionsPackageVersion)" /> <LatestPackageReference Include="Microsoft.Extensions.Caching.Abstractions" Version="$(MicrosoftExtensionsCachingAbstractionsPackageVersion)" />
@ -71,6 +68,7 @@ and are generated based on the last package release.
<LatestPackageReference Include="System.CommandLine.Experimental" Version="$(SystemCommandlineExperimentalPackageVersion)" /> <LatestPackageReference Include="System.CommandLine.Experimental" Version="$(SystemCommandlineExperimentalPackageVersion)" />
<LatestPackageReference Include="System.ComponentModel" Version="$(SystemComponentModelPackageVersion)" /> <LatestPackageReference Include="System.ComponentModel" Version="$(SystemComponentModelPackageVersion)" />
<LatestPackageReference Include="System.ComponentModel.Annotations" Version="$(SystemComponentModelAnnotationsPackageVersion)" /> <LatestPackageReference Include="System.ComponentModel.Annotations" Version="$(SystemComponentModelAnnotationsPackageVersion)" />
<LatestPackageReference Include="System.Diagnostics.DiagnosticSource" Version="$(SystemDiagnosticsDiagnosticSourcePackageVersion)" />
<LatestPackageReference Include="System.Diagnostics.EventLog" Version="$(SystemDiagnosticsEventLogPackageVersion)" /> <LatestPackageReference Include="System.Diagnostics.EventLog" Version="$(SystemDiagnosticsEventLogPackageVersion)" />
<LatestPackageReference Include="System.Drawing.Common" Version="$(SystemDrawingCommonPackageVersion)" /> <LatestPackageReference Include="System.Drawing.Common" Version="$(SystemDrawingCommonPackageVersion)" />
<LatestPackageReference Include="System.IO.Pipelines" Version="$(SystemIOPipelinesPackageVersion)" /> <LatestPackageReference Include="System.IO.Pipelines" Version="$(SystemIOPipelinesPackageVersion)" />

View File

@ -41,6 +41,13 @@
<ProjectReferenceProvider Include="Microsoft.AspNetCore.NodeServices" ProjectPath="$(RepoRoot)src\Middleware\NodeServices\src\Microsoft.AspNetCore.NodeServices.csproj" /> <ProjectReferenceProvider Include="Microsoft.AspNetCore.NodeServices" ProjectPath="$(RepoRoot)src\Middleware\NodeServices\src\Microsoft.AspNetCore.NodeServices.csproj" />
<ProjectReferenceProvider Include="Microsoft.AspNetCore.SpaServices.Extensions" ProjectPath="$(RepoRoot)src\Middleware\SpaServices.Extensions\src\Microsoft.AspNetCore.SpaServices.Extensions.csproj" /> <ProjectReferenceProvider Include="Microsoft.AspNetCore.SpaServices.Extensions" ProjectPath="$(RepoRoot)src\Middleware\SpaServices.Extensions\src\Microsoft.AspNetCore.SpaServices.Extensions.csproj" />
<ProjectReferenceProvider Include="Microsoft.AspNetCore.SpaServices" ProjectPath="$(RepoRoot)src\Middleware\SpaServices\src\Microsoft.AspNetCore.SpaServices.csproj" /> <ProjectReferenceProvider Include="Microsoft.AspNetCore.SpaServices" ProjectPath="$(RepoRoot)src\Middleware\SpaServices\src\Microsoft.AspNetCore.SpaServices.csproj" />
<ProjectReferenceProvider Include="Microsoft.AspNetCore.Mvc.Razor.Extensions.Version1_X" ProjectPath="$(RepoRoot)src\Razor\Microsoft.AspNetCore.Mvc.Razor.Extensions.Version1_X\src\Microsoft.AspNetCore.Mvc.Razor.Extensions.Version1_X.csproj" />
<ProjectReferenceProvider Include="Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X" ProjectPath="$(RepoRoot)src\Razor\Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X\src\Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X.csproj" />
<ProjectReferenceProvider Include="Microsoft.AspNetCore.Mvc.Razor.Extensions" ProjectPath="$(RepoRoot)src\Razor\Microsoft.AspNetCore.Mvc.Razor.Extensions\src\Microsoft.AspNetCore.Mvc.Razor.Extensions.csproj" />
<ProjectReferenceProvider Include="Microsoft.AspNetCore.Razor.Language" ProjectPath="$(RepoRoot)src\Razor\Microsoft.AspNetCore.Razor.Language\src\Microsoft.AspNetCore.Razor.Language.csproj" />
<ProjectReferenceProvider Include="rzc" ProjectPath="$(RepoRoot)src\Razor\Microsoft.AspNetCore.Razor.Tools\src\Microsoft.AspNetCore.Razor.Tools.csproj" />
<ProjectReferenceProvider Include="Microsoft.CodeAnalysis.Razor" ProjectPath="$(RepoRoot)src\Razor\Microsoft.CodeAnalysis.Razor\src\Microsoft.CodeAnalysis.Razor.csproj" />
<ProjectReferenceProvider Include="Microsoft.NET.Sdk.Razor" ProjectPath="$(RepoRoot)src\Razor\Microsoft.NET.Sdk.Razor\src\Microsoft.NET.Sdk.Razor.csproj" />
<ProjectReferenceProvider Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" ProjectPath="$(RepoRoot)src\Mvc\Mvc.NewtonsoftJson\src\Microsoft.AspNetCore.Mvc.NewtonsoftJson.csproj" /> <ProjectReferenceProvider Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" ProjectPath="$(RepoRoot)src\Mvc\Mvc.NewtonsoftJson\src\Microsoft.AspNetCore.Mvc.NewtonsoftJson.csproj" />
<ProjectReferenceProvider Include="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" ProjectPath="$(RepoRoot)src\Mvc\Mvc.Razor.RuntimeCompilation\src\Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation.csproj" /> <ProjectReferenceProvider Include="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" ProjectPath="$(RepoRoot)src\Mvc\Mvc.Razor.RuntimeCompilation\src\Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation.csproj" />
<ProjectReferenceProvider Include="Microsoft.AspNetCore.Mvc.Testing" ProjectPath="$(RepoRoot)src\Mvc\Mvc.Testing\src\Microsoft.AspNetCore.Mvc.Testing.csproj" /> <ProjectReferenceProvider Include="Microsoft.AspNetCore.Mvc.Testing" ProjectPath="$(RepoRoot)src\Mvc\Mvc.Testing\src\Microsoft.AspNetCore.Mvc.Testing.csproj" />

View File

@ -13,22 +13,6 @@
<Uri>https://github.com/dotnet/blazor</Uri> <Uri>https://github.com/dotnet/blazor</Uri>
<Sha>dd7fb4d3931d556458f62642c2edfc59f6295bfb</Sha> <Sha>dd7fb4d3931d556458f62642c2edfc59f6295bfb</Sha>
</Dependency> </Dependency>
<Dependency Name="Microsoft.AspNetCore.Razor.Language" Version="5.0.0-preview.6.20265.5">
<Uri>https://github.com/dotnet/aspnetcore-tooling</Uri>
<Sha>e759982cb63d5205b87ad0d968b09033ab778d12</Sha>
</Dependency>
<Dependency Name="Microsoft.AspNetCore.Mvc.Razor.Extensions" Version="5.0.0-preview.6.20265.5">
<Uri>https://github.com/dotnet/aspnetcore-tooling</Uri>
<Sha>e759982cb63d5205b87ad0d968b09033ab778d12</Sha>
</Dependency>
<Dependency Name="Microsoft.CodeAnalysis.Razor" Version="5.0.0-preview.6.20265.5">
<Uri>https://github.com/dotnet/aspnetcore-tooling</Uri>
<Sha>e759982cb63d5205b87ad0d968b09033ab778d12</Sha>
</Dependency>
<Dependency Name="Microsoft.NET.Sdk.Razor" Version="5.0.0-preview.6.20265.5">
<Uri>https://github.com/dotnet/aspnetcore-tooling</Uri>
<Sha>e759982cb63d5205b87ad0d968b09033ab778d12</Sha>
</Dependency>
<Dependency Name="dotnet-ef" Version="5.0.0-preview.6.20264.4"> <Dependency Name="dotnet-ef" Version="5.0.0-preview.6.20264.4">
<Uri>https://github.com/dotnet/efcore</Uri> <Uri>https://github.com/dotnet/efcore</Uri>
<Sha>7f81b608c2ceb19f6072b8b3cec6ad45fcc2d6a9</Sha> <Sha>7f81b608c2ceb19f6072b8b3cec6ad45fcc2d6a9</Sha>
@ -205,6 +189,10 @@
<Uri>https://github.com/dotnet/runtime</Uri> <Uri>https://github.com/dotnet/runtime</Uri>
<Sha>bdd7235c43d762cea051cfc2071e14de48175f0c</Sha> <Sha>bdd7235c43d762cea051cfc2071e14de48175f0c</Sha>
</Dependency> </Dependency>
<Dependency Name="System.Diagnostics.DiagnosticSource" Version="5.0.0-preview.6.20264.1" CoherentParentDependency="Microsoft.AspNetCore.Razor.Language">
<Uri>https://github.com/dotnet/runtime</Uri>
<Sha>bdd7235c43d762cea051cfc2071e14de48175f0c</Sha>
</Dependency>
<Dependency Name="System.Diagnostics.EventLog" Version="5.0.0-preview.6.20264.1" CoherentParentDependency="Microsoft.AspNetCore.Razor.Language"> <Dependency Name="System.Diagnostics.EventLog" Version="5.0.0-preview.6.20264.1" CoherentParentDependency="Microsoft.AspNetCore.Razor.Language">
<Uri>https://github.com/dotnet/runtime</Uri> <Uri>https://github.com/dotnet/runtime</Uri>
<Sha>bdd7235c43d762cea051cfc2071e14de48175f0c</Sha> <Sha>bdd7235c43d762cea051cfc2071e14de48175f0c</Sha>

View File

@ -107,6 +107,7 @@
<MicrosoftExtensionsPrimitivesPackageVersion>5.0.0-preview.6.20264.1</MicrosoftExtensionsPrimitivesPackageVersion> <MicrosoftExtensionsPrimitivesPackageVersion>5.0.0-preview.6.20264.1</MicrosoftExtensionsPrimitivesPackageVersion>
<MicrosoftExtensionsInternalTransportPackageVersion>5.0.0-preview.6.20264.1</MicrosoftExtensionsInternalTransportPackageVersion> <MicrosoftExtensionsInternalTransportPackageVersion>5.0.0-preview.6.20264.1</MicrosoftExtensionsInternalTransportPackageVersion>
<SystemComponentModelAnnotationsPackageVersion>5.0.0-preview.6.20264.1</SystemComponentModelAnnotationsPackageVersion> <SystemComponentModelAnnotationsPackageVersion>5.0.0-preview.6.20264.1</SystemComponentModelAnnotationsPackageVersion>
<SystemDiagnosticsDiagnosticSourcePackageVersion>5.0.0-preview.6.20264.1</SystemDiagnosticsDiagnosticSourcePackageVersion>
<SystemDiagnosticsEventLogPackageVersion>5.0.0-preview.6.20264.1</SystemDiagnosticsEventLogPackageVersion> <SystemDiagnosticsEventLogPackageVersion>5.0.0-preview.6.20264.1</SystemDiagnosticsEventLogPackageVersion>
<SystemDrawingCommonPackageVersion>5.0.0-preview.6.20264.1</SystemDrawingCommonPackageVersion> <SystemDrawingCommonPackageVersion>5.0.0-preview.6.20264.1</SystemDrawingCommonPackageVersion>
<SystemIOPipelinesPackageVersion>5.0.0-preview.6.20264.1</SystemIOPipelinesPackageVersion> <SystemIOPipelinesPackageVersion>5.0.0-preview.6.20264.1</SystemIOPipelinesPackageVersion>
@ -136,11 +137,6 @@
<MicrosoftEntityFrameworkCoreSqlServerPackageVersion>5.0.0-preview.6.20264.4</MicrosoftEntityFrameworkCoreSqlServerPackageVersion> <MicrosoftEntityFrameworkCoreSqlServerPackageVersion>5.0.0-preview.6.20264.4</MicrosoftEntityFrameworkCoreSqlServerPackageVersion>
<MicrosoftEntityFrameworkCoreToolsPackageVersion>5.0.0-preview.6.20264.4</MicrosoftEntityFrameworkCoreToolsPackageVersion> <MicrosoftEntityFrameworkCoreToolsPackageVersion>5.0.0-preview.6.20264.4</MicrosoftEntityFrameworkCoreToolsPackageVersion>
<MicrosoftEntityFrameworkCorePackageVersion>5.0.0-preview.6.20264.4</MicrosoftEntityFrameworkCorePackageVersion> <MicrosoftEntityFrameworkCorePackageVersion>5.0.0-preview.6.20264.4</MicrosoftEntityFrameworkCorePackageVersion>
<!-- Packages from dotnet/aspnetcore-tooling -->
<MicrosoftAspNetCoreMvcRazorExtensionsPackageVersion>5.0.0-preview.6.20265.5</MicrosoftAspNetCoreMvcRazorExtensionsPackageVersion>
<MicrosoftAspNetCoreRazorLanguagePackageVersion>5.0.0-preview.6.20265.5</MicrosoftAspNetCoreRazorLanguagePackageVersion>
<MicrosoftCodeAnalysisRazorPackageVersion>5.0.0-preview.6.20265.5</MicrosoftCodeAnalysisRazorPackageVersion>
<MicrosoftNETSdkRazorPackageVersion>5.0.0-preview.6.20265.5</MicrosoftNETSdkRazorPackageVersion>
</PropertyGroup> </PropertyGroup>
<!-- <!--
@ -187,9 +183,9 @@
<MicrosoftBuildFrameworkPackageVersion>15.8.166</MicrosoftBuildFrameworkPackageVersion> <MicrosoftBuildFrameworkPackageVersion>15.8.166</MicrosoftBuildFrameworkPackageVersion>
<MicrosoftBuildLocatorPackageVersion>1.2.6</MicrosoftBuildLocatorPackageVersion> <MicrosoftBuildLocatorPackageVersion>1.2.6</MicrosoftBuildLocatorPackageVersion>
<MicrosoftBuildUtilitiesCorePackageVersion>15.8.166</MicrosoftBuildUtilitiesCorePackageVersion> <MicrosoftBuildUtilitiesCorePackageVersion>15.8.166</MicrosoftBuildUtilitiesCorePackageVersion>
<MicrosoftCodeAnalysisCommonPackageVersion>3.0.0</MicrosoftCodeAnalysisCommonPackageVersion> <MicrosoftCodeAnalysisCommonPackageVersion>3.4.0</MicrosoftCodeAnalysisCommonPackageVersion>
<MicrosoftCodeAnalysisCSharpPackageVersion>3.0.0</MicrosoftCodeAnalysisCSharpPackageVersion> <MicrosoftCodeAnalysisCSharpPackageVersion>3.4.0</MicrosoftCodeAnalysisCSharpPackageVersion>
<MicrosoftCodeAnalysisCSharpWorkspacesPackageVersion>3.0.0</MicrosoftCodeAnalysisCSharpWorkspacesPackageVersion> <MicrosoftCodeAnalysisCSharpWorkspacesPackageVersion>3.4.0</MicrosoftCodeAnalysisCSharpWorkspacesPackageVersion>
<MicrosoftIdentityModelClientsActiveDirectoryPackageVersion>3.19.8</MicrosoftIdentityModelClientsActiveDirectoryPackageVersion> <MicrosoftIdentityModelClientsActiveDirectoryPackageVersion>3.19.8</MicrosoftIdentityModelClientsActiveDirectoryPackageVersion>
<MicrosoftIdentityModelLoggingPackageVersion>5.5.0</MicrosoftIdentityModelLoggingPackageVersion> <MicrosoftIdentityModelLoggingPackageVersion>5.5.0</MicrosoftIdentityModelLoggingPackageVersion>
<MicrosoftIdentityModelProtocolsOpenIdConnectPackageVersion>5.5.0</MicrosoftIdentityModelProtocolsOpenIdConnectPackageVersion> <MicrosoftIdentityModelProtocolsOpenIdConnectPackageVersion>5.5.0</MicrosoftIdentityModelProtocolsOpenIdConnectPackageVersion>
@ -226,6 +222,9 @@
<MonoCecilPackageVersion>0.10.1</MonoCecilPackageVersion> <MonoCecilPackageVersion>0.10.1</MonoCecilPackageVersion>
<NewtonsoftJsonBsonPackageVersion>1.0.2</NewtonsoftJsonBsonPackageVersion> <NewtonsoftJsonBsonPackageVersion>1.0.2</NewtonsoftJsonBsonPackageVersion>
<NewtonsoftJsonPackageVersion>12.0.2</NewtonsoftJsonPackageVersion> <NewtonsoftJsonPackageVersion>12.0.2</NewtonsoftJsonPackageVersion>
<!-- Begin: STOP!!! Razor need to reference the version of JSON that our HOSTS support. -->
<Razor_NewtonsoftJsonPackageVersion>9.0.1</Razor_NewtonsoftJsonPackageVersion>
<!-- End: STOP!!! Razor need to reference the version of JSON that our HOSTS support. -->
<NSwagApiDescriptionClientPackageVersion>13.0.4</NSwagApiDescriptionClientPackageVersion> <NSwagApiDescriptionClientPackageVersion>13.0.4</NSwagApiDescriptionClientPackageVersion>
<SeleniumSupportPackageVersion>3.12.1</SeleniumSupportPackageVersion> <SeleniumSupportPackageVersion>3.12.1</SeleniumSupportPackageVersion>
<SeleniumWebDriverMicrosoftDriverPackageVersion>17.17134.0</SeleniumWebDriverMicrosoftDriverPackageVersion> <SeleniumWebDriverMicrosoftDriverPackageVersion>17.17134.0</SeleniumWebDriverMicrosoftDriverPackageVersion>

View File

@ -14,13 +14,29 @@
<PackageReference Condition="'$(DotNetBuildFromSource)' != 'true'" Include="Microsoft.DotNet.GenAPI" PrivateAssets="All" Version="$(MicrosoftDotNetGenApiPackageVersion)" IsImplicitlyDefined="true" /> <PackageReference Condition="'$(DotNetBuildFromSource)' != 'true'" Include="Microsoft.DotNet.GenAPI" PrivateAssets="All" Version="$(MicrosoftDotNetGenApiPackageVersion)" IsImplicitlyDefined="true" />
</ItemGroup> </ItemGroup>
<ItemGroup Condition="'$(UsingMicrosoftNETSdkWeb)' == 'true' OR '$(RazorSdkCurrentVersionProps)' != ''"> <Choose>
<!-- <When Condition="'$(UsingMicrosoftNETSdkWeb)' == 'true' OR '$(RazorSdkCurrentVersionProps)' != ''">
Use the Razor SDK as a package reference. The version of the .NET Core SDK we build with often contains a version of the Razor SDK <ItemGroup>
several versions older than latest. To avoid a cyclical dependency, this package reference is added to override the bundled version. <!--
--> Use the Razor SDK as a project reference. The version of the .NET Core SDK we build with often contains a version of the Razor SDK
<PackageReference Include="Microsoft.NET.Sdk.Razor" PrivateAssets="All" Version="$(MicrosoftNETSdkRazorPackageVersion)" IsImplicitlyDefined="true" /> several versions older than latest. We reference the project to ensure it's built before the other projects that use it. Since this
</ItemGroup> is a project reference, we must explicitly import the props file and also specify the output location of the SDK directory.
-->
<ProjectReference Include="$(RepoRoot)src\Razor\Microsoft.NET.Sdk.Razor\src\Microsoft.NET.Sdk.Razor.csproj" PrivateAssets="All" IsImplicitlyDefined="true" ReferenceOutputAssembly="false" >
<!-- Use the same logic as Sdk.Razor.CurrentVersion.Targets -->
<SetTargetFramework Condition=" '$(MSBuildRuntimeType)' == 'Core'">TargetFramework=$(DefaultNetCoreTargetFramework)</SetTargetFramework>
<SetTargetFramework Condition=" '$(MSBuildRuntimeType)' != 'Core'">TargetFramework=net46</SetTargetFramework>
</ProjectReference>
</ItemGroup>
<PropertyGroup>
<RazorSdkDirectoryRoot>$(ArtifactsBinDir)Microsoft.NET.Sdk.Razor\$(Configuration)\sdk-output\</RazorSdkDirectoryRoot>
</PropertyGroup>
</When>
</Choose>
<Import Project="$(RepoRoot)src\Razor\Microsoft.NET.Sdk.Razor\src\build\netstandard2.0\Microsoft.NET.Sdk.Razor.props" Condition="'$(UsingMicrosoftNETSdkWeb)' == 'true' OR '$(RazorSdkCurrentVersionProps)' != ''" />
<ItemGroup Condition=" '$(IsTestProject)' == 'true' "> <ItemGroup Condition=" '$(IsTestProject)' == 'true' ">
<Reference Include="Microsoft.AspNetCore.Testing" /> <Reference Include="Microsoft.AspNetCore.Testing" />

View File

@ -86,7 +86,8 @@
@(AspNetCoreAppReferenceAndPackage); @(AspNetCoreAppReferenceAndPackage);
@(ExternalAspNetCoreAppReference); @(ExternalAspNetCoreAppReference);
@(_CompilationOnlyReference); @(_CompilationOnlyReference);
@(Reference->WithMetadataValue('IsSharedSource', 'true'))" /> @(Reference->WithMetadataValue('IsSharedSource', 'true'));
@(Reference->WithMetadataValue('PrivateAssets', 'All'))" />
<_OriginalReferences Include="@(Reference)" /> <_OriginalReferences Include="@(Reference)" />
<!-- <!--
Turn Reference items into a ProjectReference when UseProjectReferences is true. Turn Reference items into a ProjectReference when UseProjectReferences is true.

View File

@ -6,6 +6,7 @@
"dotnet": "5.0.100-preview.5.20258.4", "dotnet": "5.0.100-preview.5.20258.4",
"runtimes": { "runtimes": {
"dotnet/x64": [ "dotnet/x64": [
"2.1.11",
"$(MicrosoftNETCoreAppInternalPackageVersion)" "$(MicrosoftNETCoreAppInternalPackageVersion)"
], ],
"dotnet/x86": [ "dotnet/x86": [

View File

@ -100,10 +100,12 @@ namespace Microsoft.AspNetCore.Blazor.Build
static void SetupDirectoryBuildFiles(string repoRoot, string testAppsRoot, string projectDestination) static void SetupDirectoryBuildFiles(string repoRoot, string testAppsRoot, string projectDestination)
{ {
var razorSdkDirectoryRoot = Assembly.GetExecutingAssembly().GetCustomAttributes<AssemblyMetadataAttribute>().SingleOrDefault(a => a.Key == "RazorSdkDirectoryRoot").Value;
var beforeDirectoryPropsContent = var beforeDirectoryPropsContent =
$@"<Project> $@"<Project>
<PropertyGroup> <PropertyGroup>
<RepoRoot>{repoRoot}</RepoRoot> <RepoRoot>{repoRoot}</RepoRoot>
<RazorSdkDirectoryRoot>{razorSdkDirectoryRoot}</RazorSdkDirectoryRoot>
</PropertyGroup> </PropertyGroup>
</Project>"; </Project>";
File.WriteAllText(Path.Combine(projectDestination, "Before.Directory.Build.props"), beforeDirectoryPropsContent); File.WriteAllText(Path.Combine(projectDestination, "Before.Directory.Build.props"), beforeDirectoryPropsContent);

View File

@ -47,6 +47,11 @@
<_Parameter1>Testing.RepoRoot</_Parameter1> <_Parameter1>Testing.RepoRoot</_Parameter1>
<_Parameter2>$(RepoRoot)</_Parameter2> <_Parameter2>$(RepoRoot)</_Parameter2>
</AssemblyAttribute> </AssemblyAttribute>
<AssemblyAttribute Include="System.Reflection.AssemblyMetadataAttribute">
<_Parameter1>RazorSdkDirectoryRoot</_Parameter1>
<_Parameter2>$(ArtifactsBinDir)Microsoft.NET.Sdk.Razor\$(Configuration)\sdk-output\</_Parameter2>
</AssemblyAttribute>
</ItemGroup> </ItemGroup>
<Target Name="RestoreTestAssets" AfterTargets="Restore;Build" Condition="'$(DotNetBuildFromSource)' != 'true'"> <Target Name="RestoreTestAssets" AfterTargets="Restore;Build" Condition="'$(DotNetBuildFromSource)' != 'true'">

View File

@ -22,10 +22,7 @@
Version="$(MicrosoftNetCompilersToolsetPackageVersion)" Version="$(MicrosoftNetCompilersToolsetPackageVersion)"
PrivateAssets="all" PrivateAssets="all"
IsImplicitlyDefined="true" /> IsImplicitlyDefined="true" />
<PackageReference Include="Microsoft.NET.Sdk.Razor"
Version="$(MicrosoftNETSdkRazorPackageVersion)"
PrivateAssets="All"
IsImplicitlyDefined="true" />
</ItemGroup> </ItemGroup>
<Import Project="$(RepoRoot)src\Razor\Microsoft.NET.Sdk.Razor\src\build\netstandard2.0\Microsoft.NET.Sdk.Razor.props"/>
</Project> </Project>

View File

@ -139,7 +139,7 @@ namespace Microsoft.CodeAnalysis
return false; return false;
} }
private static IEnumerable<ITypeSymbol> GetTypeHierarchy(this ITypeSymbol typeSymbol) private static IEnumerable<ITypeSymbol> GetTypeHierarchy(this ITypeSymbol? typeSymbol)
{ {
while (typeSymbol != null) while (typeSymbol != null)
{ {

View File

@ -103,6 +103,11 @@ namespace Microsoft.AspNetCore.Mvc.Analyzers
{ {
while (method.IsOverride) while (method.IsOverride)
{ {
if (method.OverriddenMethod == null)
{
throw new ArgumentNullException(nameof(method.OverriddenMethod));
}
method = method.OverriddenMethod; method = method.OverriddenMethod;
} }

View File

@ -101,6 +101,10 @@ namespace Microsoft.AspNetCore.Mvc.Api.Analyzers
case ObjectCreationExpressionSyntax creation: case ObjectCreationExpressionSyntax creation:
{ {
if (creation.ArgumentList == null)
{
throw new ArgumentNullException(nameof(creation.ArgumentList));
}
// Read values from 'return new StatusCodeResult(200) case. // Read values from 'return new StatusCodeResult(200) case.
var result = InspectMethodArguments(semanticModel, creation, creation.ArgumentList, cancellationToken); var result = InspectMethodArguments(semanticModel, creation, creation.ArgumentList, cancellationToken);
statusCode = result.statusCode ?? statusCode; statusCode = result.statusCode ?? statusCode;
@ -126,7 +130,7 @@ namespace Microsoft.AspNetCore.Mvc.Api.Analyzers
private static (int? statusCode, ITypeSymbol? returnType) InspectInitializers( private static (int? statusCode, ITypeSymbol? returnType) InspectInitializers(
in ApiControllerSymbolCache symbolCache, in ApiControllerSymbolCache symbolCache,
SemanticModel semanticModel, SemanticModel semanticModel,
InitializerExpressionSyntax initializer, InitializerExpressionSyntax? initializer,
CancellationToken cancellationToken) CancellationToken cancellationToken)
{ {
int? statusCode = null; int? statusCode = null;
@ -201,7 +205,13 @@ namespace Microsoft.AspNetCore.Mvc.Api.Analyzers
private static ITypeSymbol GetExpressionObjectType(SemanticModel semanticModel, ExpressionSyntax expression, CancellationToken cancellationToken) private static ITypeSymbol GetExpressionObjectType(SemanticModel semanticModel, ExpressionSyntax expression, CancellationToken cancellationToken)
{ {
var typeInfo = semanticModel.GetTypeInfo(expression, cancellationToken); var typeInfo = semanticModel.GetTypeInfo(expression, cancellationToken);
return typeInfo.Type;
if (typeInfo.Type == null)
{
throw new ArgumentNullException(nameof(typeInfo.Type));
}
return typeInfo.Type!;
} }
private static bool TryGetExpressionStatusCode( private static bool TryGetExpressionStatusCode(

View File

@ -121,18 +121,40 @@ namespace Microsoft.AspNetCore.Mvc.Api.Analyzers
} }
} }
if (root == null)
{
throw new ArgumentNullException(nameof(root));
}
return document.WithSyntaxRoot(root); return document.WithSyntaxRoot(root);
} }
private async Task<CodeActionContext?> CreateCodeActionContext(CancellationToken cancellationToken) private async Task<CodeActionContext?> CreateCodeActionContext(CancellationToken cancellationToken)
{ {
var root = await _document.GetSyntaxRootAsync(cancellationToken).ConfigureAwait(false); var root = await _document.GetSyntaxRootAsync(cancellationToken).ConfigureAwait(false);
if (root == null)
{
throw new ArgumentNullException(nameof(root));
}
var semanticModel = await _document.GetSemanticModelAsync(cancellationToken).ConfigureAwait(false); var semanticModel = await _document.GetSemanticModelAsync(cancellationToken).ConfigureAwait(false);
var methodReturnStatement = (ReturnStatementSyntax)root.FindNode(_diagnostic.Location.SourceSpan); var methodReturnStatement = (ReturnStatementSyntax)root.FindNode(_diagnostic.Location.SourceSpan);
var methodSyntax = methodReturnStatement.FirstAncestorOrSelf<MethodDeclarationSyntax>(); var methodSyntax = methodReturnStatement.FirstAncestorOrSelf<MethodDeclarationSyntax>();
var method = semanticModel.GetDeclaredSymbol(methodSyntax, cancellationToken); var method = semanticModel.GetDeclaredSymbol(methodSyntax, cancellationToken);
if (semanticModel == null)
{
throw new ArgumentNullException(nameof(semanticModel));
}
var statusCodesType = semanticModel.Compilation.GetTypeByMetadataName(ApiSymbolNames.HttpStatusCodes); var statusCodesType = semanticModel.Compilation.GetTypeByMetadataName(ApiSymbolNames.HttpStatusCodes);
if (statusCodesType == null)
{
throw new ArgumentNullException(nameof(statusCodesType));
}
var statusCodeConstants = GetStatusCodeConstants(statusCodesType); var statusCodeConstants = GetStatusCodeConstants(statusCodesType);
if (!ApiControllerSymbolCache.TryCreate(semanticModel.Compilation, out var symbolCache)) if (!ApiControllerSymbolCache.TryCreate(semanticModel.Compilation, out var symbolCache))

View File

@ -1,6 +1,7 @@
// Copyright (c) .NET Foundation. All rights reserved. // 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. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using System.Collections.Immutable; using System.Collections.Immutable;
using System.Composition; using System.Composition;
using System.Threading; using System.Threading;
@ -59,7 +60,12 @@ namespace Microsoft.AspNetCore.Mvc.Api.Analyzers
var rootNode = await _document.GetSyntaxRootAsync(cancellationToken).ConfigureAwait(false); var rootNode = await _document.GetSyntaxRootAsync(cancellationToken).ConfigureAwait(false);
var editor = await DocumentEditor.CreateAsync(_document, cancellationToken).ConfigureAwait(false); var editor = await DocumentEditor.CreateAsync(_document, cancellationToken).ConfigureAwait(false);
var ifBlockSyntax = rootNode.FindNode(_ifBlockSpan); if (rootNode == null)
{
throw new ArgumentNullException(nameof(rootNode));
}
var ifBlockSyntax = rootNode!.FindNode(_ifBlockSpan);
editor.RemoveNode(ifBlockSyntax); editor.RemoveNode(ifBlockSyntax);
return editor.GetChangedDocument(); return editor.GetChangedDocument();

View File

@ -68,7 +68,15 @@ namespace Microsoft.AspNetCore.Mvc.Api.Analyzers
return SymbolApiConventionNameMatchBehavior.Exact; return SymbolApiConventionNameMatchBehavior.Exact;
} }
var intValue = (int)attribute.ConstructorArguments[0].Value; var argEnum = attribute.ConstructorArguments[0].Value;
if (argEnum == null)
{
throw new ArgumentNullException(nameof(argEnum));
}
var intValue = (int)argEnum;
return (SymbolApiConventionNameMatchBehavior)intValue; return (SymbolApiConventionNameMatchBehavior)intValue;
} }
@ -82,7 +90,15 @@ namespace Microsoft.AspNetCore.Mvc.Api.Analyzers
return SymbolApiConventionTypeMatchBehavior.AssignableFrom; return SymbolApiConventionTypeMatchBehavior.AssignableFrom;
} }
var intValue = (int)attribute.ConstructorArguments[0].Value; var argEnum = attribute.ConstructorArguments[0].Value;
if (argEnum == null)
{
throw new ArgumentNullException(nameof(argEnum));
}
var intValue = (int)argEnum;
return (SymbolApiConventionTypeMatchBehavior)intValue; return (SymbolApiConventionTypeMatchBehavior)intValue;
} }

View File

@ -37,6 +37,9 @@
MicrosoftAspNetCoreAppRuntimePackageVersion=@(_RuntimePackageVersionInfo->'%(PackageVersion)'); MicrosoftAspNetCoreAppRuntimePackageVersion=@(_RuntimePackageVersionInfo->'%(PackageVersion)');
SupportedRuntimeIdentifiers=$(SupportedRuntimeIdentifiers); SupportedRuntimeIdentifiers=$(SupportedRuntimeIdentifiers);
DefaultNetCoreTargetFramework=$(DefaultNetCoreTargetFramework); DefaultNetCoreTargetFramework=$(DefaultNetCoreTargetFramework);
RepoRoot=$(RepoRoot);
Configuration=$(Configuration);
ArtifactsBinDir=$(ArtifactsBinDir);
</PropsProperties> </PropsProperties>
</PropertyGroup> </PropertyGroup>

View File

@ -29,11 +29,14 @@
IsImplicitlyDefined="true" /> IsImplicitlyDefined="true" />
</ItemGroup> </ItemGroup>
<ItemGroup Condition="'$(UsingMicrosoftNETSdkWeb)' == 'true' OR '$(RazorSdkCurrentVersionProps)' != ''"> <!--
<!-- Use the Razor SDK as a project reference. The version of the .NET Core SDK we build with often contains a version of the Razor SDK
Use the Razor SDK as a package reference. The version of the .NET Core SDK we build with often contains a version of the Razor SDK several versions older than latest. To avoid a cyclical dependency, this package reference is added to override the bundled version.
several versions older than latest. To avoid a cyclical dependency, this package reference is added to override the bundled version. Since this is a project reference, we must explicitly import the props file and also specify the output location of the SDK directory.
--> -->
<PackageReference Include="Microsoft.NET.Sdk.Razor" PrivateAssets="All" Version="${MicrosoftNETSdkRazorPackageVersion}" /> <Import Project="${RepoRoot}src\Razor\Microsoft.NET.Sdk.Razor\src\build\netstandard2.0\Microsoft.NET.Sdk.Razor.props" Condition="'$(UsingMicrosoftNETSdkWeb)' == 'true' OR '$(RazorSdkCurrentVersionProps)' != ''" />
</ItemGroup>
<PropertyGroup>
<RazorSdkDirectoryRoot>${ArtifactsBinDir}Microsoft.NET.Sdk.Razor\${Configuration}\sdk-output\</RazorSdkDirectoryRoot>
</PropertyGroup>
</Project> </Project>

View File

@ -37,6 +37,9 @@
MicrosoftAspNetCoreAppRuntimePackageVersion=@(_RuntimePackageVersionInfo->'%(PackageVersion)'); MicrosoftAspNetCoreAppRuntimePackageVersion=@(_RuntimePackageVersionInfo->'%(PackageVersion)');
SupportedRuntimeIdentifiers=$(SupportedRuntimeIdentifiers); SupportedRuntimeIdentifiers=$(SupportedRuntimeIdentifiers);
DefaultNetCoreTargetFramework=$(DefaultNetCoreTargetFramework); DefaultNetCoreTargetFramework=$(DefaultNetCoreTargetFramework);
RepoRoot=$(RepoRoot);
Configuration=$(Configuration);
ArtifactsBinDir=$(ArtifactsBinDir);
</PropsProperties> </PropsProperties>
</PropertyGroup> </PropertyGroup>

View File

@ -29,11 +29,14 @@
IsImplicitlyDefined="true" /> IsImplicitlyDefined="true" />
</ItemGroup> </ItemGroup>
<ItemGroup Condition="'$(UsingMicrosoftNETSdkWeb)' == 'true' OR '$(RazorSdkCurrentVersionProps)' != ''"> <!--
<!-- The version of the .NET Core SDK we build with often contains a version of the Razor SDK several versions older than latest.
Use the Razor SDK as a package reference. The version of the .NET Core SDK we build with often contains a version of the Razor SDK We reference the project to ensure it's built before the other projects that use it. Since this is a project reference, we
several versions older than latest. To avoid a cyclical dependency, this package reference is added to override the bundled version. must explicitly import the props file and also specify the output location of the SDK directory.
--> -->
<PackageReference Include="Microsoft.NET.Sdk.Razor" PrivateAssets="All" Version="${MicrosoftNETSdkRazorPackageVersion}" /> <Import Project="${RepoRoot}src\Razor\Microsoft.NET.Sdk.Razor\src\build\netstandard2.0\Microsoft.NET.Sdk.Razor.props" Condition="'$(UsingMicrosoftNETSdkWeb)' == 'true' OR '$(RazorSdkCurrentVersionProps)' != ''" />
</ItemGroup>
<PropertyGroup>
<RazorSdkDirectoryRoot>${ArtifactsBinDir}Microsoft.NET.Sdk.Razor\${Configuration}\sdk-output\</RazorSdkDirectoryRoot>
</PropertyGroup>
</Project> </Project>

View File

@ -6,17 +6,19 @@
<PackageTags>$(PackageTags);aspnetcoremvc</PackageTags> <PackageTags>$(PackageTags);aspnetcoremvc</PackageTags>
<EnableApiCheck>false</EnableApiCheck> <EnableApiCheck>false</EnableApiCheck>
<IsShipping>false</IsShipping> <IsShipping>false</IsShipping>
<!-- Need to build this project in source build -->
<ExcludeFromSourceBuild>false</ExcludeFromSourceBuild>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Compile Include="..\Microsoft.AspNetCore.Razor.Language\CodeGeneration\CodeWriterExtensions.cs"> <Compile Include="..\..\Microsoft.AspNetCore.Razor.Language\src\CodeGeneration\CodeWriterExtensions.cs">
<Link>Shared\CodeWriterExtensions.cs</Link> <Link>Shared\CodeWriterExtensions.cs</Link>
</Compile> </Compile>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="../Microsoft.AspNetCore.Razor.Language/Microsoft.AspNetCore.Razor.Language.csproj" /> <Reference Include="Microsoft.AspNetCore.Razor.Language" />
<ProjectReference Include="../Microsoft.CodeAnalysis.Razor/Microsoft.CodeAnalysis.Razor.csproj" /> <Reference Include="Microsoft.CodeAnalysis.Razor" />
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@ -14,7 +14,7 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Extensions.Version1_X.IntegrationTests
private readonly static CSharpCompilation DefaultBaseCompilation = MvcShim.BaseCompilation.WithAssemblyName("AppCode"); private readonly static CSharpCompilation DefaultBaseCompilation = MvcShim.BaseCompilation.WithAssemblyName("AppCode");
public CodeGenerationIntegrationTest() public CodeGenerationIntegrationTest()
: base(generateBaselines: null) : base(generateBaselines: null, projectDirectoryHint: "Microsoft.AspNetCore.Mvc.Razor.Extensions.Version1_X")
{ {
Configuration = RazorConfiguration.Create( Configuration = RazorConfiguration.Create(
RazorLanguageVersion.Version_1_1, RazorLanguageVersion.Version_1_1,

View File

@ -1,12 +1,16 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFrameworks>$(StandardTestTfms)</TargetFrameworks> <TargetFrameworks>$(DefaultNetCoreTargetFramework)</TargetFrameworks>
<TargetFrameworks Condition="'$(OS)' == 'Windows_NT'">$(TargetFrameworks);net461</TargetFrameworks>
<PreserveCompilationContext>true</PreserveCompilationContext> <PreserveCompilationContext>true</PreserveCompilationContext>
<DefaultItemExcludes>$(DefaultItemExcludes);TestFiles\**</DefaultItemExcludes> <DefaultItemExcludes>$(DefaultItemExcludes);TestFiles\**</DefaultItemExcludes>
<!-- Work around https://github.com/microsoft/msbuild/issues/4740 --> <!-- Work around https://github.com/microsoft/msbuild/issues/4740 -->
<EmbeddedResourceUseDependentUponConvention>false</EmbeddedResourceUseDependentUponConvention> <EmbeddedResourceUseDependentUponConvention>false</EmbeddedResourceUseDependentUponConvention>
<!-- Tests do not work on Helix yet -->
<BuildHelixPayload>false</BuildHelixPayload>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
@ -15,18 +19,13 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\..\src\Microsoft.AspNetCore.Mvc.Razor.Extensions.Version1_X\Microsoft.AspNetCore.Mvc.Razor.Extensions.Version1_X.csproj" /> <Reference Include="Microsoft.AspNetCore.Mvc.Razor.Extensions.Version1_X" />
<ProjectReference Include="..\..\src\Microsoft.CodeAnalysis.Razor\Microsoft.CodeAnalysis.Razor.csproj" /> <Reference Include="Microsoft.CodeAnalysis.Razor" />
<Reference Include="Microsoft.CodeAnalysis.CSharp" />
<Reference Include="Microsoft.Extensions.DependencyModel" />
<ProjectReference Include="..\Microsoft.AspNetCore.Razor.Test.Common\Microsoft.AspNetCore.Razor.Test.Common.csproj" /> <ProjectReference Include="..\..\test\Microsoft.AspNetCore.Razor.Test.Common\Microsoft.AspNetCore.Razor.Test.Common.csproj" />
<ProjectReference Include="..\Microsoft.AspNetCore.Razor.Test.MvcShim.Version1_X\Microsoft.AspNetCore.Razor.Test.MvcShim.Version1_X.csproj" /> <ProjectReference Include="..\..\test\Microsoft.AspNetCore.Razor.Test.MvcShim.Version1_X\Microsoft.AspNetCore.Razor.Test.MvcShim.Version1_X.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Testing" Version="$(MicrosoftAspNetCoreTestingPackageVersion)" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="$(Runtime_MicrosoftCodeAnalysisCSharpPackageVersion)" />
<PackageReference Include="Microsoft.Extensions.DependencyModel" Version="$(MicrosoftExtensionsDependencyModelPackageVersion)" />
<PackageReference Include="Moq" Version="$(MoqPackageVersion)" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

View File

@ -5,17 +5,19 @@
<TargetFramework>netstandard2.0</TargetFramework> <TargetFramework>netstandard2.0</TargetFramework>
<PackageTags>$(PackageTags);aspnetcoremvc</PackageTags> <PackageTags>$(PackageTags);aspnetcoremvc</PackageTags>
<IsShipping>false</IsShipping> <IsShipping>false</IsShipping>
<!-- Need to build this project in source build -->
<ExcludeFromSourceBuild>false</ExcludeFromSourceBuild>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Compile Include="..\Microsoft.AspNetCore.Razor.Language\CodeGeneration\CodeWriterExtensions.cs"> <Compile Include="..\..\Microsoft.AspNetCore.Razor.Language\src\CodeGeneration\CodeWriterExtensions.cs">
<Link>Shared\CodeWriterExtensions.cs</Link> <Link>Shared\CodeWriterExtensions.cs</Link>
</Compile> </Compile>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="../Microsoft.AspNetCore.Razor.Language/Microsoft.AspNetCore.Razor.Language.csproj" /> <Reference Include="Microsoft.AspNetCore.Razor.Language" />
<ProjectReference Include="../Microsoft.CodeAnalysis.Razor/Microsoft.CodeAnalysis.Razor.csproj" /> <Reference Include="Microsoft.CodeAnalysis.Razor" />
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@ -16,7 +16,7 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X.IntegrationTests
private readonly static CSharpCompilation DefaultBaseCompilation = MvcShim.BaseCompilation.WithAssemblyName("AppCode"); private readonly static CSharpCompilation DefaultBaseCompilation = MvcShim.BaseCompilation.WithAssemblyName("AppCode");
public CodeGenerationIntegrationTest() public CodeGenerationIntegrationTest()
: base(generateBaselines: null) : base(generateBaselines: null, projectDirectoryHint: "Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X")
{ {
Configuration = RazorConfiguration.Create( Configuration = RazorConfiguration.Create(
RazorLanguageVersion.Version_2_0, RazorLanguageVersion.Version_2_0,

View File

@ -16,7 +16,7 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X.IntegrationTests
private readonly static CSharpCompilation DefaultBaseCompilation = MvcShim.BaseCompilation.WithAssemblyName("AppCode"); private readonly static CSharpCompilation DefaultBaseCompilation = MvcShim.BaseCompilation.WithAssemblyName("AppCode");
public InstrumentationPassIntegrationTest() public InstrumentationPassIntegrationTest()
: base(generateBaselines: null) : base(generateBaselines: null, projectDirectoryHint: "Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X")
{ {
Configuration = RazorConfiguration.Create( Configuration = RazorConfiguration.Create(
RazorLanguageVersion.Version_2_0, RazorLanguageVersion.Version_2_0,

View File

@ -1,12 +1,16 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFrameworks>$(StandardTestTfms)</TargetFrameworks> <TargetFrameworks>$(DefaultNetCoreTargetFramework)</TargetFrameworks>
<TargetFrameworks Condition="'$(OS)' == 'Windows_NT'">$(TargetFrameworks);net461</TargetFrameworks>
<PreserveCompilationContext>true</PreserveCompilationContext> <PreserveCompilationContext>true</PreserveCompilationContext>
<DefaultItemExcludes>$(DefaultItemExcludes);TestFiles\**</DefaultItemExcludes> <DefaultItemExcludes>$(DefaultItemExcludes);TestFiles\**</DefaultItemExcludes>
<!-- Work around https://github.com/microsoft/msbuild/issues/4740 --> <!-- Work around https://github.com/microsoft/msbuild/issues/4740 -->
<EmbeddedResourceUseDependentUponConvention>false</EmbeddedResourceUseDependentUponConvention> <EmbeddedResourceUseDependentUponConvention>false</EmbeddedResourceUseDependentUponConvention>
<!-- Tests do not work on Helix yet -->
<BuildHelixPayload>false</BuildHelixPayload>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
@ -15,18 +19,13 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\..\src\Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X\Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X.csproj" /> <Reference Include="Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X" />
<ProjectReference Include="..\..\src\Microsoft.CodeAnalysis.Razor\Microsoft.CodeAnalysis.Razor.csproj" /> <Reference Include="Microsoft.CodeAnalysis.Razor" />
<Reference Include="Microsoft.CodeAnalysis.CSharp" />
<Reference Include="Microsoft.Extensions.DependencyModel" />
<ProjectReference Include="..\Microsoft.AspNetCore.Razor.Test.Common\Microsoft.AspNetCore.Razor.Test.Common.csproj" /> <ProjectReference Include="..\..\test\Microsoft.AspNetCore.Razor.Test.Common\Microsoft.AspNetCore.Razor.Test.Common.csproj" />
<ProjectReference Include="..\Microsoft.AspNetCore.Razor.Test.MvcShim.Version2_X\Microsoft.AspNetCore.Razor.Test.MvcShim.Version2_X.csproj" /> <ProjectReference Include="..\..\test\Microsoft.AspNetCore.Razor.Test.MvcShim.Version2_X\Microsoft.AspNetCore.Razor.Test.MvcShim.Version2_X.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Testing" Version="$(MicrosoftAspNetCoreTestingPackageVersion)" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="$(Runtime_MicrosoftCodeAnalysisCSharpPackageVersion)" />
<PackageReference Include="Microsoft.Extensions.DependencyModel" Version="$(MicrosoftExtensionsDependencyModelPackageVersion)" />
<PackageReference Include="Moq" Version="$(MoqPackageVersion)" />
</ItemGroup> </ItemGroup>
<Target Name="CopyDepsFromShims" AfterTargets="Build"> <Target Name="CopyDepsFromShims" AfterTargets="Build">

View File

@ -4,17 +4,19 @@
<Description>ASP.NET Core design time hosting infrastructure for the Razor view engine.</Description> <Description>ASP.NET Core design time hosting infrastructure for the Razor view engine.</Description>
<TargetFramework>netstandard2.0</TargetFramework> <TargetFramework>netstandard2.0</TargetFramework>
<PackageTags>$(PackageTags);aspnetcoremvc</PackageTags> <PackageTags>$(PackageTags);aspnetcoremvc</PackageTags>
<!-- Need to build this project in source build -->
<ExcludeFromSourceBuild>false</ExcludeFromSourceBuild>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Compile Include="..\Microsoft.AspNetCore.Razor.Language\CodeGeneration\CodeWriterExtensions.cs" Link="Shared\CodeWriterExtensions.cs" /> <Compile Include="..\..\Microsoft.AspNetCore.Razor.Language\src\CodeGeneration\CodeWriterExtensions.cs" Link="Shared\CodeWriterExtensions.cs" />
<Compile Include="..\Microsoft.AspNetCore.Razor.Language\CSharpIdentifier.cs" Link="Shared\CSharpIdentifier.cs" /> <Compile Include="..\..\Microsoft.AspNetCore.Razor.Language\src\CSharpIdentifier.cs" Link="Shared\CSharpIdentifier.cs" />
<Compile Include="..\Microsoft.AspNetCore.Razor.Language\Checksum.cs" Link="Shared\Checksum.cs" /> <Compile Include="..\..\Microsoft.AspNetCore.Razor.Language\src\Checksum.cs" Link="Shared\Checksum.cs" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="../Microsoft.AspNetCore.Razor.Language/Microsoft.AspNetCore.Razor.Language.csproj" /> <Reference Include="Microsoft.AspNetCore.Razor.Language" />
<ProjectReference Include="../Microsoft.CodeAnalysis.Razor/Microsoft.CodeAnalysis.Razor.csproj" /> <Reference Include="Microsoft.CodeAnalysis.Razor" />
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@ -16,7 +16,7 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Extensions.IntegrationTests
private readonly static CSharpCompilation DefaultBaseCompilation = MvcShim.BaseCompilation.WithAssemblyName("AppCode"); private readonly static CSharpCompilation DefaultBaseCompilation = MvcShim.BaseCompilation.WithAssemblyName("AppCode");
public CodeGenerationIntegrationTest() public CodeGenerationIntegrationTest()
: base(generateBaselines: null) : base(generateBaselines: null, projectDirectoryHint: "Microsoft.AspNetCore.Mvc.Razor.Extensions")
{ {
Configuration = RazorConfiguration.Create( Configuration = RazorConfiguration.Create(
RazorLanguageVersion.Version_3_0, RazorLanguageVersion.Version_3_0,

View File

@ -1,12 +1,16 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFrameworks>$(StandardTestTfms)</TargetFrameworks> <TargetFrameworks>$(DefaultNetCoreTargetFramework)</TargetFrameworks>
<TargetFrameworks Condition="'$(OS)' == 'Windows_NT'">$(TargetFrameworks);net461</TargetFrameworks>
<PreserveCompilationContext>true</PreserveCompilationContext> <PreserveCompilationContext>true</PreserveCompilationContext>
<DefaultItemExcludes>$(DefaultItemExcludes);TestFiles\**</DefaultItemExcludes> <DefaultItemExcludes>$(DefaultItemExcludes);TestFiles\**</DefaultItemExcludes>
<!-- Work around https://github.com/microsoft/msbuild/issues/4740 --> <!-- Work around https://github.com/microsoft/msbuild/issues/4740 -->
<EmbeddedResourceUseDependentUponConvention>false</EmbeddedResourceUseDependentUponConvention> <EmbeddedResourceUseDependentUponConvention>false</EmbeddedResourceUseDependentUponConvention>
<!-- Tests do not work on Helix yet -->
<BuildHelixPayload>false</BuildHelixPayload>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
@ -15,17 +19,12 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\..\src\Microsoft.AspNetCore.Mvc.Razor.Extensions\Microsoft.AspNetCore.Mvc.Razor.Extensions.csproj" /> <Reference Include="Microsoft.AspNetCore.Mvc.Razor.Extensions" />
<ProjectReference Include="..\..\src\Microsoft.CodeAnalysis.Razor\Microsoft.CodeAnalysis.Razor.csproj" /> <Reference Include="Microsoft.CodeAnalysis.Razor" />
<ProjectReference Include="..\Microsoft.AspNetCore.Razor.Test.Common\Microsoft.AspNetCore.Razor.Test.Common.csproj" /> <Reference Include="Microsoft.CodeAnalysis.CSharp" />
<ProjectReference Include="..\Microsoft.AspNetCore.Razor.Test.MvcShim\Microsoft.AspNetCore.Razor.Test.MvcShim.csproj" /> <Reference Include="Microsoft.Extensions.DependencyModel" />
</ItemGroup> <ProjectReference Include="..\..\test\Microsoft.AspNetCore.Razor.Test.Common\Microsoft.AspNetCore.Razor.Test.Common.csproj" />
<ProjectReference Include="..\..\test\Microsoft.AspNetCore.Razor.Test.MvcShim\Microsoft.AspNetCore.Razor.Test.MvcShim.csproj" />
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Testing" Version="$(MicrosoftAspNetCoreTestingPackageVersion)" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="$(Runtime_MicrosoftCodeAnalysisCSharpPackageVersion)" />
<PackageReference Include="Microsoft.Extensions.DependencyModel" Version="$(MicrosoftExtensionsDependencyModelPackageVersion)" />
<PackageReference Include="Moq" Version="$(MoqPackageVersion)" />
</ItemGroup> </ItemGroup>
<Target Name="CopyDepsFromShims" AfterTargets="Build"> <Target Name="CopyDepsFromShims" AfterTargets="Build">

View File

@ -3,10 +3,12 @@
<PropertyGroup> <PropertyGroup>
<Description>Razor is a markup syntax for adding server-side logic to web pages. This package contains the Razor parser and code generation infrastructure.</Description> <Description>Razor is a markup syntax for adding server-side logic to web pages. This package contains the Razor parser and code generation infrastructure.</Description>
<TargetFramework>netstandard2.0</TargetFramework> <TargetFramework>netstandard2.0</TargetFramework>
<!-- Need to build this project in source build -->
<ExcludeFromSourceBuild>false</ExcludeFromSourceBuild>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Microsoft.Extensions.HashCodeCombiner.Sources" PrivateAssets="All" Version="$(MicrosoftExtensionsHashCodeCombinerSourcesPackageVersion)" /> <Compile Include="$(SharedSourceRoot)HashCodeCombiner\*.cs" />
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@ -1,12 +1,16 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFrameworks>$(StandardTestTfms)</TargetFrameworks> <TargetFrameworks>$(DefaultNetCoreTargetFramework)</TargetFrameworks>
<TargetFrameworks Condition="'$(OS)' == 'Windows_NT'">$(TargetFrameworks);net461</TargetFrameworks>
<DefaultItemExcludes>$(DefaultItemExcludes);TestFiles\**\*</DefaultItemExcludes> <DefaultItemExcludes>$(DefaultItemExcludes);TestFiles\**\*</DefaultItemExcludes>
<DefineConstants Condition="'$(GenerateBaselines)'=='true'">$(DefineConstants);GENERATE_BASELINES</DefineConstants> <DefineConstants Condition="'$(GenerateBaselines)'=='true'">$(DefineConstants);GENERATE_BASELINES</DefineConstants>
<!-- Work around https://github.com/microsoft/msbuild/issues/4740 --> <!-- Work around https://github.com/microsoft/msbuild/issues/4740 -->
<EmbeddedResourceUseDependentUponConvention>false</EmbeddedResourceUseDependentUponConvention> <EmbeddedResourceUseDependentUponConvention>false</EmbeddedResourceUseDependentUponConvention>
<!-- Tests do not work on Helix yet -->
<BuildHelixPayload>false</BuildHelixPayload>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
@ -15,14 +19,9 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\..\src\Microsoft.AspNetCore.Razor.Language\Microsoft.AspNetCore.Razor.Language.csproj" /> <Reference Include="Microsoft.AspNetCore.Razor.Language" />
<ProjectReference Include="..\Microsoft.AspNetCore.Razor.Test.Common\Microsoft.AspNetCore.Razor.Test.Common.csproj" /> <ProjectReference Include="..\..\test\Microsoft.AspNetCore.Razor.Test.Common\Microsoft.AspNetCore.Razor.Test.Common.csproj" />
<ProjectReference Include="..\Microsoft.AspNetCore.Razor.Test.ComponentShim\Microsoft.AspNetCore.Razor.Test.ComponentShim.csproj" /> <ProjectReference Include="..\..\test\Microsoft.AspNetCore.Razor.Test.ComponentShim\Microsoft.AspNetCore.Razor.Test.ComponentShim.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Testing" Version="$(MicrosoftAspNetCoreTestingPackageVersion)" />
<PackageReference Include="Moq" Version="$(MoqPackageVersion)" />
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@ -20,24 +20,27 @@
<!-- Don't produce rzc.exe --> <!-- Don't produce rzc.exe -->
<UseAppHost>false</UseAppHost> <UseAppHost>false</UseAppHost>
<!-- Need to build this project in source build -->
<ExcludeFromSourceBuild>false</ExcludeFromSourceBuild>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Compile Include="..\Microsoft.CodeAnalysis.Razor.Workspaces\Serialization\TagHelperDescriptorJsonConverter.cs"> <Compile Include="$(SharedSourceRoot)RazorShared\TagHelperDescriptorJsonConverter.cs">
<Link>Shared\TagHelperDescriptorJsonConverter.cs</Link> <Link>Shared\TagHelperDescriptorJsonConverter.cs</Link>
</Compile> </Compile>
<Compile Include="..\Microsoft.VisualStudio.LanguageServices.Razor\Serialization\RazorDiagnosticJsonConverter.cs"> <Compile Include="$(SharedSourceRoot)RazorShared\RazorDiagnosticJsonConverter.cs">
<Link>Shared\RazorDiagnosticJsonConverter.cs</Link> <Link>Shared\RazorDiagnosticJsonConverter.cs</Link>
</Compile> </Compile>
<Compile Include="$(SharedSourceRoot)CommandLineUtils\**\*.cs" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Microsoft.Extensions.CommandLineUtils.Sources" Version="$(MicrosoftExtensionsCommandLineUtilsSourcesPackageVersion)" /> <Reference Include="Newtonsoft.Json" Version="$(Razor_NewtonsoftJsonPackageVersion)" />
<PackageReference Include="Newtonsoft.Json" Version="$(NewtonsoftJsonPackageVersion)" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\Microsoft.CodeAnalysis.Razor\Microsoft.CodeAnalysis.Razor.csproj" /> <Reference Include="Microsoft.CodeAnalysis.Razor" />
</ItemGroup> </ItemGroup>
<!-- This makes it so that the runtimeconfig.json is included as part of the build output of the project that references this project. --> <!-- This makes it so that the runtimeconfig.json is included as part of the build output of the project that references this project. -->

View File

@ -3,16 +3,14 @@
<PropertyGroup> <PropertyGroup>
<TargetFramework>$(DefaultNetCoreTargetFramework)</TargetFramework> <TargetFramework>$(DefaultNetCoreTargetFramework)</TargetFramework>
<DefaultItemExcludes>$(DefaultItemExcludes);TestFiles\**</DefaultItemExcludes> <DefaultItemExcludes>$(DefaultItemExcludes);TestFiles\**</DefaultItemExcludes>
<!-- Tests do not work on Helix yet -->
<BuildHelixPayload>false</BuildHelixPayload>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\..\src\Microsoft.AspNetCore.Razor.Tools\Microsoft.AspNetCore.Razor.Tools.csproj" /> <Reference Include="rzc" />
<ProjectReference Include="..\Microsoft.AspNetCore.Razor.Test.Common\Microsoft.AspNetCore.Razor.Test.Common.csproj" /> <ProjectReference Include="..\..\test\Microsoft.AspNetCore.Razor.Test.Common\Microsoft.AspNetCore.Razor.Test.Common.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Testing" Version="$(MicrosoftAspNetCoreTestingPackageVersion)" />
<PackageReference Include="Moq" Version="$(MoqPackageVersion)" />
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@ -3,14 +3,13 @@
<PropertyGroup> <PropertyGroup>
<Description>Razor is a markup syntax for adding server-side logic to web pages. This package contains the Razor design-time infrastructure.</Description> <Description>Razor is a markup syntax for adding server-side logic to web pages. This package contains the Razor design-time infrastructure.</Description>
<TargetFramework>netstandard2.0</TargetFramework> <TargetFramework>netstandard2.0</TargetFramework>
<!-- Need to build this project in source build -->
<ExcludeFromSourceBuild>false</ExcludeFromSourceBuild>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\Microsoft.AspNetCore.Razor.Language\Microsoft.AspNetCore.Razor.Language.csproj" /> <Reference Include="Microsoft.AspNetCore.Razor.Language" />
</ItemGroup> <Reference Include="Microsoft.CodeAnalysis.Common" />
<Reference Include="Microsoft.CodeAnalysis.CSharp" />
<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.Common" Version="$(Runtime_MicrosoftCodeAnalysisCommonPackageVersion)" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="$(Runtime_MicrosoftCodeAnalysisCSharpPackageVersion)" />
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@ -11,11 +11,6 @@ namespace Microsoft.CodeAnalysis.Razor
{ {
public static SourceChange AsSourceChange(this TextChange textChange) public static SourceChange AsSourceChange(this TextChange textChange)
{ {
if (textChange == null)
{
throw new ArgumentNullException(nameof(textChange));
}
return new SourceChange(textChange.Span.AsSourceSpan(), textChange.NewText); return new SourceChange(textChange.Span.AsSourceSpan(), textChange.NewText);
} }
} }

View File

@ -1,9 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFrameworks>$(StandardTestTfms)</TargetFrameworks> <TargetFrameworks>$(DefaultNetCoreTargetFramework)</TargetFrameworks>
<TargetFrameworks Condition="'$(OS)' == 'Windows_NT'">$(TargetFrameworks);net461</TargetFrameworks>
<DefaultItemExcludes>$(DefaultItemExcludes);TestFiles\**\*</DefaultItemExcludes> <DefaultItemExcludes>$(DefaultItemExcludes);TestFiles\**\*</DefaultItemExcludes>
<PreserveCompilationContext>true</PreserveCompilationContext> <PreserveCompilationContext>true</PreserveCompilationContext>
<!-- Tests do not work on Helix yet -->
<BuildHelixPayload>false</BuildHelixPayload>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
@ -12,18 +16,14 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\..\src\Microsoft.CodeAnalysis.Razor\Microsoft.CodeAnalysis.Razor.csproj" /> <Reference Include="Microsoft.CodeAnalysis.Razor" />
<ProjectReference Include="..\..\src\Microsoft.AspNetCore.Razor.Language\Microsoft.AspNetCore.Razor.Language.csproj" /> <Reference Include="Microsoft.AspNetCore.Razor.Language" />
<ProjectReference Include="..\Microsoft.AspNetCore.Razor.Test.Common\Microsoft.AspNetCore.Razor.Test.Common.csproj" /> <Reference Include="Microsoft.CodeAnalysis.CSharp" />
<Reference Include="Microsoft.Extensions.DependencyModel" />
<ProjectReference Include="..\..\test\Microsoft.AspNetCore.Razor.Test.Common\Microsoft.AspNetCore.Razor.Test.Common.csproj" />
<!-- Included for definitions of Tag Helper types --> <!-- Included for definitions of Tag Helper types -->
<ProjectReference Include="..\Microsoft.AspNetCore.Razor.Test.MvcShim\Microsoft.AspNetCore.Razor.Test.MvcShim.csproj" /> <ProjectReference Include="..\..\test\Microsoft.AspNetCore.Razor.Test.MvcShim\Microsoft.AspNetCore.Razor.Test.MvcShim.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="$(Runtime_MicrosoftCodeAnalysisCSharpPackageVersion)" />
<PackageReference Include="Microsoft.Extensions.DependencyModel" Version="$(MicrosoftExtensionsDependencyModelPackageVersion)" />
<PackageReference Include="Moq" Version="$(MoqPackageVersion)" />
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@ -13,47 +13,56 @@
<NoWarn>$(NoWarn);NU5100</NoWarn> <NoWarn>$(NoWarn);NU5100</NoWarn>
<!-- It is intentional to not include build/netstandard2.0/Microsoft.NET.Sdk.Razor.targets --> <!-- It is intentional to not include build/netstandard2.0/Microsoft.NET.Sdk.Razor.targets -->
<NoWarn>$(NoWarn);NU5129</NoWarn> <NoWarn>$(NoWarn);NU5129</NoWarn>
<!-- Ignore file copy warnings -->
<NoWarn>$(NoWarn);MSB3030;MSB4181</NoWarn>
<!-- Cannot run pubternal check on net46 -->
<DisablePubternalApiCheck>true</DisablePubternalApiCheck>
<!-- Need to build this project in source build -->
<ExcludeFromSourceBuild>false</ExcludeFromSourceBuild>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Microsoft.Build.Framework" Version="$(MicrosoftBuildFrameworkPackageVersion)" /> <Reference Include="Microsoft.Build.Framework" />
<PackageReference Include="Microsoft.Build.Utilities.Core" Version="$(MicrosoftBuildUtilitiesCorePackageVersion)" /> <Reference Include="Microsoft.Build.Utilities.Core" />
<PackageReference Include="Microsoft.Extensions.CommandLineUtils.Sources" Version="$(MicrosoftExtensionsCommandLineUtilsSourcesPackageVersion)" /> <Reference Include="System.Reflection.Metadata" Condition="'$(TargetFramework)'=='net46'" />
<PackageReference Include="System.Reflection.Metadata" Version="$(SystemReflectionMetadataPackageVersion)" Condition="'$(TargetFramework)'=='net46'" />
<ProjectReference Include="..\Microsoft.AspNetCore.Mvc.Razor.Extensions\Microsoft.AspNetCore.Mvc.Razor.Extensions.csproj" ReferenceOutputAssembly="false" Condition="'$(TargetFramework)'=='$(DefaultNetCoreTargetFramework)'" /> <Reference Include="Microsoft.AspNetCore.Mvc.Razor.Extensions" ReferenceOutputAssembly="false" Condition="'$(TargetFramework)'=='$(DefaultNetCoreTargetFramework)'" />
<ProjectReference Include="..\Microsoft.AspNetCore.Razor.Tools\Microsoft.AspNetCore.Razor.Tools.csproj" ReferenceOutputAssembly="false" Condition="'$(TargetFramework)'=='$(DefaultNetCoreTargetFramework)'" /> <Reference Include="rzc" ReferenceOutputAssembly="false" Condition="'$(TargetFramework)'=='$(DefaultNetCoreTargetFramework)'" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="..\Microsoft.AspNetCore.Razor.Tools\ServerProtocol\*.cs"> <Compile Include="..\..\Microsoft.AspNetCore.Razor.Tools\src\ServerProtocol\*.cs">
<Link>Shared\ServerProtocol\%(FileName)</Link> <Link>Shared\ServerProtocol\%(FileName)</Link>
</Compile> </Compile>
<Compile Include="..\Microsoft.AspNetCore.Razor.Tools\PipeName.cs"> <Compile Include="..\..\Microsoft.AspNetCore.Razor.Tools\src\PipeName.cs">
<Link>Shared\PipeName.cs</Link> <Link>Shared\PipeName.cs</Link>
</Compile> </Compile>
<Compile Include="..\Microsoft.AspNetCore.Razor.Tools\MutexName.cs"> <Compile Include="..\..\Microsoft.AspNetCore.Razor.Tools\src\MutexName.cs">
<Link>Shared\MutexName.cs</Link> <Link>Shared\MutexName.cs</Link>
</Compile> </Compile>
<Compile Include="..\Microsoft.AspNetCore.Razor.Tools\Client.cs"> <Compile Include="..\..\Microsoft.AspNetCore.Razor.Tools\src\Client.cs">
<Link>Shared\Client.cs</Link> <Link>Shared\Client.cs</Link>
</Compile> </Compile>
<Compile Include="$(SharedSourceRoot)CommandLineUtils\**\*.cs" />
<Content Include="_._" CopyToOutputDirectory="PreserveNewest" /> <Content Include="_._" CopyToOutputDirectory="PreserveNewest" />
</ItemGroup> </ItemGroup>
<Target Name="LayoutDependencies" BeforeTargets="Build" Condition="'$(IsInnerBuild)' != 'true'"> <Target Name="LayoutDependencies" BeforeTargets="Build">
<!-- Layout tasks, compiler, and extensions in the sdk-output folder. The entire folder structure gets packaged as-is into the SDK --> <!-- Layout tasks, compiler, and extensions in the sdk-output folder. The entire folder structure gets packaged as-is into the SDK -->
<MSBuild <MSBuild
Projects="..\Microsoft.AspNetCore.Razor.Tools\Microsoft.AspNetCore.Razor.Tools.csproj" Projects="..\..\Microsoft.AspNetCore.Razor.Tools\src\Microsoft.AspNetCore.Razor.Tools.csproj"
Properties="PublishDir=$(SdkOutputPath)tools\netcoreapp3.0;TargetFramework=netcoreapp3.0" Properties="PublishDir=$(SdkOutputPath)temp;TargetFramework=netcoreapp3.0"
Targets="Publish" /> Targets="Publish"
ContinueOnError="true" />
<ItemGroup> <ItemGroup>
<RazorToolsOutput Include="$(SdkOutputPath)temp\**\*.*" />
<MvcRazorExtensionOutput Include="$(ArtifactsBinDir)Microsoft.AspNetCore.Mvc.Razor.Extensions\$(Configuration)\netstandard2.0\Microsoft.AspNetCore.Mvc.Razor.Extensions.dll" /> <MvcRazorExtensionOutput Include="$(ArtifactsBinDir)Microsoft.AspNetCore.Mvc.Razor.Extensions\$(Configuration)\netstandard2.0\Microsoft.AspNetCore.Mvc.Razor.Extensions.dll" />
</ItemGroup> </ItemGroup>
<Copy SourceFiles="@(MvcRazorExtensionOutput)" DestinationFolder="$(SdkOutputPath)extensions\mvc-3-0\" SkipUnchangedFiles="true"> <Copy SourceFiles="@(RazorToolsOutput)" DestinationFolder="$(SdkOutputPath)tools\netcoreapp3.0\" SkipUnchangedFiles="true" ContinueOnError="true" />
<Copy SourceFiles="@(MvcRazorExtensionOutput)" DestinationFolder="$(SdkOutputPath)extensions\mvc-3-0\" SkipUnchangedFiles="true" ContinueOnError="true" Condition="'$(TargetFramework)'=='$(DefaultNetCoreTargetFramework)'">
<Output TaskParameter="CopiedFiles" ItemName="FileWrites" /> <Output TaskParameter="CopiedFiles" ItemName="FileWrites" />
</Copy> </Copy>
@ -65,9 +74,17 @@
<ProjectOutput Include="$(ArtifactsBinDir)Microsoft.NET.Sdk.Razor\$(Configuration)\net46*\System.Reflection.Metadata.dll" /> <ProjectOutput Include="$(ArtifactsBinDir)Microsoft.NET.Sdk.Razor\$(Configuration)\net46*\System.Reflection.Metadata.dll" />
</ItemGroup> </ItemGroup>
<Copy SourceFiles="@(ProjectOutput)" DestinationFiles="$(SdkOutputPath)tasks\%(RecursiveDir)%(FileName)%(Extension)" SkipUnchangedFiles="true"> <Copy SourceFiles="@(ProjectOutput)" DestinationFiles="$(SdkOutputPath)tasks\%(RecursiveDir)%(FileName)%(Extension)" SkipUnchangedFiles="true" ContinueOnError="true" >
<Output TaskParameter="CopiedFiles" ItemName="FileWrites" /> <Output TaskParameter="CopiedFiles" ItemName="FileWrites" />
</Copy> </Copy>
<Message Importance="High" Text="Prepared Razor SDK at $(SdkOutputPath)" />
<ItemGroup>
<_PreparedRazorSdkFiles Include="$(SdkOutputPath)**\*.*" />
</ItemGroup>
<Message Importance="High" Text="Prepared files:@(_PreparedRazorSdkFiles->'%0a%(Identity)')" />
</Target> </Target>
<Target Name="PopulateNuspec" BeforeTargets="InitializeStandardNuspecProperties" DependsOnTargets="LayoutDependencies"> <Target Name="PopulateNuspec" BeforeTargets="InitializeStandardNuspecProperties" DependsOnTargets="LayoutDependencies">

View File

@ -1,41 +1,24 @@
// Copyright (c) .NET Foundation. All rights reserved. // 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. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
namespace Microsoft.AspNetCore.Razor.Design.IntegrationTests namespace Microsoft.AspNetCore.Razor.Design.IntegrationTests
{ {
internal static partial class BuildVariables internal static partial class BuildVariables
{ {
private static string _msBuildPath = string.Empty; private static readonly IEnumerable<AssemblyMetadataAttribute> TestAssemblyMetadata = Assembly.GetExecutingAssembly().GetCustomAttributes<AssemblyMetadataAttribute>();
private static string _MicrosoftNETCoreApp50PackageVersion = string.Empty;
private static string _microsoftNetCompilersToolsetPackageVersion = string.Empty;
static partial void InitializeVariables(); public static string MSBuildPath => TestAssemblyMetadata.SingleOrDefault(a => a.Key == "DesktopMSBuildPath").Value;
public static string MSBuildPath public static string MicrosoftNETCoreAppRuntimeVersion => TestAssemblyMetadata.SingleOrDefault(a => a.Key == "MicrosoftNETCoreAppRuntimeVersion").Value;
{
get
{
InitializeVariables();
return _msBuildPath;
}
}
public static string MicrosoftNETCoreApp50PackageVersion public static string MicrosoftNetCompilersToolsetPackageVersion => TestAssemblyMetadata.SingleOrDefault(a => a.Key == "MicrosoftNetCompilersToolsetPackageVersion").Value;
{
get
{
InitializeVariables();
return _MicrosoftNETCoreApp50PackageVersion;
}
}
public static string MicrosoftNetCompilersToolsetPackageVersion public static string RazorSdkDirectoryRoot => TestAssemblyMetadata.SingleOrDefault(a => a.Key == "RazorSdkDirectoryRoot").Value;
{
get public static string RepoRoot => TestAssemblyMetadata.SingleOrDefault(a => a.Key == "Testing.RepoRoot").Value;
{
InitializeVariables();
return _microsoftNetCompilersToolsetPackageVersion;
}
}
} }
} }

View File

@ -157,7 +157,7 @@ namespace Microsoft.AspNetCore.Razor.Design.IntegrationTests
// Publish rzc tool to a temporary path. This is the location based on which the pipe name is generated. // Publish rzc tool to a temporary path. This is the location based on which the pipe name is generated.
var repositoryRoot = ProjectDirectory.SearchUp(AppContext.BaseDirectory, "global.json"); var repositoryRoot = ProjectDirectory.SearchUp(AppContext.BaseDirectory, "global.json");
var solutionRoot = Path.Combine(repositoryRoot, "src", "Razor"); var solutionRoot = Path.Combine(repositoryRoot, "src", "Razor");
var toolAssemblyDirectory = Path.Combine(solutionRoot, "src", "Microsoft.AspNetCore.Razor.Tools"); var toolAssemblyDirectory = Path.Combine(solutionRoot, "Microsoft.AspNetCore.Razor.Tools", "src");
var toolAssemblyPath = Path.Combine(toolAssemblyDirectory, "Microsoft.AspNetCore.Razor.Tools.csproj"); var toolAssemblyPath = Path.Combine(toolAssemblyDirectory, "Microsoft.AspNetCore.Razor.Tools.csproj");
var projectDirectory = new TestProjectDirectory(solutionRoot, toolAssemblyDirectory, toolAssemblyPath); var projectDirectory = new TestProjectDirectory(solutionRoot, toolAssemblyDirectory, toolAssemblyPath);
var publishDir = Path.Combine(Path.GetTempPath(), "Razor", Path.GetRandomFileName(), "RzcPublish"); var publishDir = Path.Combine(Path.GetTempPath(), "Razor", Path.GetRandomFileName(), "RzcPublish");

View File

@ -80,8 +80,10 @@ namespace Microsoft.AspNetCore.Razor.Design.IntegrationTests
// Let the test app know it is running as part of a test. // Let the test app know it is running as part of a test.
"/p:RunningAsTest=true", "/p:RunningAsTest=true",
$"/p:MicrosoftNETCoreApp50PackageVersion={BuildVariables.MicrosoftNETCoreApp50PackageVersion}", $"/p:MicrosoftNETCoreAppRuntimeVersion={BuildVariables.MicrosoftNETCoreAppRuntimeVersion}",
$"/p:MicrosoftNetCompilersToolsetPackageVersion={BuildVariables.MicrosoftNetCompilersToolsetPackageVersion}", $"/p:MicrosoftNetCompilersToolsetPackageVersion={BuildVariables.MicrosoftNetCompilersToolsetPackageVersion}",
$"/p:RazorSdkDirectoryRoot={BuildVariables.RazorSdkDirectoryRoot}",
$"/p:RepoRoot={BuildVariables.RepoRoot}",
}; };
if (!suppressBuildServer) if (!suppressBuildServer)

View File

@ -30,18 +30,13 @@ namespace Microsoft.AspNetCore.Razor.Design.IntegrationTests
throw new InvalidOperationException($"{destinationPath} should be empty"); throw new InvalidOperationException($"{destinationPath} should be empty");
} }
var repositoryRoot = SearchUp(AppContext.BaseDirectory, "global.json"); var repositoryRoot = BuildVariables.RepoRoot;
if (repositoryRoot == null)
{
throw new InvalidOperationException("Could not find repository root.");
}
var solutionRoot = Path.Combine(repositoryRoot, "src", "Razor"); var solutionRoot = Path.Combine(repositoryRoot, "src", "Razor");
var binariesRoot = Path.GetDirectoryName(typeof(ProjectDirectory).Assembly.Location); var binariesRoot = Path.GetDirectoryName(typeof(ProjectDirectory).Assembly.Location);
foreach (var project in new string[] { originalProjectName, }.Concat(additionalProjects)) foreach (var project in new string[] { originalProjectName, }.Concat(additionalProjects))
{ {
var testAppsRoot = Path.Combine(solutionRoot, "test", "testapps"); var testAppsRoot = Path.Combine(solutionRoot, "test", "testassets");
var projectRoot = Path.Combine(testAppsRoot, project); var projectRoot = Path.Combine(testAppsRoot, project);
if (!Directory.Exists(projectRoot)) if (!Directory.Exists(projectRoot))
{ {
@ -51,7 +46,7 @@ namespace Microsoft.AspNetCore.Razor.Design.IntegrationTests
var projectDestination = Path.Combine(destinationPath, project); var projectDestination = Path.Combine(destinationPath, project);
var projectDestinationDir = Directory.CreateDirectory(projectDestination); var projectDestinationDir = Directory.CreateDirectory(projectDestination);
CopyDirectory(new DirectoryInfo(projectRoot), projectDestinationDir); CopyDirectory(new DirectoryInfo(projectRoot), projectDestinationDir);
SetupDirectoryBuildFiles(solutionRoot, binariesRoot, testAppsRoot, projectDestination); SetupDirectoryBuildFiles(repositoryRoot, binariesRoot, testAppsRoot, projectDestination);
} }
// Rename the csproj/fsproj // Rename the csproj/fsproj
@ -120,12 +115,13 @@ namespace Microsoft.AspNetCore.Razor.Design.IntegrationTests
} }
} }
void SetupDirectoryBuildFiles(string solutionRoot, string binariesRoot, string testAppsRoot, string projectDestination) void SetupDirectoryBuildFiles(string repoRoot, string binariesRoot, string testAppsRoot, string projectDestination)
{ {
var beforeDirectoryPropsContent = var beforeDirectoryPropsContent =
$@"<Project> $@"<Project>
<PropertyGroup> <PropertyGroup>
<SolutionRoot>{solutionRoot}</SolutionRoot> <RepoRoot>{repoRoot}</RepoRoot>
<RazorSdkDirectoryRoot>{BuildVariables.RazorSdkDirectoryRoot}</RazorSdkDirectoryRoot>
<BinariesRoot>{binariesRoot}</BinariesRoot> <BinariesRoot>{binariesRoot}</BinariesRoot>
</PropertyGroup> </PropertyGroup>
</Project>"; </Project>";

View File

@ -13,6 +13,9 @@
<!-- Copy references locally so that we can use them in the test. --> <!-- Copy references locally so that we can use them in the test. -->
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies> <CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
<BuildVariablesGeneratedFile>$(MSBuildProjectDirectory)\obj\BuildVariables.generated.cs</BuildVariablesGeneratedFile> <BuildVariablesGeneratedFile>$(MSBuildProjectDirectory)\obj\BuildVariables.generated.cs</BuildVariablesGeneratedFile>
<!-- Tests do not work on Helix yet -->
<BuildHelixPayload>false</BuildHelixPayload>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
@ -21,16 +24,14 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Microsoft.Build.Utilities.Core" Version="$(MicrosoftBuildUtilitiesCorePackageVersion)" /> <Reference Include="Microsoft.Build.Utilities.Core" />
<PackageReference Include="Microsoft.Extensions.DependencyModel" Version="$(MicrosoftExtensionsDependencyModelPackageVersion)" /> <Reference Include="Microsoft.Extensions.DependencyModel" />
<PackageReference Include="Microsoft.AspNetCore.Testing" Version="$(MicrosoftAspNetCoreTestingPackageVersion)" />
<PackageReference Include="Moq" Version="$(MoqPackageVersion)" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<AssemblyAttribute Include="System.Reflection.AssemblyMetadataAttribute"> <AssemblyAttribute Include="System.Reflection.AssemblyMetadataAttribute">
<_Parameter1>Testing.AdditionalRestoreSources</_Parameter1> <_Parameter1>Testing.AdditionalRestoreSources</_Parameter1>
<_Parameter2>$(MSBuildThisFileDirectory)..\testapps\PregeneratedPackages</_Parameter2> <_Parameter2>$(MSBuildThisFileDirectory)..\testassets\PregeneratedPackages</_Parameter2>
</AssemblyAttribute> </AssemblyAttribute>
<AssemblyAttribute Include="System.Reflection.AssemblyMetadataAttribute"> <AssemblyAttribute Include="System.Reflection.AssemblyMetadataAttribute">
@ -48,84 +49,73 @@
<_Parameter2>$(RepoRoot)</_Parameter2> <_Parameter2>$(RepoRoot)</_Parameter2>
</AssemblyAttribute> </AssemblyAttribute>
</ItemGroup> <AssemblyAttribute Include="System.Reflection.AssemblyMetadataAttribute">
<_Parameter1>MicrosoftNETCoreAppRuntimeVersion</_Parameter1>
<_Parameter2>$(MicrosoftNETCoreAppRuntimeVersion)</_Parameter2>
</AssemblyAttribute>
<AssemblyAttribute Include="System.Reflection.AssemblyMetadataAttribute">
<_Parameter1>MicrosoftNetCompilersToolsetPackageVersion</_Parameter1>
<_Parameter2>$(MicrosoftNetCompilersToolsetPackageVersion)</_Parameter2>
</AssemblyAttribute>
<AssemblyAttribute Include="System.Reflection.AssemblyMetadataAttribute">
<_Parameter1>RazorSdkDirectoryRoot</_Parameter1>
<_Parameter2>$(ArtifactsBinDir)Microsoft.NET.Sdk.Razor\$(Configuration)\sdk-output\</_Parameter2>
</AssemblyAttribute>
<!-- The test projects rely on these binaries being available -->
<ItemGroup>
<PackageReference Include="System.Diagnostics.DiagnosticSource" Version="$(SystemDiagnosticsDiagnosticSourcePackageVersion)" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\..\src\Microsoft.AspNetCore.Razor.Tools\Microsoft.AspNetCore.Razor.Tools.csproj" /> <!-- The test projects rely on these binaries being available -->
<ProjectReference Include="..\Microsoft.AspNetCore.Razor.Test.MvcShim.ClassLib\Microsoft.AspNetCore.Razor.Test.MvcShim.ClassLib.csproj" /> <Reference Include="System.Diagnostics.DiagnosticSource" />
<ProjectReference Include="..\..\src\Microsoft.NET.Sdk.Razor\Microsoft.NET.Sdk.Razor.csproj" /> <Reference Include="rzc" />
<Reference Include="Microsoft.NET.Sdk.Razor" />
<ProjectReference Include="..\..\test\Microsoft.AspNetCore.Razor.Test.MvcShim.ClassLib\Microsoft.AspNetCore.Razor.Test.MvcShim.ClassLib.csproj" />
<!-- We don't need anything in this assembly, we just want to make sure it's built --> <!-- We don't need anything in this assembly, we just want to make sure it's built -->
<ProjectReference Include="..\..\src\Microsoft.AspNetCore.Mvc.Razor.Extensions\Microsoft.AspNetCore.Mvc.Razor.Extensions.csproj" ReferenceOutputAssembly="false" /> <ProjectReference Include="..\..\Microsoft.AspNetCore.Mvc.Razor.Extensions\src\Microsoft.AspNetCore.Mvc.Razor.Extensions.csproj" ReferenceOutputAssembly="false" >
<SetTargetFramework>TargetFramework=netstandard2.0</SetTargetFramework>
</ProjectReference>
</ItemGroup> </ItemGroup>
<PropertyGroup> <PropertyGroup>
<MSBuildLocationFileOutput>$(IntermediateOutputPath)BuildVariables.generated.cs</MSBuildLocationFileOutput> <MSBuildLocationFileOutput>$(IntermediateOutputPath)BuildVariables.generated.cs</MSBuildLocationFileOutput>
</PropertyGroup> </PropertyGroup>
<Target <Target Name="GenerateTestData" BeforeTargets="GetAssemblyAttributes">
Name="GenerateMSBuildLocationFile"
Condition="'$(TargetFramework)'!=''"
AfterTargets="BeforeBuild"
Inputs="$(MSBuildAllProjects)"
Outputs="$(MSBuildLocationFileOutput)">
<Exec Condition="'$(OS)' == 'Windows_NT'" Command="&quot;$(NuGetPackageRoot)vswhere\$(VSWhereVersion)\tools\vswhere.exe&quot; -latest -prerelease -property installationPath -requires Microsoft.Component.MSBuild" ConsoleToMsBuild="true" StandardErrorImportance="high"> <Exec Condition="'$(OS)' == 'Windows_NT'" Command="&quot;$(NuGetPackageRoot)vswhere\$(VSWhereVersion)\tools\vswhere.exe&quot; -latest -prerelease -property installationPath -requires Microsoft.Component.MSBuild" ConsoleToMsBuild="true" StandardErrorImportance="high">
<Output TaskParameter="ConsoleOutput" PropertyName="_VSInstallDir" /> <Output TaskParameter="ConsoleOutput" PropertyName="_VSInstallDir" />
</Exec> </Exec>
<Error Condition="'$(OS)' == 'Windows_NT' and '$(_VSInstallDir)'==''" Text="Visual Studio not found on Windows." /> <Error Condition="'$(OS)' == 'Windows_NT' and '$(_VSInstallDir)'=='' and '$(Test)' == 'true'" Text="Visual Studio not found on Windows." />
<PropertyGroup> <PropertyGroup>
<_DesktopMSBuildPath Condition="'$(OS)' == 'Windows_NT' and Exists('$(_VSInstallDir)\MSBuild\Current\Bin\msbuild.exe')">$(_VSInstallDir)\MSBuild\Current\Bin\msbuild.exe</_DesktopMSBuildPath> <_DesktopMSBuildPath Condition="'$(OS)' == 'Windows_NT' and Exists('$(_VSInstallDir)\MSBuild\Current\Bin\msbuild.exe')">$(_VSInstallDir)\MSBuild\Current\Bin\msbuild.exe</_DesktopMSBuildPath>
<_DesktopMSBuildPath Condition="'$(OS)' == 'Windows_NT' and Exists('$(_VSInstallDir)\MSBuild\15.0\Bin\msbuild.exe')">$(_VSInstallDir)\MSBuild\15.0\Bin\msbuild.exe</_DesktopMSBuildPath> <_DesktopMSBuildPath Condition="'$(OS)' == 'Windows_NT' and Exists('$(_VSInstallDir)\MSBuild\15.0\Bin\msbuild.exe')">$(_VSInstallDir)\MSBuild\15.0\Bin\msbuild.exe</_DesktopMSBuildPath>
<_Content><![CDATA[
namespace Microsoft.AspNetCore.Razor.Design.IntegrationTests
{
internal static partial class BuildVariables
{
static partial void InitializeVariables()
{
_msBuildPath = @"$(_DesktopMSBuildPath)";
_MicrosoftNETCoreApp50PackageVersion = "$(MicrosoftNETCoreApp50PackageVersion)";
_microsoftNetCompilersToolsetPackageVersion = "$(MicrosoftNetCompilersToolsetPackageVersion)";
}
}
}
]]>
</_Content>
</PropertyGroup> </PropertyGroup>
<Error Condition="'$(OS)' == 'Windows_NT' and '$(_DesktopMSBuildPath)'==''" Text="MSBuild.exe not found on Windows." /> <Error Condition="'$(OS)' == 'Windows_NT' and '$(_DesktopMSBuildPath)'=='' and '$(Test)' == 'true'" Text="MSBuild.exe not found on Windows." />
<MakeDir Directories="$(IntermediateOutputPath)" />
<WriteLinesToFile Lines="$([MSBuild]::Escape($(_Content)))" File="$(MSBuildLocationFileOutput)" Overwrite="True" WriteOnlyWhenDifferent="True" />
<ItemGroup> <ItemGroup>
<Compile Include="$(MSBuildLocationFileOutput)"> <AssemblyAttribute Include="System.Reflection.AssemblyMetadataAttribute">
<Visible>false</Visible> <_Parameter1>DesktopMSBuildPath</_Parameter1>
</Compile> <_Parameter2>$(_DesktopMSBuildPath)</_Parameter2>
<FileWrites Include="$(MSBuildLocationFileOutput)" /> </AssemblyAttribute>
</ItemGroup> </ItemGroup>
</Target> </Target>
<Target Name="RestoreTestProjects" BeforeTargets="Restore;Build" Condition="'$(DotNetBuildFromSource)' != 'true'"> <Target Name="RestoreTestProjects" BeforeTargets="Restore;Build" Condition="'$(DotNetBuildFromSource)' != 'true'">
<MSBuild Projects="..\testapps\RestoreTestProjects\RestoreTestProjects.csproj" Targets="Restore" Properties="MicrosoftNetCompilersToolsetPackageVersion=$(MicrosoftNetCompilersToolsetPackageVersion)" /> <MSBuild Projects="..\..\test\testassets\RestoreTestProjects\RestoreTestProjects.csproj" Targets="Restore" Properties="MicrosoftNetCompilersToolsetPackageVersion=$(MicrosoftNetCompilersToolsetPackageVersion);RepoRoot=$(RepoRoot)" />
<MSBuild Projects="..\..\test\testassets\PackageLibraryDirectDependency\PackageLibraryDirectDependency.csproj" Targets="Restore" Properties="MicrosoftNetCompilersToolsetPackageVersion=$(MicrosoftNetCompilersToolsetPackageVersion);RepoRoot=$(RepoRoot)" />
<MSBuild Projects="..\testapps\PackageLibraryDirectDependency\PackageLibraryDirectDependency.csproj" Targets="Restore" Properties="MicrosoftNetCompilersToolsetPackageVersion=$(MicrosoftNetCompilersToolsetPackageVersion)" /> <MSBuild Projects="..\..\test\testassets\PackageLibraryTransitiveDependency\PackageLibraryTransitiveDependency.csproj" Targets="Restore" Properties="MicrosoftNetCompilersToolsetPackageVersion=$(MicrosoftNetCompilersToolsetPackageVersion);RepoRoot=$(RepoRoot)" />
<MSBuild Projects="..\testapps\PackageLibraryTransitiveDependency\PackageLibraryTransitiveDependency.csproj" Targets="Restore" Properties="MicrosoftNetCompilersToolsetPackageVersion=$(MicrosoftNetCompilersToolsetPackageVersion)" />
<!-- This target restores SimpleMvc11 and SimpleMvc11NetFx separately because otherwise the TFMs in SimpleMvc11.csproj and SimpleMvc11NetFx.csproj are not respected. --> <!-- This target restores SimpleMvc11 and SimpleMvc11NetFx separately because otherwise the TFMs in SimpleMvc11.csproj and SimpleMvc11NetFx.csproj are not respected. -->
<PropertyGroup> <PropertyGroup>
<TargetFramework11>netcoreapp1.1</TargetFramework11> <TargetFramework11>netcoreapp1.1</TargetFramework11>
<TargetFrameworkNetFx>net461</TargetFrameworkNetFx> <TargetFrameworkNetFx>net461</TargetFrameworkNetFx>
</PropertyGroup> </PropertyGroup>
<MSBuild Projects="..\testapps\SimpleMvc11\SimpleMvc11.csproj" Targets="Restore" Properties="MicrosoftNetCompilersToolsetPackageVersion=$(MicrosoftNetCompilersToolsetPackageVersion);TargetFramework=$(TargetFramework11)" /> <MSBuild Projects="..\..\test\testassets\SimpleMvc11\SimpleMvc11.csproj" Targets="Restore" Properties="MicrosoftNetCompilersToolsetPackageVersion=$(MicrosoftNetCompilersToolsetPackageVersion);TargetFramework=$(TargetFramework11);RepoRoot=$(RepoRoot)" />
<MSBuild Projects="..\testapps\SimpleMvc11NetFx\SimpleMvc11NetFx.csproj" Targets="Restore" Properties="MicrosoftNetCompilersToolsetPackageVersion=$(MicrosoftNetCompilersToolsetPackageVersion);TargetFramework=$(TargetFrameworkNetFx)" /> <MSBuild Projects="..\..\test\testassets\SimpleMvc11NetFx\SimpleMvc11NetFx.csproj" Targets="Restore" Properties="MicrosoftNetCompilersToolsetPackageVersion=$(MicrosoftNetCompilersToolsetPackageVersion);TargetFramework=$(TargetFrameworkNetFx);RepoRoot=$(RepoRoot)" />
</Target> </Target>
<Target Name="EnsureLogFolder" AfterTargets="Build"> <Target Name="EnsureLogFolder" AfterTargets="Build">

View File

@ -0,0 +1,7 @@
<Project>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory)..\, Directory.Build.props))\Directory.Build.props" />
<PropertyGroup>
<DisablePubternalApiCheck>true</DisablePubternalApiCheck>
</PropertyGroup>
</Project>

View File

@ -47,9 +47,9 @@ namespace Microsoft.AspNetCore.Razor.Language.IntegrationTests
new CSharpCompilationOptions(OutputKind.DynamicallyLinkedLibrary)); new CSharpCompilationOptions(OutputKind.DynamicallyLinkedLibrary));
} }
protected IntegrationTestBase(bool? generateBaselines = null) protected IntegrationTestBase(bool? generateBaselines = null, string? projectDirectoryHint = null)
{ {
TestProjectRoot = TestProject.GetProjectDirectory(GetType()); TestProjectRoot = projectDirectoryHint == null ? TestProject.GetProjectDirectory(GetType()) : TestProject.GetProjectDirectory(projectDirectoryHint);
if (generateBaselines.HasValue) if (generateBaselines.HasValue)
{ {
@ -491,12 +491,6 @@ namespace Microsoft.AspNetCore.Razor.Language.IntegrationTests
{ {
var span = spans[i]; var span = spans[i];
var sourceSpan = span.GetSourceSpan(codeDocument.Source); var sourceSpan = span.GetSourceSpan(codeDocument.Source);
if (sourceSpan == null)
{
// Not in the main file, skip.
continue;
}
var expectedSpan = sourceContent.Substring(sourceSpan.AbsoluteIndex, sourceSpan.Length); var expectedSpan = sourceContent.Substring(sourceSpan.AbsoluteIndex, sourceSpan.Length);
// See #2593 // See #2593

View File

@ -8,15 +8,35 @@ namespace Microsoft.AspNetCore.Razor.Language
{ {
public static class TestProject public static class TestProject
{ {
public static string GetProjectDirectory(string directoryHint)
{
var repoRoot = SearchUp(AppContext.BaseDirectory, "global.json");
var projectDirectory = Path.Combine(repoRoot, "src", "Razor", directoryHint, "test");
if (!Directory.Exists(projectDirectory) &&
string.Equals(directoryHint, "Microsoft.AspNetCore.Razor.Language.Test", StringComparison.Ordinal))
{
projectDirectory = Path.Combine(repoRoot, "src", "Razor", "Microsoft.AspNetCore.Razor.Language", "test");
}
if (!Directory.Exists(projectDirectory))
{
throw new InvalidOperationException(
$@"Could not locate project directory for directory hint {directoryHint}. Directory probe path: {projectDirectory}.");
}
return projectDirectory;
}
public static string GetProjectDirectory(Type type) public static string GetProjectDirectory(Type type)
{ {
var repoRoot = SearchUp(AppContext.BaseDirectory, "global.json"); var repoRoot = SearchUp(AppContext.BaseDirectory, "global.json");
var assemblyName = type.Assembly.GetName().Name; var assemblyName = type.Assembly.GetName().Name;
var projectDirectory = Path.Combine(repoRoot, "src", "Razor", "test", assemblyName); var projectDirectory = Path.Combine(repoRoot, "src", "Razor", assemblyName, "test");
if (!Directory.Exists(projectDirectory) && if (!Directory.Exists(projectDirectory) &&
string.Equals(assemblyName, "Microsoft.AspNetCore.Razor.Language.Test", StringComparison.Ordinal)) string.Equals(assemblyName, "Microsoft.AspNetCore.Razor.Language.Test", StringComparison.Ordinal))
{ {
projectDirectory = Path.Combine(repoRoot, "src", "Razor", "test", "RazorLanguage.Test"); projectDirectory = Path.Combine(repoRoot, "src", "Razor", "Microsoft.AspNetCore.Razor.Language", "test");
} }
if (!Directory.Exists(projectDirectory)) if (!Directory.Exists(projectDirectory))

View File

@ -8,15 +8,15 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\..\src\Microsoft.AspNetCore.Razor.Language\Microsoft.AspNetCore.Razor.Language.csproj" />
<ProjectReference Include="..\..\src\Microsoft.CodeAnalysis.Razor\Microsoft.CodeAnalysis.Razor.csproj" />
<ProjectReference Include="..\Microsoft.AspNetCore.Razor.Test.ComponentShim\Microsoft.AspNetCore.Razor.Test.ComponentShim.csproj" /> <ProjectReference Include="..\Microsoft.AspNetCore.Razor.Test.ComponentShim\Microsoft.AspNetCore.Razor.Test.ComponentShim.csproj" />
</ItemGroup>
<ItemGroup> <Reference Include="Microsoft.AspNetCore.Razor.Language" />
<PackageReference Include="Microsoft.AspNetCore.Testing" Version="$(MicrosoftAspNetCoreTestingPackageVersion)" /> <Reference Include="Microsoft.CodeAnalysis.Razor" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="$(Runtime_MicrosoftCodeAnalysisCSharpPackageVersion)" /> <Reference Include="Microsoft.CodeAnalysis.CSharp" />
<PackageReference Include="Microsoft.Extensions.DependencyModel" Version="$(MicrosoftExtensionsDependencyModelPackageVersion)" /> <Reference Include="Microsoft.Extensions.DependencyModel" />
<Reference Include="xunit.assert" />
<Reference Include="xunit.extensibility.execution" />
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@ -2,6 +2,7 @@
<PropertyGroup> <PropertyGroup>
<TargetFrameworks>netstandard2.0;net461</TargetFrameworks> <TargetFrameworks>netstandard2.0;net461</TargetFrameworks>
<DisablePubternalApiCheck>true</DisablePubternalApiCheck>
</PropertyGroup> </PropertyGroup>
</Project> </Project>

View File

@ -5,8 +5,8 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="System.Diagnostics.DiagnosticSource" Version="$(SystemDiagnosticsDiagnosticSourcePackageVersion)" /> <Reference Include="System.Diagnostics.DiagnosticSource" />
<PackageReference Include="System.Text.Encodings.Web" Version="$(SystemTextEncodingsWebPackageVersion)" /> <Reference Include="System.Text.Encodings.Web" />
<ProjectReference Include="..\Microsoft.AspNetCore.Razor.Test.ComponentShim\Microsoft.AspNetCore.Razor.Test.ComponentShim.csproj" /> <ProjectReference Include="..\Microsoft.AspNetCore.Razor.Test.ComponentShim\Microsoft.AspNetCore.Razor.Test.ComponentShim.csproj" />
</ItemGroup> </ItemGroup>

View File

@ -6,8 +6,8 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="System.Diagnostics.DiagnosticSource" Version="$(SystemDiagnosticsDiagnosticSourcePackageVersion)" /> <Reference Include="System.Diagnostics.DiagnosticSource" />
<PackageReference Include="System.Text.Encodings.Web" Version="$(SystemTextEncodingsWebPackageVersion)" /> <Reference Include="System.Text.Encodings.Web" />
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@ -6,8 +6,8 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="System.Diagnostics.DiagnosticSource" Version="$(SystemDiagnosticsDiagnosticSourcePackageVersion)" /> <Reference Include="System.Diagnostics.DiagnosticSource" />
<PackageReference Include="System.Text.Encodings.Web" Version="$(SystemTextEncodingsWebPackageVersion)" /> <Reference Include="System.Text.Encodings.Web" />
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@ -6,8 +6,8 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="System.Diagnostics.DiagnosticSource" Version="$(SystemDiagnosticsDiagnosticSourcePackageVersion)" /> <Reference Include="System.Diagnostics.DiagnosticSource" />
<PackageReference Include="System.Text.Encodings.Web" Version="$(SystemTextEncodingsWebPackageVersion)" /> <Reference Include="System.Text.Encodings.Web" />
<ProjectReference Include="..\Microsoft.AspNetCore.Razor.Test.ComponentShim\Microsoft.AspNetCore.Razor.Test.ComponentShim.csproj" /> <ProjectReference Include="..\Microsoft.AspNetCore.Razor.Test.ComponentShim\Microsoft.AspNetCore.Razor.Test.ComponentShim.csproj" />
</ItemGroup> </ItemGroup>

View File

@ -1,9 +1,5 @@
<Project Sdk="Microsoft.NET.Sdk.Web"> <Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<RazorSdkDirectoryRoot>$(RazorSdkArtifactsDirectory)$(Configuration)\sdk-output\</RazorSdkDirectoryRoot>
</PropertyGroup>
<PropertyGroup> <PropertyGroup>
<TargetFramework>$(DefaultNetCoreTargetFramework)</TargetFramework> <TargetFramework>$(DefaultNetCoreTargetFramework)</TargetFramework>
</PropertyGroup> </PropertyGroup>
@ -26,7 +22,7 @@
<PropertyGroup Condition="'$(BinariesRoot)'==''"> <PropertyGroup Condition="'$(BinariesRoot)'==''">
<!-- In test scenarios $(BinariesRoot) is defined in a generated Directory.Build.props file --> <!-- In test scenarios $(BinariesRoot) is defined in a generated Directory.Build.props file -->
<BinariesRoot>$(RepositoryRoot)artifacts\bin\Microsoft.AspNetCore.Razor.Test.MvcShim.ClassLib\$(Configuration)\netstandard2.0\</BinariesRoot> <BinariesRoot>$(RepoRoot)artifacts\bin\Microsoft.AspNetCore.Razor.Test.MvcShim.ClassLib\$(Configuration)\netstandard2.0\</BinariesRoot>
</PropertyGroup> </PropertyGroup>
<ItemGroup Condition="'$(BinariesRoot)'!=''"> <ItemGroup Condition="'$(BinariesRoot)'!=''">

View File

@ -1,12 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk.Web"> <Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<RazorSdkDirectoryRoot>$(RazorSdkArtifactsDirectory)$(Configuration)\sdk-output\</RazorSdkDirectoryRoot>
</PropertyGroup>
<PropertyGroup> <PropertyGroup>
<TargetFramework>$(DefaultNetCoreTargetFramework)</TargetFramework> <TargetFramework>$(DefaultNetCoreTargetFramework)</TargetFramework>
<RuntimeAdditionalRestoreSources Condition="'$(RuntimeAdditionalRestoreSources)'==''">$(MSBuildThisFileDirectory)..\PregeneratedPackages\</RuntimeAdditionalRestoreSources> <RuntimeAdditionalRestoreSources Condition="'$(RuntimeAdditionalRestoreSources)'=='' AND EXISTS('$(MSBuildThisFileDirectory)..\PregeneratedPackages\')">$(MSBuildThisFileDirectory)..\PregeneratedPackages\</RuntimeAdditionalRestoreSources>
<RestoreAdditionalProjectSources>$(RestoreAdditionalProjectSources);$(RuntimeAdditionalRestoreSources)</RestoreAdditionalProjectSources> <RestoreAdditionalProjectSources>$(RestoreAdditionalProjectSources);$(RuntimeAdditionalRestoreSources)</RestoreAdditionalProjectSources>
</PropertyGroup> </PropertyGroup>
@ -32,7 +28,7 @@
<PropertyGroup Condition="'$(BinariesRoot)'==''"> <PropertyGroup Condition="'$(BinariesRoot)'==''">
<!-- In test scenarios $(BinariesRoot) is defined in a generated Directory.Build.props file --> <!-- In test scenarios $(BinariesRoot) is defined in a generated Directory.Build.props file -->
<BinariesRoot>$(RepositoryRoot)artifacts\bin\Microsoft.AspNetCore.Razor.Test.MvcShim.ClassLib\$(Configuration)\netstandard2.0\</BinariesRoot> <BinariesRoot>$(RepoRoot)artifacts\bin\Microsoft.AspNetCore.Razor.Test.MvcShim.ClassLib\$(Configuration)\netstandard2.0\</BinariesRoot>
</PropertyGroup> </PropertyGroup>
<ItemGroup Condition="'$(BinariesRoot)'!=''"> <ItemGroup Condition="'$(BinariesRoot)'!=''">

View File

@ -1,9 +1,5 @@
<Project Sdk="Microsoft.NET.Sdk.Web"> <Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<RazorSdkDirectoryRoot>$(RazorSdkArtifactsDirectory)$(Configuration)\sdk-output\</RazorSdkDirectoryRoot>
</PropertyGroup>
<PropertyGroup> <PropertyGroup>
<TargetFramework>$(DefaultNetCoreTargetFramework)</TargetFramework> <TargetFramework>$(DefaultNetCoreTargetFramework)</TargetFramework>
<RuntimeIdentifier>win-x64</RuntimeIdentifier> <RuntimeIdentifier>win-x64</RuntimeIdentifier>
@ -36,7 +32,7 @@
<PropertyGroup Condition="'$(BinariesRoot)'==''"> <PropertyGroup Condition="'$(BinariesRoot)'==''">
<!-- In test scenarios $(BinariesRoot) is defined in a generated Directory.Build.props file --> <!-- In test scenarios $(BinariesRoot) is defined in a generated Directory.Build.props file -->
<BinariesRoot>$(RepositoryRoot)artifacts\bin\Microsoft.AspNetCore.Razor.Test.MvcShim.ClassLib\$(Configuration)\netstandard2.0\</BinariesRoot> <BinariesRoot>$(RepoRoot)artifacts\bin\Microsoft.AspNetCore.Razor.Test.MvcShim.ClassLib\$(Configuration)\netstandard2.0\</BinariesRoot>
</PropertyGroup> </PropertyGroup>
<ItemGroup Condition="'$(BinariesRoot)'!=''"> <ItemGroup Condition="'$(BinariesRoot)'!=''">

View File

@ -1,9 +1,5 @@
<Project Sdk="Microsoft.NET.Sdk.Razor"> <Project Sdk="Microsoft.NET.Sdk.Razor">
<PropertyGroup>
<RazorSdkDirectoryRoot>$(RazorSdkArtifactsDirectory)$(Configuration)\sdk-output\</RazorSdkDirectoryRoot>
</PropertyGroup>
<PropertyGroup> <PropertyGroup>
<AddRazorSupportForMvc>true</AddRazorSupportForMvc> <AddRazorSupportForMvc>true</AddRazorSupportForMvc>
</PropertyGroup> </PropertyGroup>
@ -23,7 +19,7 @@
<PropertyGroup Condition="'$(BinariesRoot)'==''"> <PropertyGroup Condition="'$(BinariesRoot)'==''">
<!-- In test scenarios $(BinariesRoot) is defined in a generated Directory.Build.props file --> <!-- In test scenarios $(BinariesRoot) is defined in a generated Directory.Build.props file -->
<BinariesRoot>$(RepositoryRoot)artifacts\bin\Microsoft.AspNetCore.Razor.Test.MvcShim.ClassLib\$(Configuration)\netstandard2.0\</BinariesRoot> <BinariesRoot>$(RepoRoot)artifacts\bin\Microsoft.AspNetCore.Razor.Test.MvcShim.ClassLib\$(Configuration)\netstandard2.0\</BinariesRoot>
</PropertyGroup> </PropertyGroup>
<ItemGroup Condition="'$(BinariesRoot)'!=''"> <ItemGroup Condition="'$(BinariesRoot)'!=''">

View File

@ -1,9 +1,5 @@
<Project Sdk="Microsoft.NET.Sdk.Razor"> <Project Sdk="Microsoft.NET.Sdk.Razor">
<PropertyGroup>
<RazorSdkDirectoryRoot>$(RazorSdkArtifactsDirectory)$(Configuration)\sdk-output\</RazorSdkDirectoryRoot>
</PropertyGroup>
<PropertyGroup> <PropertyGroup>
<TargetFramework>$(DefaultNetCoreTargetFramework)</TargetFramework> <TargetFramework>$(DefaultNetCoreTargetFramework)</TargetFramework>
<AddRazorSupportForMvc>true</AddRazorSupportForMvc> <AddRazorSupportForMvc>true</AddRazorSupportForMvc>
@ -20,7 +16,7 @@
<PropertyGroup Condition="'$(BinariesRoot)'==''"> <PropertyGroup Condition="'$(BinariesRoot)'==''">
<!-- In test scenarios $(BinariesRoot) is defined in a generated Directory.Build.props file --> <!-- In test scenarios $(BinariesRoot) is defined in a generated Directory.Build.props file -->
<BinariesRoot>$(RepositoryRoot)artifacts\bin\Microsoft.AspNetCore.Razor.Test.MvcShim.ClassLib\$(Configuration)\netstandard2.0\</BinariesRoot> <BinariesRoot>$(RepoRoot)artifacts\bin\Microsoft.AspNetCore.Razor.Test.MvcShim.ClassLib\$(Configuration)\netstandard2.0\</BinariesRoot>
</PropertyGroup> </PropertyGroup>
<ItemGroup Condition="'$(BinariesRoot)'!=''"> <ItemGroup Condition="'$(BinariesRoot)'!=''">

View File

@ -1,9 +1,5 @@
<Project Sdk="Microsoft.NET.Sdk.Web"> <Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<RazorSdkDirectoryRoot>$(RazorSdkArtifactsDirectory)$(Configuration)\sdk-output\</RazorSdkDirectoryRoot>
</PropertyGroup>
<PropertyGroup> <PropertyGroup>
<TargetFramework>$(DefaultNetCoreTargetFramework)</TargetFramework> <TargetFramework>$(DefaultNetCoreTargetFramework)</TargetFramework>
</PropertyGroup> </PropertyGroup>
@ -20,7 +16,7 @@
<PropertyGroup Condition="'$(BinariesRoot)'==''"> <PropertyGroup Condition="'$(BinariesRoot)'==''">
<!-- In test scenarios $(BinariesRoot) is defined in a generated Directory.Build.props file --> <!-- In test scenarios $(BinariesRoot) is defined in a generated Directory.Build.props file -->
<BinariesRoot>$(RepositoryRoot)artifacts\bin\Microsoft.AspNetCore.Razor.Test.MvcShim.ClassLib\$(Configuration)\netstandard2.0\</BinariesRoot> <BinariesRoot>$(RepoRoot)artifacts\bin\Microsoft.AspNetCore.Razor.Test.MvcShim.ClassLib\$(Configuration)\netstandard2.0\</BinariesRoot>
</PropertyGroup> </PropertyGroup>
<!-- DO NOT add addition references here. This is meant to simulate a non-MVC library --> <!-- DO NOT add addition references here. This is meant to simulate a non-MVC library -->

View File

@ -1,9 +1,5 @@
<Project Sdk="Microsoft.NET.Sdk.Razor"> <Project Sdk="Microsoft.NET.Sdk.Razor">
<PropertyGroup>
<RazorSdkDirectoryRoot>$(RazorSdkArtifactsDirectory)$(Configuration)\sdk-output\</RazorSdkDirectoryRoot>
</PropertyGroup>
<PropertyGroup> <PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework> <TargetFramework>netstandard2.0</TargetFramework>
<RazorLangVersion>3.0</RazorLangVersion> <RazorLangVersion>3.0</RazorLangVersion>
@ -16,7 +12,7 @@
<PropertyGroup Condition="'$(BinariesRoot)'==''"> <PropertyGroup Condition="'$(BinariesRoot)'==''">
<!-- In test scenarios $(BinariesRoot) is defined in a generated Directory.Build.props file --> <!-- In test scenarios $(BinariesRoot) is defined in a generated Directory.Build.props file -->
<BinariesRoot>$(RepositoryRoot)artifacts\bin\Microsoft.AspNetCore.Razor.Test.MvcShim.ClassLib\$(Configuration)\netstandard2.0\</BinariesRoot> <BinariesRoot>$(RepoRoot)artifacts\bin\Microsoft.AspNetCore.Razor.Test.MvcShim.ClassLib\$(Configuration)\netstandard2.0\</BinariesRoot>
</PropertyGroup> </PropertyGroup>
<!-- DO NOT add addition references here. This is meant to simulate a non-MVC library --> <!-- DO NOT add addition references here. This is meant to simulate a non-MVC library -->

View File

@ -2,10 +2,6 @@
<Import Project="Before.Directory.Build.props" Condition="Exists('Before.Directory.Build.props')" /> <Import Project="Before.Directory.Build.props" Condition="Exists('Before.Directory.Build.props')" />
<PropertyGroup> <PropertyGroup>
<SolutionRoot Condition="'$(SolutionRoot)' == ''">$(MSBuildThisFileDirectory)..\..\</SolutionRoot>
<SolutionRoot>$([MSBuild]::EnsureTrailingSlash('$(SolutionRoot)'))</SolutionRoot>
<RepositoryRoot>$(SolutionRoot)..\..\</RepositoryRoot>
<!-- <!--
In the case that a user is building a sample directly the MicrosoftNetCompilersToolsetPackagerVersion will not be provided. In the case that a user is building a sample directly the MicrosoftNetCompilersToolsetPackagerVersion will not be provided.
We'll fall back to whatever the current SDK provides in regards to Roslyn's Microsoft.Net.Compilers.Toolset. We'll fall back to whatever the current SDK provides in regards to Roslyn's Microsoft.Net.Compilers.Toolset.
@ -13,16 +9,18 @@
<BuildingTestAppsIndependently>false</BuildingTestAppsIndependently> <BuildingTestAppsIndependently>false</BuildingTestAppsIndependently>
<BuildingTestAppsIndependently Condition="'$(MicrosoftNetCompilersToolsetPackageVersion)' == ''">true</BuildingTestAppsIndependently> <BuildingTestAppsIndependently Condition="'$(MicrosoftNetCompilersToolsetPackageVersion)' == ''">true</BuildingTestAppsIndependently>
<!-- Retarget tests to use the copy of the Sdk from source --> <!-- Do not resolve Reference ItemGroup since it has a different semantic meaning in Razor test apps -->
<RazorSdkArtifactsDirectory>$(SolutionRoot)..\..\artifacts\bin\Microsoft.NET.Sdk.Razor\</RazorSdkArtifactsDirectory> <EnableCustomReferenceResolution>false</EnableCustomReferenceResolution>
<RazorSdkCurrentVersionProps>$(SolutionRoot)src\Microsoft.NET.Sdk.Razor\build\netstandard2.0\Sdk.Razor.CurrentVersion.props</RazorSdkCurrentVersionProps> <DefaultNetCoreTargetFramework>net5.0</DefaultNetCoreTargetFramework>
<RazorSdkCurrentVersionTargets>$(SolutionRoot)src\Microsoft.NET.Sdk.Razor\build\netstandard2.0\Sdk.Razor.CurrentVersion.targets</RazorSdkCurrentVersionTargets>
</PropertyGroup> </PropertyGroup>
<Import Project="$(SolutionRoot)..\..\eng\Versions.props" /> <Import Project="$(RepoRoot)eng\Versions.props" />
<PropertyGroup> <PropertyGroup>
<!-- Reset version prefix to 1.0.0 for test projects -->
<VersionPrefix>1.0.0</VersionPrefix>
<!-- Working around an issue in XDT transforms --> <!-- Working around an issue in XDT transforms -->
<AspNetCoreHostingModel>OutOfProcess</AspNetCoreHostingModel> <AspNetCoreHostingModel>OutOfProcess</AspNetCoreHostingModel>
@ -40,13 +38,14 @@
<_MvcAssemblyName Include="Microsoft.AspNetCore.Razor.Test.MvcShim.ClassLib" /> <_MvcAssemblyName Include="Microsoft.AspNetCore.Razor.Test.MvcShim.ClassLib" />
</ItemGroup> </ItemGroup>
<ItemGroup Condition="$(BuildingTestAppsIndependently) == false"> <ItemGroup Condition="$(BuildingTestAppsIndependently) == 'false'">
<PackageReference Include="Microsoft.Net.Compilers.Toolset" <PackageReference Include="Microsoft.Net.Compilers.Toolset"
Version="$(MicrosoftNetCompilersToolsetPackageVersion)" Version="$(MicrosoftNetCompilersToolsetPackageVersion)"
PrivateAssets="all" PrivateAssets="all"
IsImplicitlyDefined="true" /> IsImplicitlyDefined="true" />
</ItemGroup> </ItemGroup>
<Import Project="$(RepoRoot)src\Razor\Microsoft.NET.Sdk.Razor\src\build\netstandard2.0\Microsoft.NET.Sdk.Razor.props" />
<Import Project="After.Directory.Build.props" Condition="Exists('After.Directory.Build.props')" /> <Import Project="After.Directory.Build.props" Condition="Exists('After.Directory.Build.props')" />
</Project> </Project>

View File

@ -2,7 +2,7 @@
<Import Project="RazorTest.Introspection.targets" /> <Import Project="RazorTest.Introspection.targets" />
<PropertyGroup> <PropertyGroup>
<RuntimeFrameworkVersion Condition=" '$(TargetFramework)' == '$(DefaultNetCoreTargetFramework)' ">$(MicrosoftNETCoreApp50PackageVersion)</RuntimeFrameworkVersion> <RuntimeFrameworkVersion Condition=" '$(TargetFramework)' == '$(DefaultNetCoreTargetFramework)' ">$(MicrosoftNETCoreAppRuntimeVersion)</RuntimeFrameworkVersion>
<!-- aspnet/BuildTools#662 Don't police what version of NetCoreApp we use --> <!-- aspnet/BuildTools#662 Don't police what version of NetCoreApp we use -->
<NETCoreAppMaximumVersion>99.9</NETCoreAppMaximumVersion> <NETCoreAppMaximumVersion>99.9</NETCoreAppMaximumVersion>
</PropertyGroup> </PropertyGroup>

View File

@ -1,9 +1,5 @@
<Project Sdk="Microsoft.NET.Sdk.Web"> <Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<RazorSdkDirectoryRoot>$(RazorSdkArtifactsDirectory)$(Configuration)\sdk-output\</RazorSdkDirectoryRoot>
</PropertyGroup>
<!-- <!--
The AspNetCore repo depends on AspNetCore-Tooling, and we want to avoid creating a cylical dependency between the two The AspNetCore repo depends on AspNetCore-Tooling, and we want to avoid creating a cylical dependency between the two
by adding a reference to Microsoft.AspNetCore.App. We'll instead simulate the presence of the reference. by adding a reference to Microsoft.AspNetCore.App. We'll instead simulate the presence of the reference.
@ -27,7 +23,7 @@
<PropertyGroup Condition="'$(BinariesRoot)'==''"> <PropertyGroup Condition="'$(BinariesRoot)'==''">
<!-- In test scenarios $(BinariesRoot) is defined in a generated Directory.Build.props file --> <!-- In test scenarios $(BinariesRoot) is defined in a generated Directory.Build.props file -->
<BinariesRoot>$(RepositoryRoot)artifacts\bin\Microsoft.AspNetCore.Razor.Test.MvcShim.ClassLib\$(Configuration)\netstandard2.0\</BinariesRoot> <BinariesRoot>$(RepoRoot)artifacts\bin\Microsoft.AspNetCore.Razor.Test.MvcShim.ClassLib\$(Configuration)\netstandard2.0\</BinariesRoot>
</PropertyGroup> </PropertyGroup>
<ItemGroup Condition="'$(BinariesRoot)'!=''"> <ItemGroup Condition="'$(BinariesRoot)'!=''">

View File

@ -1,9 +1,5 @@
<Project Sdk="Microsoft.NET.Sdk.Web"> <Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<RazorSdkDirectoryRoot>$(RazorSdkArtifactsDirectory)$(Configuration)\sdk-output\</RazorSdkDirectoryRoot>
</PropertyGroup>
<PropertyGroup> <PropertyGroup>
<TargetFramework>$(DefaultNetCoreTargetFramework)</TargetFramework> <TargetFramework>$(DefaultNetCoreTargetFramework)</TargetFramework>
</PropertyGroup> </PropertyGroup>
@ -20,7 +16,7 @@
<PropertyGroup Condition="'$(BinariesRoot)'==''"> <PropertyGroup Condition="'$(BinariesRoot)'==''">
<!-- In test scenarios $(BinariesRoot) is defined in a generated Directory.Build.props file --> <!-- In test scenarios $(BinariesRoot) is defined in a generated Directory.Build.props file -->
<BinariesRoot>$(RepositoryRoot)artifacts\bin\Microsoft.AspNetCore.Razor.Test.MvcShim.ClassLib\$(Configuration)\netstandard2.0\</BinariesRoot> <BinariesRoot>$(RepoRoot)artifacts\bin\Microsoft.AspNetCore.Razor.Test.MvcShim.ClassLib\$(Configuration)\netstandard2.0\</BinariesRoot>
</PropertyGroup> </PropertyGroup>
<ItemGroup Condition="'$(BinariesRoot)'!=''"> <ItemGroup Condition="'$(BinariesRoot)'!=''">

View File

@ -1,9 +1,5 @@
<Project Sdk="Microsoft.NET.Sdk.Razor"> <Project Sdk="Microsoft.NET.Sdk.Razor">
<PropertyGroup>
<RazorSdkDirectoryRoot>$(RazorSdkArtifactsDirectory)$(Configuration)\sdk-output\</RazorSdkDirectoryRoot>
</PropertyGroup>
<PropertyGroup> <PropertyGroup>
<AddRazorSupportForMvc>true</AddRazorSupportForMvc> <AddRazorSupportForMvc>true</AddRazorSupportForMvc>
</PropertyGroup> </PropertyGroup>
@ -25,7 +21,7 @@
<PropertyGroup Condition="'$(BinariesRoot)'==''"> <PropertyGroup Condition="'$(BinariesRoot)'==''">
<!-- In test scenarios $(BinariesRoot) is defined in a generated Directory.Build.props file --> <!-- In test scenarios $(BinariesRoot) is defined in a generated Directory.Build.props file -->
<BinariesRoot>$(RepositoryRoot)artifacts\bin\Microsoft.AspNetCore.Razor.Test.MvcShim.ClassLib\$(Configuration)\netstandard2.0\</BinariesRoot> <BinariesRoot>$(RepoRoot)artifacts\bin\Microsoft.AspNetCore.Razor.Test.MvcShim.ClassLib\$(Configuration)\netstandard2.0\</BinariesRoot>
</PropertyGroup> </PropertyGroup>
<ItemGroup Condition="'$(BinariesRoot)'!=''"> <ItemGroup Condition="'$(BinariesRoot)'!=''">

View File

@ -1,9 +1,5 @@
<Project Sdk="Microsoft.NET.Sdk.Razor"> <Project Sdk="Microsoft.NET.Sdk.Razor">
<PropertyGroup>
<RazorSdkDirectoryRoot>$(RazorSdkArtifactsDirectory)$(Configuration)\sdk-output\</RazorSdkDirectoryRoot>
</PropertyGroup>
<PropertyGroup> <PropertyGroup>
<AddRazorSupportForMvc>true</AddRazorSupportForMvc> <AddRazorSupportForMvc>true</AddRazorSupportForMvc>
<RazorLangVersion>3.0</RazorLangVersion> <RazorLangVersion>3.0</RazorLangVersion>
@ -26,7 +22,7 @@
<PropertyGroup Condition="'$(BinariesRoot)'==''"> <PropertyGroup Condition="'$(BinariesRoot)'==''">
<!-- In test scenarios $(BinariesRoot) is defined in a generated Directory.Build.props file --> <!-- In test scenarios $(BinariesRoot) is defined in a generated Directory.Build.props file -->
<BinariesRoot>$(RepositoryRoot)artifacts\bin\Microsoft.AspNetCore.Razor.Test.MvcShim.ClassLib\$(Configuration)\netstandard2.0\</BinariesRoot> <BinariesRoot>$(RepoRoot)artifacts\bin\Microsoft.AspNetCore.Razor.Test.MvcShim.ClassLib\$(Configuration)\netstandard2.0\</BinariesRoot>
</PropertyGroup> </PropertyGroup>
<ItemGroup Condition="'$(BinariesRoot)'!=''"> <ItemGroup Condition="'$(BinariesRoot)'!=''">

View File

@ -1,9 +1,5 @@
<Project Sdk="Microsoft.NET.Sdk.Web"> <Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<RazorSdkDirectoryRoot>$(RazorSdkArtifactsDirectory)$(Configuration)\sdk-output\</RazorSdkDirectoryRoot>
</PropertyGroup>
<PropertyGroup> <PropertyGroup>
<TargetFramework>$(DefaultNetCoreTargetFramework)</TargetFramework> <TargetFramework>$(DefaultNetCoreTargetFramework)</TargetFramework>
</PropertyGroup> </PropertyGroup>
@ -20,7 +16,7 @@
<PropertyGroup Condition="'$(BinariesRoot)'==''"> <PropertyGroup Condition="'$(BinariesRoot)'==''">
<!-- In test scenarios $(BinariesRoot) is defined in a generated Directory.Build.props file --> <!-- In test scenarios $(BinariesRoot) is defined in a generated Directory.Build.props file -->
<BinariesRoot>$(RepositoryRoot)artifacts\bin\Microsoft.AspNetCore.Razor.Test.MvcShim.ClassLib\$(Configuration)\netstandard2.0\</BinariesRoot> <BinariesRoot>$(RepoRoot)artifacts\bin\Microsoft.AspNetCore.Razor.Test.MvcShim.ClassLib\$(Configuration)\netstandard2.0\</BinariesRoot>
</PropertyGroup> </PropertyGroup>
<ItemGroup Condition="'$(BinariesRoot)'!=''"> <ItemGroup Condition="'$(BinariesRoot)'!=''">

View File

@ -3,9 +3,6 @@
<!-- <!--
This project references a shipped version of MVC. It will reference the local build of Tasks but not the compiler or any test shims. This project references a shipped version of MVC. It will reference the local build of Tasks but not the compiler or any test shims.
--> -->
<PropertyGroup>
<RazorSdkDirectoryRoot>$(RazorSdkArtifactsDirectory)$(Configuration)\sdk-output\</RazorSdkDirectoryRoot>
</PropertyGroup>
<PropertyGroup> <PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework> <TargetFramework>netcoreapp2.2</TargetFramework>

View File

@ -3,9 +3,6 @@
<!-- <!--
This project references a shipped version of MVC. It will reference the local build of Tasks but not the compiler or any test shims. This project references a shipped version of MVC. It will reference the local build of Tasks but not the compiler or any test shims.
--> -->
<PropertyGroup>
<RazorSdkDirectoryRoot>$(RazorSdkArtifactsDirectory)$(Configuration)\sdk-output\</RazorSdkDirectoryRoot>
</PropertyGroup>
<PropertyGroup> <PropertyGroup>
<TargetFramework>net461</TargetFramework> <TargetFramework>net461</TargetFramework>

View File

@ -1,9 +1,5 @@
<Project Sdk="Microsoft.NET.Sdk.Web"> <Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<RazorSdkDirectoryRoot>$(RazorSdkArtifactsDirectory)$(Configuration)\sdk-output\</RazorSdkDirectoryRoot>
</PropertyGroup>
<PropertyGroup> <PropertyGroup>
<TargetFramework>$(DefaultNetCoreTargetFramework)</TargetFramework> <TargetFramework>$(DefaultNetCoreTargetFramework)</TargetFramework>
</PropertyGroup> </PropertyGroup>
@ -25,7 +21,7 @@
<PropertyGroup Condition="'$(BinariesRoot)'==''"> <PropertyGroup Condition="'$(BinariesRoot)'==''">
<!-- In test scenarios $(BinariesRoot) is defined in a generated Directory.Build.props file --> <!-- In test scenarios $(BinariesRoot) is defined in a generated Directory.Build.props file -->
<BinariesRoot>$(RepositoryRoot)artifacts\bin\Microsoft.AspNetCore.Razor.Test.MvcShim.ClassLib\$(Configuration)\netstandard2.0\</BinariesRoot> <BinariesRoot>$(RepoRoot)artifacts\bin\Microsoft.AspNetCore.Razor.Test.MvcShim.ClassLib\$(Configuration)\netstandard2.0\</BinariesRoot>
</PropertyGroup> </PropertyGroup>
<ItemGroup Condition="'$(BinariesRoot)'!=''"> <ItemGroup Condition="'$(BinariesRoot)'!=''">

View File

@ -1,9 +1,5 @@
<Project Sdk="Microsoft.NET.Sdk.Web"> <Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<RazorSdkDirectoryRoot>$(RazorSdkArtifactsDirectory)$(Configuration)\sdk-output\</RazorSdkDirectoryRoot>
</PropertyGroup>
<PropertyGroup> <PropertyGroup>
<TargetFramework>$(DefaultNetCoreTargetFramework)</TargetFramework> <TargetFramework>$(DefaultNetCoreTargetFramework)</TargetFramework>
</PropertyGroup> </PropertyGroup>
@ -20,7 +16,7 @@
<PropertyGroup Condition="'$(BinariesRoot)'==''"> <PropertyGroup Condition="'$(BinariesRoot)'==''">
<!-- In test scenarios $(BinariesRoot) is defined in a generated Directory.Build.props file --> <!-- In test scenarios $(BinariesRoot) is defined in a generated Directory.Build.props file -->
<BinariesRoot>$(RepositoryRoot)artifacts\bin\Microsoft.AspNetCore.Razor.Test.MvcShim.ClassLib\$(Configuration)\netstandard2.0\</BinariesRoot> <BinariesRoot>$(RepoRoot)artifacts\bin\Microsoft.AspNetCore.Razor.Test.MvcShim.ClassLib\$(Configuration)\netstandard2.0\</BinariesRoot>
</PropertyGroup> </PropertyGroup>
<ItemGroup Condition="'$(BinariesRoot)'!=''"> <ItemGroup Condition="'$(BinariesRoot)'!=''">