automated: merge branch release/2.2

This commit is contained in:
Nate McMaster 2018-09-28 17:27:35 -07:00
commit ada2b17160
No known key found for this signature in database
GPG Key ID: A778D9601BD78810
43 changed files with 2076 additions and 196 deletions

View File

@ -14,10 +14,7 @@
<RepositoryRoot>$(MSBuildThisFileDirectory)</RepositoryRoot>
<AssemblyOriginatorKeyFile>$(MSBuildThisFileDirectory)build\Key.snk</AssemblyOriginatorKeyFile>
<SignAssembly>true</SignAssembly>
<PackageSigningCertName>MicrosoftNuGet</PackageSigningCertName>
<PublicSign Condition="'$(OS)' != 'Windows_NT'">true</PublicSign>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<AssemblySigningCertName>Microsoft</AssemblySigningCertName>
<LangVersion>7.3</LangVersion>
</PropertyGroup>

View File

@ -81,8 +81,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.Razor.
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.Razor.Design.Test", "test\Microsoft.AspNetCore.Razor.Design.Test\Microsoft.AspNetCore.Razor.Design.Test.csproj", "{1D90F276-E1CA-4FDF-A173-EB889E7D3150}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.Razor.Tasks", "src\Microsoft.AspNetCore.Razor.Tasks\Microsoft.AspNetCore.Razor.Tasks.csproj", "{043B9497-C0BA-4770-9210-4456D2F81CE0}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.Razor.Test", "test\Microsoft.AspNetCore.Razor.Test\Microsoft.AspNetCore.Razor.Test.csproj", "{323553F0-14AB-4FBD-9CF0-1CC0BE8056F8}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.Razor.Performance", "benchmarks\Microsoft.AspNetCore.Razor.Performance\Microsoft.AspNetCore.Razor.Performance.csproj", "{6205467F-E381-4C42-AEEC-763BD62B3D5E}"
@ -345,14 +343,6 @@ Global
{1D90F276-E1CA-4FDF-A173-EB889E7D3150}.Release|Any CPU.Build.0 = Release|Any CPU
{1D90F276-E1CA-4FDF-A173-EB889E7D3150}.ReleaseNoVSIX|Any CPU.ActiveCfg = Release|Any CPU
{1D90F276-E1CA-4FDF-A173-EB889E7D3150}.ReleaseNoVSIX|Any CPU.Build.0 = Release|Any CPU
{043B9497-C0BA-4770-9210-4456D2F81CE0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{043B9497-C0BA-4770-9210-4456D2F81CE0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{043B9497-C0BA-4770-9210-4456D2F81CE0}.DebugNoVSIX|Any CPU.ActiveCfg = Debug|Any CPU
{043B9497-C0BA-4770-9210-4456D2F81CE0}.DebugNoVSIX|Any CPU.Build.0 = Debug|Any CPU
{043B9497-C0BA-4770-9210-4456D2F81CE0}.Release|Any CPU.ActiveCfg = Release|Any CPU
{043B9497-C0BA-4770-9210-4456D2F81CE0}.Release|Any CPU.Build.0 = Release|Any CPU
{043B9497-C0BA-4770-9210-4456D2F81CE0}.ReleaseNoVSIX|Any CPU.ActiveCfg = Release|Any CPU
{043B9497-C0BA-4770-9210-4456D2F81CE0}.ReleaseNoVSIX|Any CPU.Build.0 = Release|Any CPU
{323553F0-14AB-4FBD-9CF0-1CC0BE8056F8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{323553F0-14AB-4FBD-9CF0-1CC0BE8056F8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{323553F0-14AB-4FBD-9CF0-1CC0BE8056F8}.DebugNoVSIX|Any CPU.ActiveCfg = Debug|Any CPU
@ -391,8 +381,8 @@ Global
{7D9ECCEE-71D1-4A42-ABEE-876AFA1B4FC9}.DebugNoVSIX|Any CPU.Build.0 = Debug|Any CPU
{7D9ECCEE-71D1-4A42-ABEE-876AFA1B4FC9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7D9ECCEE-71D1-4A42-ABEE-876AFA1B4FC9}.Release|Any CPU.Build.0 = Release|Any CPU
{7D9ECCEE-71D1-4A42-ABEE-876AFA1B4FC9}.ReleaseNoVSIX|Any CPU.ActiveCfg = Debug|Any CPU
{7D9ECCEE-71D1-4A42-ABEE-876AFA1B4FC9}.ReleaseNoVSIX|Any CPU.Build.0 = Debug|Any CPU
{7D9ECCEE-71D1-4A42-ABEE-876AFA1B4FC9}.ReleaseNoVSIX|Any CPU.ActiveCfg = Release|Any CPU
{7D9ECCEE-71D1-4A42-ABEE-876AFA1B4FC9}.ReleaseNoVSIX|Any CPU.Build.0 = Release|Any CPU
{6EA56B2B-89EC-4C38-A384-97D203375B06}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6EA56B2B-89EC-4C38-A384-97D203375B06}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6EA56B2B-89EC-4C38-A384-97D203375B06}.DebugNoVSIX|Any CPU.ActiveCfg = Debug|Any CPU
@ -444,7 +434,6 @@ Global
{B8A3E4CA-D54A-441F-A3BF-E00F060CA042} = {92463391-81BE-462B-AC3C-78C6C760741F}
{5257B25D-330A-4DCF-ACED-B4709CFBF916} = {3C0D6505-79B3-49D0-B4C3-176F0F1836ED}
{1D90F276-E1CA-4FDF-A173-EB889E7D3150} = {92463391-81BE-462B-AC3C-78C6C760741F}
{043B9497-C0BA-4770-9210-4456D2F81CE0} = {3C0D6505-79B3-49D0-B4C3-176F0F1836ED}
{323553F0-14AB-4FBD-9CF0-1CC0BE8056F8} = {92463391-81BE-462B-AC3C-78C6C760741F}
{6205467F-E381-4C42-AEEC-763BD62B3D5E} = {C2C98051-0F39-47F2-80B6-E72B29159F2C}
{933101DA-C4CC-401A-AA01-2784E1025B7F} = {92463391-81BE-462B-AC3C-78C6C760741F}

View File

@ -43,6 +43,7 @@
</ArtifactInfo>
<FilesToSign Include="$(VSIXOutputPath)" Certificate="Vsix" />
<FilesToSign Include="$(RepositoryRoot)tooling/Microsoft.VisualStudio.RazorExtension/bin/$(Configuration)/Microsoft.VisualStudio.RazorExtension.dll" Certificate="Microsoft" />
<FilesToExcludeFromSigning Include="$(VSIXManifestOutputPath)" />
<FilesToExcludeFromSigning Include="$(VSIXSymbolsOutputPath)" />

8
run.sh
View File

@ -220,7 +220,7 @@ if [ -f "$config_file" ]; then
config_channel="$(jq -r 'select(.channel!=null) | .channel' "$config_file")"
config_tools_source="$(jq -r 'select(.toolsSource!=null) | .toolsSource' "$config_file")"
else
_error "$config_file contains invalid JSON."
__error "$config_file contains invalid JSON."
exit 1
fi
elif __machine_has python ; then
@ -228,7 +228,7 @@ if [ -f "$config_file" ]; then
config_channel="$(python -c "import json,codecs;obj=json.load(codecs.open('$config_file', 'r', 'utf-8-sig'));print(obj['channel'] if 'channel' in obj else '')")"
config_tools_source="$(python -c "import json,codecs;obj=json.load(codecs.open('$config_file', 'r', 'utf-8-sig'));print(obj['toolsSource'] if 'toolsSource' in obj else '')")"
else
_error "$config_file contains invalid JSON."
__error "$config_file contains invalid JSON."
exit 1
fi
elif __machine_has python3 ; then
@ -236,11 +236,11 @@ if [ -f "$config_file" ]; then
config_channel="$(python3 -c "import json,codecs;obj=json.load(codecs.open('$config_file', 'r', 'utf-8-sig'));print(obj['channel'] if 'channel' in obj else '')")"
config_tools_source="$(python3 -c "import json,codecs;obj=json.load(codecs.open('$config_file', 'r', 'utf-8-sig'));print(obj['toolsSource'] if 'toolsSource' in obj else '')")"
else
_error "$config_file contains invalid JSON."
__error "$config_file contains invalid JSON."
exit 1
fi
else
_error 'Missing required command: jq or python. Could not parse the JSON file.'
__error 'Missing required command: jq or python. Could not parse the JSON file.'
exit 1
fi

View File

@ -27,8 +27,16 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Extensions.Version1_X
return;
}
var vcAttribute = compilation.GetTypeByMetadataName(ViewComponentTypes.ViewComponentAttribute);
var nonVCAttribute = compilation.GetTypeByMetadataName(ViewComponentTypes.NonViewComponentAttribute);
if (vcAttribute == null || vcAttribute.TypeKind == TypeKind.Error)
{
// Could not find attributes we care about in the compilation. Nothing to do.
return;
}
var types = new List<INamedTypeSymbol>();
var visitor = ViewComponentTypeVisitor.Create(compilation, types);
var visitor = new ViewComponentTypeVisitor(vcAttribute, nonVCAttribute, types);
// We always visit the global namespace.
visitor.Visit(compilation.Assembly.GlobalNamespace);

View File

@ -16,13 +16,6 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Extensions.Version1_X
private readonly INamedTypeSymbol _nonViewComponentAttribute;
private readonly List<INamedTypeSymbol> _results;
public static ViewComponentTypeVisitor Create(Compilation compilation, List<INamedTypeSymbol> results)
{
var vcAttribute = compilation.GetTypeByMetadataName(ViewComponentTypes.ViewComponentAttribute);
var nonVCAttribute = compilation.GetTypeByMetadataName(ViewComponentTypes.NonViewComponentAttribute);
return new ViewComponentTypeVisitor(vcAttribute, nonVCAttribute, results);
}
public ViewComponentTypeVisitor(
INamedTypeSymbol viewComponentAttribute,
INamedTypeSymbol nonViewComponentAttribute,
@ -31,12 +24,8 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Extensions.Version1_X
_viewComponentAttribute = viewComponentAttribute;
_nonViewComponentAttribute = nonViewComponentAttribute;
_results = results;
Enabled = _viewComponentAttribute != null;
}
public bool Enabled { get; set; }
public override void VisitNamedType(INamedTypeSymbol symbol)
{
if (IsViewComponent(symbol))
@ -65,11 +54,6 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Extensions.Version1_X
internal bool IsViewComponent(INamedTypeSymbol symbol)
{
if (!Enabled)
{
return false;
}
if (symbol.DeclaredAccessibility != Accessibility.Public ||
symbol.IsAbstract ||
symbol.IsGenericType ||

View File

@ -59,7 +59,7 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Extensions
var descriptorBuilder = TagHelperDescriptorBuilder.Create(ViewComponentTagHelperConventions.Kind, typeName, assemblyName);
descriptorBuilder.SetTypeName(typeName);
descriptorBuilder.DisplayName = displayName;
if (TryFindInvokeMethod(type, out var method, out var diagnostic))
{
var methodParameters = method.Parameters;
@ -84,21 +84,15 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Extensions
private bool TryFindInvokeMethod(INamedTypeSymbol type, out IMethodSymbol method, out RazorDiagnostic diagnostic)
{
var methods = type.GetMembers()
.OfType<IMethodSymbol>()
.Where(m =>
m.DeclaredAccessibility == Accessibility.Public &&
(string.Equals(m.Name, ViewComponentTypes.AsyncMethodName, StringComparison.Ordinal) ||
string.Equals(m.Name, ViewComponentTypes.SyncMethodName, StringComparison.Ordinal)))
.ToArray();
var methods = GetInvokeMethods(type);
if (methods.Length == 0)
if (methods.Count == 0)
{
diagnostic = RazorExtensionsDiagnosticFactory.CreateViewComponent_CannotFindMethod(type.ToDisplayString(FullNameTypeDisplayFormat));
diagnostic = RazorExtensionsDiagnosticFactory.CreateViewComponent_CannotFindMethod(type.ToDisplayString(FullNameTypeDisplayFormat));
method = null;
return false;
}
else if (methods.Length > 1)
else if (methods.Count > 1)
{
diagnostic = RazorExtensionsDiagnosticFactory.CreateViewComponent_AmbiguousMethods(type.ToDisplayString(FullNameTypeDisplayFormat));
method = null;
@ -153,6 +147,27 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Extensions
return true;
}
private static IReadOnlyList<IMethodSymbol> GetInvokeMethods(INamedTypeSymbol type)
{
var methods = new List<IMethodSymbol>();
while (type != null)
{
var currentTypeMethods = type.GetMembers()
.OfType<IMethodSymbol>()
.Where(m =>
m.DeclaredAccessibility == Accessibility.Public &&
!m.IsStatic &&
(string.Equals(m.Name, ViewComponentTypes.AsyncMethodName, StringComparison.Ordinal) ||
string.Equals(m.Name, ViewComponentTypes.SyncMethodName, StringComparison.Ordinal)));
methods.AddRange(currentTypeMethods);
type = type.BaseType;
}
return methods;
}
private void AddRequiredAttributes(ImmutableArray<IParameterSymbol> methodParameters, TagMatchingRuleDescriptorBuilder builder)
{
foreach (var parameter in methodParameters)
@ -164,7 +179,7 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Extensions
builder.Attribute(attributeBuilder =>
{
var lowerKebabName = HtmlConventions.ToHtmlCase(parameter.Name);
attributeBuilder.Name =lowerKebabName;
attributeBuilder.Name = lowerKebabName;
});
}
}

View File

@ -27,8 +27,16 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Extensions
return;
}
var vcAttribute = compilation.GetTypeByMetadataName(ViewComponentTypes.ViewComponentAttribute);
var nonVCAttribute = compilation.GetTypeByMetadataName(ViewComponentTypes.NonViewComponentAttribute);
if (vcAttribute == null || vcAttribute.TypeKind == TypeKind.Error)
{
// Could not find attributes we care about in the compilation. Nothing to do.
return;
}
var types = new List<INamedTypeSymbol>();
var visitor = ViewComponentTypeVisitor.Create(compilation, types);
var visitor = new ViewComponentTypeVisitor(vcAttribute, nonVCAttribute, types);
// We always visit the global namespace.
visitor.Visit(compilation.Assembly.GlobalNamespace);

View File

@ -13,13 +13,6 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Extensions
private readonly INamedTypeSymbol _nonViewComponentAttribute;
private readonly List<INamedTypeSymbol> _results;
public static ViewComponentTypeVisitor Create(Compilation compilation, List<INamedTypeSymbol> results)
{
var vcAttribute = compilation.GetTypeByMetadataName(ViewComponentTypes.ViewComponentAttribute);
var nonVCAttribute = compilation.GetTypeByMetadataName(ViewComponentTypes.NonViewComponentAttribute);
return new ViewComponentTypeVisitor(vcAttribute, nonVCAttribute, results);
}
public ViewComponentTypeVisitor(
INamedTypeSymbol viewComponentAttribute,
INamedTypeSymbol nonViewComponentAttribute,

View File

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Description>Razor is a markup syntax for adding server-side logic to web pages. This package contains MSBuild support for Razor.</Description>
<TargetFrameworks>netcoreapp2.0;net46</TargetFrameworks>
<TargetFrameworks>netcoreapp2.0</TargetFrameworks>
<!-- This project doesn't have any code, so don't include it in the .nupkg -->
<IncludeBuildOutput>false</IncludeBuildOutput>
@ -12,7 +12,7 @@
</PropertyGroup>
<!--
Building this package is somewhat complicated because we need to Build or Publish some other projects
Building this package is somewhat complicated because we need to Publish some other projects
that have different TFM's including one with multiple TFMs.
We then need to include the output of those projects in our output directory (where it will be used
@ -22,30 +22,24 @@
<PropertyGroup>
<ToolProject>..\Microsoft.AspNetCore.Razor.Tools\Microsoft.AspNetCore.Razor.Tools.csproj</ToolProject>
<TaskProject>Microsoft.AspNetCore.Razor.Tasks</TaskProject>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\$(TaskProject)\$(TaskProject).csproj" ReferenceOutputAssembly="false" />
<ProjectReference Include="$(ToolProject)" ReferenceOutputAssembly="false" Condition="'$(TargetFramework)' == 'netcoreapp2.0'" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)'==''">
<!-- Binaries produced in this project -->
<SignedPackageFile Include="tools/rzc.dll" Certificate="$(AssemblySigningCertName)" />
<SignedPackageFile Include="tasks/net46/Microsoft.AspNetCore.Razor.Tasks.dll" Certificate="$(AssemblySigningCertName)" />
<SignedPackageFile Include="tasks/netstandard2.0/Microsoft.AspNetCore.Razor.Tasks.dll" Certificate="$(AssemblySigningCertName)" />
<SignedPackageFile Include="tools/Microsoft.AspNetCore.Razor.Language.dll" Certificate="$(AssemblySigningCertName)" />
<SignedPackageFile Include="tools/Microsoft.CodeAnalysis.Razor.dll" Certificate="$(AssemblySigningCertName)" />
<SignedPackageFile Include="$(MSBuildProjectDirectory)\$(OutputPath)\tools/rzc.dll" Certificate="$(AssemblySigningCertName)" />
<!-- Third-party assemblies -->
<SignedPackageFile Include="tools/Newtonsoft.Json.dll" Certificate="3PartyDual" />
<SignedPackageFile Include="$(MSBuildProjectDirectory)\$(OutputPath)\tools/Newtonsoft.Json.dll" Certificate="3PartyDual" />
<!-- Binaries that should be signed by corefx/roslyn -->
<ExcludePackageFileFromSigning Include="tools/Microsoft.CodeAnalysis.CSharp.dll" />
<ExcludePackageFileFromSigning Include="tools/Microsoft.CodeAnalysis.dll" />
<ExcludePackageFileFromSigning Include="tools/runtimes/unix/lib/netstandard1.3/System.Text.Encoding.CodePages.dll" />
<ExcludePackageFileFromSigning Include="tools/runtimes/win/lib/netstandard1.3/System.Text.Encoding.CodePages.dll" />
<ExcludePackageFileFromSigning Include="$(MSBuildProjectDirectory)\$(OutputPath)\tools/Microsoft.CodeAnalysis.CSharp.dll" />
<ExcludePackageFileFromSigning Include="$(MSBuildProjectDirectory)\$(OutputPath)\tools/Microsoft.CodeAnalysis.dll" />
<ExcludePackageFileFromSigning Include="$(MSBuildProjectDirectory)\$(OutputPath)\tools/runtimes/unix/lib/netstandard1.3/System.Text.Encoding.CodePages.dll" />
<ExcludePackageFileFromSigning Include="$(MSBuildProjectDirectory)\$(OutputPath)\tools/runtimes/win/lib/netstandard1.3/System.Text.Encoding.CodePages.dll" />
</ItemGroup>
<Target Name="PopulateNuspec" BeforeTargets="GenerateNuspec">
@ -70,19 +64,13 @@
repositoryCommit=$(RepositoryCommit);
copyright=$(Copyright);
<!-- Include the assembly and symbols from the tasks project -->
TaskAssemblyNet46=$(OutputPath)tasks\net46\$(TaskProject).dll;
TaskSymbolNet46=$(OutputPath)tasks\net46\$(TaskProject).pdb;
TaskAssemblyNetStandard=$(OutputPath)tasks\netstandard2.0\$(TaskProject).dll;
TaskSymbolNetStandard=$(OutputPath)tasks\netstandard2.0\$(TaskProject).pdb;
<!-- Include the assembly and symbols from the tools project -->
ToolFiles=$(OutputPath)tools\**\*;
</NuspecProperties>
</PropertyGroup>
</Target>
<Target Name="LayoutDependencies" AfterTargets="Build" BeforeTargets="PopulateNuspec" Condition="'$(IsInnerBuild)'!='true'">
<Target Name="LayoutDependencies" AfterTargets="Build" BeforeTargets="PopulateNuspec">
<RemoveDir Directories="$(OutputPath)tools\" />
<MSBuild Projects="$(ToolProject)" Properties="PublishDir=$(MSBuildProjectDirectory)\$(OutputPath)tools\;TargetFramework=netcoreapp2.0" Targets="Publish" />

View File

@ -4,6 +4,16 @@
This target is explicitly imported by Razor SDK.
-->
<UsingTask
TaskName="Microsoft.AspNetCore.Razor.Tasks.RazorGenerate"
AssemblyFile="$(RazorSdkBuildTasksAssembly)"
Condition="'$(RazorSdkBuildTasksAssembly)' != ''" />
<UsingTask
TaskName="Microsoft.AspNetCore.Razor.Tasks.RazorTagHelper"
AssemblyFile="$(RazorSdkBuildTasksAssembly)"
Condition="'$(RazorSdkBuildTasksAssembly)' != ''" />
<!--
Consider these properties to be private to this targets file. The main Razor SDK should define all of the properties
that we use to pass data back and forth.
@ -48,7 +58,7 @@
<Target
Name="ResolveTagHelperRazorGenerateInputs"
DependsOnTargets="Compile"
DependsOnTargets="_EnsureRazorTasksAssemblyDefined;Compile"
Inputs="$(MSBuildAllProjects);@(RazorReferencePath)"
Outputs="$(_RazorTagHelperInputCache)"
Condition="'@(RazorGenerateWithTargetPath)' != ''">
@ -97,6 +107,7 @@
<PropertyGroup>
<RazorCoreGenerateDependsOn>
_EnsureRazorTasksAssemblyDefined;
_HashRazorGenerateInputs;
_ResolveRazorGenerateOutputs;
</RazorCoreGenerateDependsOn>
@ -146,4 +157,10 @@
</ItemGroup>
</Target>
<Target Name="_EnsureRazorTasksAssemblyDefined">
<Error
Text="Assembly location for Razor SDK Tasks was not specified. The most likely cause is an older incompatible version of Microsoft.NET.Sdk.Razor, or Microsoft.NET.Sdk.Web used by this project. Please target a newer version of the .NET Core SDK."
Condition="'$(RazorSdkBuildTasksAssembly)' == ''" />
</Target>
</Project>

View File

@ -30,11 +30,6 @@
<!-- Override this to hijack the tasks and targets. Used by tests. -->
<_RazorMSBuildRoot Condition="'$(_RazorMSBuildRoot)'==''">$(MSBuildThisFileDirectory)..\..\</_RazorMSBuildRoot>
<_RazorTaskFolder Condition=" '$(MSBuildRuntimeType)' == 'Core' ">netstandard2.0</_RazorTaskFolder>
<_RazorTaskFolder Condition=" '$(MSBuildRuntimeType)' != 'Core' ">net46</_RazorTaskFolder>
<_RazorTaskAssembly Condition="'$(_RazorTaskAssembly)'==''">$(_RazorMSBuildRoot)\tasks\$(_RazorTaskFolder)\Microsoft.AspNetCore.Razor.Tasks.dll</_RazorTaskAssembly>
<!-- Used to locate our tools -->
<_RazorToolAssembly Condition="'$(_RazorToolAssembly)'==''">$(_RazorMSBuildRoot)tools\rzc.dll</_RazorToolAssembly>
</PropertyGroup>
@ -47,6 +42,4 @@
<ProjectCapability Include="DotNetCoreRazorConfiguration"/>
</ItemGroup>
<UsingTask TaskName="Microsoft.AspNetCore.Razor.Tasks.RazorGenerate" AssemblyFile="$(_RazorTaskAssembly)" />
<UsingTask TaskName="Microsoft.AspNetCore.Razor.Tasks.RazorTagHelper" AssemblyFile="$(_RazorTaskAssembly)" />
</Project>

View File

@ -59,32 +59,81 @@ namespace Microsoft.AspNetCore.Razor.Language
return false;
}
return descriptorX != null &&
string.Equals(descriptorX.Kind, descriptorY.Kind, StringComparison.Ordinal) &&
string.Equals(descriptorX.AssemblyName, descriptorY.AssemblyName, StringComparison.Ordinal) &&
string.Equals(descriptorX.Name, descriptorY.Name, StringComparison.Ordinal) &&
Enumerable.SequenceEqual(
descriptorX.BoundAttributes.OrderBy(attribute => attribute.Name, _stringComparer),
descriptorY.BoundAttributes.OrderBy(attribute => attribute.Name, _stringComparer),
_boundAttributeComparer) &&
Enumerable.SequenceEqual(
descriptorX.TagMatchingRules.OrderBy(rule => rule.TagName, _stringComparer),
descriptorY.TagMatchingRules.OrderBy(rule => rule.TagName, _stringComparer),
_tagMatchingRuleComparer) &&
(descriptorX.AllowedChildTags == descriptorY.AllowedChildTags ||
if (descriptorX == null)
{
return false;
}
if (!string.Equals(descriptorX.Kind, descriptorY.Kind, StringComparison.Ordinal))
{
return false;
}
if (!string.Equals(descriptorX.AssemblyName, descriptorY.AssemblyName, StringComparison.Ordinal))
{
return false;
}
if (!string.Equals(descriptorX.Name, descriptorY.Name, StringComparison.Ordinal))
{
return false;
}
if (!Enumerable.SequenceEqual(
descriptorX.BoundAttributes.OrderBy(attribute => attribute.Name, _stringComparer),
descriptorY.BoundAttributes.OrderBy(attribute => attribute.Name, _stringComparer),
_boundAttributeComparer))
{
return false;
}
if (!Enumerable.SequenceEqual(
descriptorX.TagMatchingRules.OrderBy(rule => rule.TagName, _stringComparer),
descriptorY.TagMatchingRules.OrderBy(rule => rule.TagName, _stringComparer),
_tagMatchingRuleComparer))
{
return false;
}
if (!(descriptorX.AllowedChildTags == descriptorY.AllowedChildTags ||
(descriptorX.AllowedChildTags != null &&
descriptorY.AllowedChildTags != null &&
Enumerable.SequenceEqual(
descriptorX.AllowedChildTags.OrderBy(childTag => childTag.Name, _stringComparer),
descriptorY.AllowedChildTags.OrderBy(childTag => childTag.Name, _stringComparer),
_AllowedChildTagDescriptorComparer))) &&
string.Equals(descriptorX.Documentation, descriptorY.Documentation, StringComparison.Ordinal) &&
string.Equals(descriptorX.DisplayName, descriptorY.DisplayName, StringComparison.Ordinal) &&
string.Equals(descriptorX.TagOutputHint, descriptorY.TagOutputHint, _stringComparison) &&
Enumerable.SequenceEqual(descriptorX.Diagnostics, descriptorY.Diagnostics) &&
Enumerable.SequenceEqual(
descriptorX.Metadata.OrderBy(metadataX => metadataX.Key, StringComparer.Ordinal),
descriptorY.Metadata.OrderBy(metadataY => metadataY.Key, StringComparer.Ordinal));
_AllowedChildTagDescriptorComparer))))
{
return false;
}
if (!string.Equals(descriptorX.Documentation, descriptorY.Documentation, StringComparison.Ordinal))
{
return false;
}
if (!string.Equals(descriptorX.DisplayName, descriptorY.DisplayName, StringComparison.Ordinal))
{
return false;
}
if (!string.Equals(descriptorX.TagOutputHint, descriptorY.TagOutputHint, _stringComparison))
{
return false;
}
if (!Enumerable.SequenceEqual(descriptorX.Diagnostics, descriptorY.Diagnostics))
{
return false;
}
if (!Enumerable.SequenceEqual(
descriptorX.Metadata.OrderBy(metadataX => metadataX.Key, StringComparer.Ordinal),
descriptorY.Metadata.OrderBy(metadataY => metadataY.Key, StringComparer.Ordinal)))
{
return false;
}
return true;
}
/// <inheritdoc />

View File

@ -1,34 +0,0 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Description>Razor is a markup syntax for adding server-side logic to web pages. This assembly contains infrastructure supporting Razor MSBuild integration.</Description>
<!-- This needs to support desktop and CoreCLR to run in msbuild -->
<TargetFrameworks>net46;netstandard2.0</TargetFrameworks>
<!-- This is not a package, it is part of Microsoft.AspNetCore.Razor.Design. -->
<IsPackable>false</IsPackable>
<EnableApiCheck>false</EnableApiCheck>
<OutputPath>..\Microsoft.AspNetCore.Razor.Design\bin\$(Configuration)\tasks\</OutputPath>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Build.Framework" Version="$(MicrosoftBuildFrameworkPackageVersion)" />
<PackageReference Include="Microsoft.Build.Utilities.Core" Version="$(MicrosoftBuildUtilitiesCorePackageVersion)" />
<PackageReference Include="Microsoft.Extensions.CommandLineUtils.Sources" Version="$(MicrosoftExtensionsCommandLineUtilsSourcesPackageVersion)" />
<Compile Include="..\Microsoft.AspNetCore.Razor.Tools\ServerProtocol\*.cs">
<Link>Shared\ServerProtocol\%(FileName)</Link>
</Compile>
<Compile Include="..\Microsoft.AspNetCore.Razor.Tools\PipeName.cs">
<Link>Shared\PipeName.cs</Link>
</Compile>
<Compile Include="..\Microsoft.AspNetCore.Razor.Tools\MutexName.cs">
<Link>Shared\MutexName.cs</Link>
</Compile>
<Compile Include="..\Microsoft.AspNetCore.Razor.Tools\Client.cs">
<Link>Shared\Client.cs</Link>
</Compile>
</ItemGroup>
</Project>

View File

@ -14,6 +14,7 @@
<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="$(VSIX_MicrosoftCodeAnalysisCSharpPackageVersion)" />
<PackageReference Include="Microsoft.CodeAnalysis.Workspaces.Common" Version="$(VSIX_MicrosoftCodeAnalysisWorkspacesCommonPackageVersion)" />
<PackageReference Include="Microsoft.Extensions.NonCapturingTimer.Sources" Version="$(MicrosoftExtensionsNonCapturingTimerSourcesPackageVersion)" PrivateAssets="all" />
</ItemGroup>
</Project>

View File

@ -40,15 +40,11 @@ namespace Microsoft.CodeAnalysis.Razor
internal static bool IsValidCompilation(Compilation compilation)
{
var iTagHelper = compilation.GetTypeByMetadataName(TagHelperTypes.ITagHelper);
var @string = compilation.GetSpecialType(SpecialType.System_String);
// Do some minimal tests to verify the compilation is valid. If symbols for ITagHelper or System.String
// are missing or errored, the compilation may be missing references.
return iTagHelper != null &&
iTagHelper.TypeKind != TypeKind.Error &&
@string != null &&
@string.TypeKind != TypeKind.Error;
// Do some minimal tests to verify the compilation is valid. If symbols for System.String
// is missing or errored, the compilation may be missing references.
return @string != null && @string.TypeKind != TypeKind.Error;
}
}
}

View File

@ -31,8 +31,15 @@ namespace Microsoft.CodeAnalysis.Razor
return;
}
var iTagHelper = compilation.GetTypeByMetadataName(TagHelperTypes.ITagHelper);
if (iTagHelper == null || iTagHelper.TypeKind == TypeKind.Error)
{
// Could not find attributes we care about in the compilation. Nothing to do.
return;
}
var types = new List<INamedTypeSymbol>();
var visitor = TagHelperTypeVisitor.Create(compilation, types);
var visitor = new TagHelperTypeVisitor(iTagHelper, types);
// We always visit the global namespace.
visitor.Visit(compilation.Assembly.GlobalNamespace);

View File

@ -11,12 +11,6 @@ namespace Microsoft.CodeAnalysis.Razor
private INamedTypeSymbol _interface;
private List<INamedTypeSymbol> _results;
public static TagHelperTypeVisitor Create(Compilation compilation, List<INamedTypeSymbol> results)
{
var @interface = compilation.GetTypeByMetadataName(TagHelperTypes.ITagHelper);
return new TagHelperTypeVisitor(@interface, results);
}
public TagHelperTypeVisitor(INamedTypeSymbol @interface, List<INamedTypeSymbol> results)
{
_interface = @interface;

View File

@ -1,19 +1,38 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Description>Razor is a markup syntax for adding server-side logic to web pages. This package contains MSBuild support for Razor.</Description>
<TargetFramework>netstandard2.0</TargetFramework>
<TargetFrameworks>netstandard2.0;net46</TargetFrameworks>
<!-- This project doesn't have any code, so don't include it in the .nupkg -->
<IncludeBuildOutput>false</IncludeBuildOutput>
<TargetName>Microsoft.NET.Sdk.Razor.Tasks</TargetName>
<BuildOutputTargetFolder>tasks</BuildOutputTargetFolder>
<EnableDefaultItems>false</EnableDefaultItems>
<EnableApiCheck>false</EnableApiCheck>
<!-- Do not disable ApiCheck. We need to be aware of when we make changes to the Tasks sicne they need to be backwards compatible. -->
</PropertyGroup>
<ItemGroup>
<ItemGroup>
<None Include="Sdk\*" Pack="true" PackagePath="Sdk\" />
<None Include="build\**\*" Pack="true" PackagePath="build" />
<None Include="buildMultiTargeting\**\*" Pack="true" PackagePath="buildMultiTargeting" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Build.Framework" Version="$(MicrosoftBuildFrameworkPackageVersion)" />
<PackageReference Include="Microsoft.Build.Utilities.Core" Version="$(MicrosoftBuildUtilitiesCorePackageVersion)" />
<PackageReference Include="Microsoft.Extensions.CommandLineUtils.Sources" Version="$(MicrosoftExtensionsCommandLineUtilsSourcesPackageVersion)" />
</ItemGroup>
<ItemGroup>
<Compile Include="..\Microsoft.AspNetCore.Razor.Tools\ServerProtocol\*.cs">
<Link>Shared\ServerProtocol\%(FileName)</Link>
</Compile>
<Compile Include="..\Microsoft.AspNetCore.Razor.Tools\PipeName.cs">
<Link>Shared\PipeName.cs</Link>
</Compile>
<Compile Include="..\Microsoft.AspNetCore.Razor.Tools\MutexName.cs">
<Link>Shared\MutexName.cs</Link>
</Compile>
<Compile Include="..\Microsoft.AspNetCore.Razor.Tools\Client.cs">
<Link>Shared\Client.cs</Link>
</Compile>
</ItemGroup>
</Project>

View File

@ -0,0 +1,762 @@
{
"AssemblyIdentity": "Microsoft.AspNetCore.Razor.Tasks, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60",
"Types": [
{
"Name": "Microsoft.AspNetCore.Razor.Tasks.DotNetToolTask",
"Visibility": "Public",
"Kind": "Class",
"Abstract": true,
"BaseType": "Microsoft.Build.Utilities.ToolTask",
"ImplementedInterfaces": [],
"Members": [
{
"Kind": "Method",
"Name": "Execute",
"Parameters": [],
"ReturnType": "System.Boolean",
"Virtual": true,
"Override": true,
"ImplementedInterface": "Microsoft.Build.Framework.ITask",
"Visibility": "Public",
"GenericParameter": []
},
{
"Kind": "Method",
"Name": "Cancel",
"Parameters": [],
"ReturnType": "System.Void",
"Virtual": true,
"Override": true,
"ImplementedInterface": "Microsoft.Build.Framework.ICancelableTask",
"Visibility": "Public",
"GenericParameter": []
},
{
"Kind": "Method",
"Name": "get_Debug",
"Parameters": [],
"ReturnType": "System.Boolean",
"Visibility": "Public",
"GenericParameter": []
},
{
"Kind": "Method",
"Name": "set_Debug",
"Parameters": [
{
"Name": "value",
"Type": "System.Boolean"
}
],
"ReturnType": "System.Void",
"Visibility": "Public",
"GenericParameter": []
},
{
"Kind": "Method",
"Name": "get_DebugTool",
"Parameters": [],
"ReturnType": "System.Boolean",
"Visibility": "Public",
"GenericParameter": []
},
{
"Kind": "Method",
"Name": "set_DebugTool",
"Parameters": [
{
"Name": "value",
"Type": "System.Boolean"
}
],
"ReturnType": "System.Void",
"Visibility": "Public",
"GenericParameter": []
},
{
"Kind": "Method",
"Name": "get_ToolAssembly",
"Parameters": [],
"ReturnType": "System.String",
"Visibility": "Public",
"GenericParameter": []
},
{
"Kind": "Method",
"Name": "set_ToolAssembly",
"Parameters": [
{
"Name": "value",
"Type": "System.String"
}
],
"ReturnType": "System.Void",
"Visibility": "Public",
"GenericParameter": []
},
{
"Kind": "Method",
"Name": "get_UseServer",
"Parameters": [],
"ReturnType": "System.Boolean",
"Visibility": "Public",
"GenericParameter": []
},
{
"Kind": "Method",
"Name": "set_UseServer",
"Parameters": [
{
"Name": "value",
"Type": "System.Boolean"
}
],
"ReturnType": "System.Void",
"Visibility": "Public",
"GenericParameter": []
},
{
"Kind": "Method",
"Name": "get_ForceServer",
"Parameters": [],
"ReturnType": "System.Boolean",
"Visibility": "Public",
"GenericParameter": []
},
{
"Kind": "Method",
"Name": "set_ForceServer",
"Parameters": [
{
"Name": "value",
"Type": "System.Boolean"
}
],
"ReturnType": "System.Void",
"Visibility": "Public",
"GenericParameter": []
},
{
"Kind": "Method",
"Name": "get_SuppressCurrentUserOnlyPipeOptions",
"Parameters": [],
"ReturnType": "System.Boolean",
"Visibility": "Public",
"GenericParameter": []
},
{
"Kind": "Method",
"Name": "set_SuppressCurrentUserOnlyPipeOptions",
"Parameters": [
{
"Name": "value",
"Type": "System.Boolean"
}
],
"ReturnType": "System.Void",
"Visibility": "Public",
"GenericParameter": []
},
{
"Kind": "Method",
"Name": "get_PipeName",
"Parameters": [],
"ReturnType": "System.String",
"Visibility": "Public",
"GenericParameter": []
},
{
"Kind": "Method",
"Name": "set_PipeName",
"Parameters": [
{
"Name": "value",
"Type": "System.String"
}
],
"ReturnType": "System.Void",
"Visibility": "Public",
"GenericParameter": []
},
{
"Kind": "Method",
"Name": "get_ToolName",
"Parameters": [],
"ReturnType": "System.String",
"Virtual": true,
"Override": true,
"Visibility": "Protected",
"GenericParameter": []
},
{
"Kind": "Method",
"Name": "get_StandardOutputLoggingImportance",
"Parameters": [],
"ReturnType": "Microsoft.Build.Framework.MessageImportance",
"Virtual": true,
"Override": true,
"Visibility": "Protected",
"GenericParameter": []
},
{
"Kind": "Method",
"Name": "get_StandardErrorLoggingImportance",
"Parameters": [],
"ReturnType": "Microsoft.Build.Framework.MessageImportance",
"Virtual": true,
"Override": true,
"Visibility": "Protected",
"GenericParameter": []
},
{
"Kind": "Method",
"Name": "GenerateFullPathToTool",
"Parameters": [],
"ReturnType": "System.String",
"Virtual": true,
"Override": true,
"Visibility": "Protected",
"GenericParameter": []
},
{
"Kind": "Method",
"Name": "GenerateCommandLineCommands",
"Parameters": [],
"ReturnType": "System.String",
"Virtual": true,
"Override": true,
"Visibility": "Protected",
"GenericParameter": []
},
{
"Kind": "Method",
"Name": "GetResponseFileSwitch",
"Parameters": [
{
"Name": "responseFilePath",
"Type": "System.String"
}
],
"ReturnType": "System.String",
"Virtual": true,
"Override": true,
"Visibility": "Protected",
"GenericParameter": []
},
{
"Kind": "Method",
"Name": "GenerateResponseFileCommands",
"Parameters": [],
"ReturnType": "System.String",
"Virtual": true,
"Override": true,
"Abstract": true,
"Visibility": "Protected",
"GenericParameter": []
},
{
"Kind": "Method",
"Name": "ExecuteTool",
"Parameters": [
{
"Name": "pathToTool",
"Type": "System.String"
},
{
"Name": "responseFileCommands",
"Type": "System.String"
},
{
"Name": "commandLineCommands",
"Type": "System.String"
}
],
"ReturnType": "System.Int32",
"Virtual": true,
"Override": true,
"Visibility": "Protected",
"GenericParameter": []
},
{
"Kind": "Method",
"Name": "LogToolCommand",
"Parameters": [
{
"Name": "message",
"Type": "System.String"
}
],
"ReturnType": "System.Void",
"Virtual": true,
"Override": true,
"Visibility": "Protected",
"GenericParameter": []
},
{
"Kind": "Method",
"Name": "TryExecuteOnServer",
"Parameters": [
{
"Name": "pathToTool",
"Type": "System.String"
},
{
"Name": "responseFileCommands",
"Type": "System.String"
},
{
"Name": "commandLineCommands",
"Type": "System.String"
},
{
"Name": "result",
"Type": "System.Int32",
"Direction": "Out"
}
],
"ReturnType": "System.Boolean",
"Virtual": true,
"Visibility": "Protected",
"GenericParameter": []
},
{
"Kind": "Method",
"Name": "HandleTaskExecutionErrors",
"Parameters": [],
"ReturnType": "System.Boolean",
"Virtual": true,
"Override": true,
"Visibility": "Protected",
"GenericParameter": []
},
{
"Kind": "Constructor",
"Name": ".ctor",
"Parameters": [],
"Visibility": "Protected",
"GenericParameter": []
}
],
"GenericParameters": []
},
{
"Name": "Microsoft.AspNetCore.Razor.Tasks.RazorGenerate",
"Visibility": "Public",
"Kind": "Class",
"BaseType": "Microsoft.AspNetCore.Razor.Tasks.DotNetToolTask",
"ImplementedInterfaces": [],
"Members": [
{
"Kind": "Method",
"Name": "get_Version",
"Parameters": [],
"ReturnType": "System.String",
"Visibility": "Public",
"GenericParameter": []
},
{
"Kind": "Method",
"Name": "set_Version",
"Parameters": [
{
"Name": "value",
"Type": "System.String"
}
],
"ReturnType": "System.Void",
"Visibility": "Public",
"GenericParameter": []
},
{
"Kind": "Method",
"Name": "get_Configuration",
"Parameters": [],
"ReturnType": "Microsoft.Build.Framework.ITaskItem[]",
"Visibility": "Public",
"GenericParameter": []
},
{
"Kind": "Method",
"Name": "set_Configuration",
"Parameters": [
{
"Name": "value",
"Type": "Microsoft.Build.Framework.ITaskItem[]"
}
],
"ReturnType": "System.Void",
"Visibility": "Public",
"GenericParameter": []
},
{
"Kind": "Method",
"Name": "get_Extensions",
"Parameters": [],
"ReturnType": "Microsoft.Build.Framework.ITaskItem[]",
"Visibility": "Public",
"GenericParameter": []
},
{
"Kind": "Method",
"Name": "set_Extensions",
"Parameters": [
{
"Name": "value",
"Type": "Microsoft.Build.Framework.ITaskItem[]"
}
],
"ReturnType": "System.Void",
"Visibility": "Public",
"GenericParameter": []
},
{
"Kind": "Method",
"Name": "get_Sources",
"Parameters": [],
"ReturnType": "Microsoft.Build.Framework.ITaskItem[]",
"Visibility": "Public",
"GenericParameter": []
},
{
"Kind": "Method",
"Name": "set_Sources",
"Parameters": [
{
"Name": "value",
"Type": "Microsoft.Build.Framework.ITaskItem[]"
}
],
"ReturnType": "System.Void",
"Visibility": "Public",
"GenericParameter": []
},
{
"Kind": "Method",
"Name": "get_ProjectRoot",
"Parameters": [],
"ReturnType": "System.String",
"Visibility": "Public",
"GenericParameter": []
},
{
"Kind": "Method",
"Name": "set_ProjectRoot",
"Parameters": [
{
"Name": "value",
"Type": "System.String"
}
],
"ReturnType": "System.Void",
"Visibility": "Public",
"GenericParameter": []
},
{
"Kind": "Method",
"Name": "get_TagHelperManifest",
"Parameters": [],
"ReturnType": "System.String",
"Visibility": "Public",
"GenericParameter": []
},
{
"Kind": "Method",
"Name": "set_TagHelperManifest",
"Parameters": [
{
"Name": "value",
"Type": "System.String"
}
],
"ReturnType": "System.Void",
"Visibility": "Public",
"GenericParameter": []
},
{
"Kind": "Method",
"Name": "ValidateParameters",
"Parameters": [],
"ReturnType": "System.Boolean",
"Virtual": true,
"Override": true,
"Visibility": "Protected",
"GenericParameter": []
},
{
"Kind": "Method",
"Name": "GenerateResponseFileCommands",
"Parameters": [],
"ReturnType": "System.String",
"Virtual": true,
"Override": true,
"Visibility": "Protected",
"GenericParameter": []
},
{
"Kind": "Constructor",
"Name": ".ctor",
"Parameters": [],
"Visibility": "Public",
"GenericParameter": []
}
],
"GenericParameters": []
},
{
"Name": "Microsoft.AspNetCore.Razor.Tasks.RazorTagHelper",
"Visibility": "Public",
"Kind": "Class",
"BaseType": "Microsoft.AspNetCore.Razor.Tasks.DotNetToolTask",
"ImplementedInterfaces": [],
"Members": [
{
"Kind": "Method",
"Name": "get_Version",
"Parameters": [],
"ReturnType": "System.String",
"Visibility": "Public",
"GenericParameter": []
},
{
"Kind": "Method",
"Name": "set_Version",
"Parameters": [
{
"Name": "value",
"Type": "System.String"
}
],
"ReturnType": "System.Void",
"Visibility": "Public",
"GenericParameter": []
},
{
"Kind": "Method",
"Name": "get_Configuration",
"Parameters": [],
"ReturnType": "Microsoft.Build.Framework.ITaskItem[]",
"Visibility": "Public",
"GenericParameter": []
},
{
"Kind": "Method",
"Name": "set_Configuration",
"Parameters": [
{
"Name": "value",
"Type": "Microsoft.Build.Framework.ITaskItem[]"
}
],
"ReturnType": "System.Void",
"Visibility": "Public",
"GenericParameter": []
},
{
"Kind": "Method",
"Name": "get_Extensions",
"Parameters": [],
"ReturnType": "Microsoft.Build.Framework.ITaskItem[]",
"Visibility": "Public",
"GenericParameter": []
},
{
"Kind": "Method",
"Name": "set_Extensions",
"Parameters": [
{
"Name": "value",
"Type": "Microsoft.Build.Framework.ITaskItem[]"
}
],
"ReturnType": "System.Void",
"Visibility": "Public",
"GenericParameter": []
},
{
"Kind": "Method",
"Name": "get_Assemblies",
"Parameters": [],
"ReturnType": "System.String[]",
"Visibility": "Public",
"GenericParameter": []
},
{
"Kind": "Method",
"Name": "set_Assemblies",
"Parameters": [
{
"Name": "value",
"Type": "System.String[]"
}
],
"ReturnType": "System.Void",
"Visibility": "Public",
"GenericParameter": []
},
{
"Kind": "Method",
"Name": "get_TagHelperManifest",
"Parameters": [],
"ReturnType": "System.String",
"Visibility": "Public",
"GenericParameter": []
},
{
"Kind": "Method",
"Name": "set_TagHelperManifest",
"Parameters": [
{
"Name": "value",
"Type": "System.String"
}
],
"ReturnType": "System.Void",
"Visibility": "Public",
"GenericParameter": []
},
{
"Kind": "Method",
"Name": "get_ProjectRoot",
"Parameters": [],
"ReturnType": "System.String",
"Visibility": "Public",
"GenericParameter": []
},
{
"Kind": "Method",
"Name": "set_ProjectRoot",
"Parameters": [
{
"Name": "value",
"Type": "System.String"
}
],
"ReturnType": "System.Void",
"Visibility": "Public",
"GenericParameter": []
},
{
"Kind": "Method",
"Name": "SkipTaskExecution",
"Parameters": [],
"ReturnType": "System.Boolean",
"Virtual": true,
"Override": true,
"Visibility": "Protected",
"GenericParameter": []
},
{
"Kind": "Method",
"Name": "ValidateParameters",
"Parameters": [],
"ReturnType": "System.Boolean",
"Virtual": true,
"Override": true,
"Visibility": "Protected",
"GenericParameter": []
},
{
"Kind": "Method",
"Name": "GenerateResponseFileCommands",
"Parameters": [],
"ReturnType": "System.String",
"Virtual": true,
"Override": true,
"Visibility": "Protected",
"GenericParameter": []
},
{
"Kind": "Constructor",
"Name": ".ctor",
"Parameters": [],
"Visibility": "Public",
"GenericParameter": []
}
],
"GenericParameters": []
},
{
"Name": "Microsoft.AspNetCore.Razor.Tools.RequestArgument+ArgumentId",
"Visibility": "Public",
"Kind": "Enumeration",
"Sealed": true,
"ImplementedInterfaces": [],
"Members": [
{
"Kind": "Field",
"Name": "CurrentDirectory",
"Parameters": [],
"GenericParameter": [],
"Literal": "1360294433"
},
{
"Kind": "Field",
"Name": "CommandLineArgument",
"Parameters": [],
"GenericParameter": [],
"Literal": "1360294434"
},
{
"Kind": "Field",
"Name": "KeepAlive",
"Parameters": [],
"GenericParameter": [],
"Literal": "1360294435"
},
{
"Kind": "Field",
"Name": "Shutdown",
"Parameters": [],
"GenericParameter": [],
"Literal": "1360294436"
},
{
"Kind": "Field",
"Name": "TempDirectory",
"Parameters": [],
"GenericParameter": [],
"Literal": "1360294437"
}
],
"GenericParameters": []
},
{
"Name": "Microsoft.AspNetCore.Razor.Tools.ServerResponse+ResponseType",
"Visibility": "Public",
"Kind": "Enumeration",
"Sealed": true,
"ImplementedInterfaces": [],
"Members": [
{
"Kind": "Field",
"Name": "MismatchedVersion",
"Parameters": [],
"GenericParameter": [],
"Literal": "0"
},
{
"Kind": "Field",
"Name": "Completed",
"Parameters": [],
"GenericParameter": [],
"Literal": "1"
},
{
"Kind": "Field",
"Name": "Shutdown",
"Parameters": [],
"GenericParameter": [],
"Literal": "2"
},
{
"Kind": "Field",
"Name": "Rejected",
"Parameters": [],
"GenericParameter": [],
"Literal": "3"
}
],
"GenericParameters": []
}
]
}

View File

@ -0,0 +1,762 @@
{
"AssemblyIdentity": "Microsoft.AspNetCore.Razor.Tasks, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60",
"Types": [
{
"Name": "Microsoft.AspNetCore.Razor.Tasks.DotNetToolTask",
"Visibility": "Public",
"Kind": "Class",
"Abstract": true,
"BaseType": "Microsoft.Build.Utilities.ToolTask",
"ImplementedInterfaces": [],
"Members": [
{
"Kind": "Method",
"Name": "get_Debug",
"Parameters": [],
"ReturnType": "System.Boolean",
"Visibility": "Public",
"GenericParameter": []
},
{
"Kind": "Method",
"Name": "set_Debug",
"Parameters": [
{
"Name": "value",
"Type": "System.Boolean"
}
],
"ReturnType": "System.Void",
"Visibility": "Public",
"GenericParameter": []
},
{
"Kind": "Method",
"Name": "get_DebugTool",
"Parameters": [],
"ReturnType": "System.Boolean",
"Visibility": "Public",
"GenericParameter": []
},
{
"Kind": "Method",
"Name": "set_DebugTool",
"Parameters": [
{
"Name": "value",
"Type": "System.Boolean"
}
],
"ReturnType": "System.Void",
"Visibility": "Public",
"GenericParameter": []
},
{
"Kind": "Method",
"Name": "get_ToolAssembly",
"Parameters": [],
"ReturnType": "System.String",
"Visibility": "Public",
"GenericParameter": []
},
{
"Kind": "Method",
"Name": "set_ToolAssembly",
"Parameters": [
{
"Name": "value",
"Type": "System.String"
}
],
"ReturnType": "System.Void",
"Visibility": "Public",
"GenericParameter": []
},
{
"Kind": "Method",
"Name": "get_UseServer",
"Parameters": [],
"ReturnType": "System.Boolean",
"Visibility": "Public",
"GenericParameter": []
},
{
"Kind": "Method",
"Name": "set_UseServer",
"Parameters": [
{
"Name": "value",
"Type": "System.Boolean"
}
],
"ReturnType": "System.Void",
"Visibility": "Public",
"GenericParameter": []
},
{
"Kind": "Method",
"Name": "get_ForceServer",
"Parameters": [],
"ReturnType": "System.Boolean",
"Visibility": "Public",
"GenericParameter": []
},
{
"Kind": "Method",
"Name": "set_ForceServer",
"Parameters": [
{
"Name": "value",
"Type": "System.Boolean"
}
],
"ReturnType": "System.Void",
"Visibility": "Public",
"GenericParameter": []
},
{
"Kind": "Method",
"Name": "get_SuppressCurrentUserOnlyPipeOptions",
"Parameters": [],
"ReturnType": "System.Boolean",
"Visibility": "Public",
"GenericParameter": []
},
{
"Kind": "Method",
"Name": "set_SuppressCurrentUserOnlyPipeOptions",
"Parameters": [
{
"Name": "value",
"Type": "System.Boolean"
}
],
"ReturnType": "System.Void",
"Visibility": "Public",
"GenericParameter": []
},
{
"Kind": "Method",
"Name": "get_PipeName",
"Parameters": [],
"ReturnType": "System.String",
"Visibility": "Public",
"GenericParameter": []
},
{
"Kind": "Method",
"Name": "set_PipeName",
"Parameters": [
{
"Name": "value",
"Type": "System.String"
}
],
"ReturnType": "System.Void",
"Visibility": "Public",
"GenericParameter": []
},
{
"Kind": "Method",
"Name": "get_ToolName",
"Parameters": [],
"ReturnType": "System.String",
"Virtual": true,
"Override": true,
"Visibility": "Protected",
"GenericParameter": []
},
{
"Kind": "Method",
"Name": "get_StandardOutputLoggingImportance",
"Parameters": [],
"ReturnType": "Microsoft.Build.Framework.MessageImportance",
"Virtual": true,
"Override": true,
"Visibility": "Protected",
"GenericParameter": []
},
{
"Kind": "Method",
"Name": "get_StandardErrorLoggingImportance",
"Parameters": [],
"ReturnType": "Microsoft.Build.Framework.MessageImportance",
"Virtual": true,
"Override": true,
"Visibility": "Protected",
"GenericParameter": []
},
{
"Kind": "Method",
"Name": "GenerateFullPathToTool",
"Parameters": [],
"ReturnType": "System.String",
"Virtual": true,
"Override": true,
"Visibility": "Protected",
"GenericParameter": []
},
{
"Kind": "Method",
"Name": "GenerateCommandLineCommands",
"Parameters": [],
"ReturnType": "System.String",
"Virtual": true,
"Override": true,
"Visibility": "Protected",
"GenericParameter": []
},
{
"Kind": "Method",
"Name": "GetResponseFileSwitch",
"Parameters": [
{
"Name": "responseFilePath",
"Type": "System.String"
}
],
"ReturnType": "System.String",
"Virtual": true,
"Override": true,
"Visibility": "Protected",
"GenericParameter": []
},
{
"Kind": "Method",
"Name": "GenerateResponseFileCommands",
"Parameters": [],
"ReturnType": "System.String",
"Virtual": true,
"Override": true,
"Abstract": true,
"Visibility": "Protected",
"GenericParameter": []
},
{
"Kind": "Method",
"Name": "Execute",
"Parameters": [],
"ReturnType": "System.Boolean",
"Virtual": true,
"Override": true,
"ImplementedInterface": "Microsoft.Build.Framework.ITask",
"Visibility": "Public",
"GenericParameter": []
},
{
"Kind": "Method",
"Name": "ExecuteTool",
"Parameters": [
{
"Name": "pathToTool",
"Type": "System.String"
},
{
"Name": "responseFileCommands",
"Type": "System.String"
},
{
"Name": "commandLineCommands",
"Type": "System.String"
}
],
"ReturnType": "System.Int32",
"Virtual": true,
"Override": true,
"Visibility": "Protected",
"GenericParameter": []
},
{
"Kind": "Method",
"Name": "LogToolCommand",
"Parameters": [
{
"Name": "message",
"Type": "System.String"
}
],
"ReturnType": "System.Void",
"Virtual": true,
"Override": true,
"Visibility": "Protected",
"GenericParameter": []
},
{
"Kind": "Method",
"Name": "Cancel",
"Parameters": [],
"ReturnType": "System.Void",
"Virtual": true,
"Override": true,
"ImplementedInterface": "Microsoft.Build.Framework.ICancelableTask",
"Visibility": "Public",
"GenericParameter": []
},
{
"Kind": "Method",
"Name": "TryExecuteOnServer",
"Parameters": [
{
"Name": "pathToTool",
"Type": "System.String"
},
{
"Name": "responseFileCommands",
"Type": "System.String"
},
{
"Name": "commandLineCommands",
"Type": "System.String"
},
{
"Name": "result",
"Type": "System.Int32",
"Direction": "Out"
}
],
"ReturnType": "System.Boolean",
"Virtual": true,
"Visibility": "Protected",
"GenericParameter": []
},
{
"Kind": "Method",
"Name": "HandleTaskExecutionErrors",
"Parameters": [],
"ReturnType": "System.Boolean",
"Virtual": true,
"Override": true,
"Visibility": "Protected",
"GenericParameter": []
},
{
"Kind": "Constructor",
"Name": ".ctor",
"Parameters": [],
"Visibility": "Protected",
"GenericParameter": []
}
],
"GenericParameters": []
},
{
"Name": "Microsoft.AspNetCore.Razor.Tasks.RazorGenerate",
"Visibility": "Public",
"Kind": "Class",
"BaseType": "Microsoft.AspNetCore.Razor.Tasks.DotNetToolTask",
"ImplementedInterfaces": [],
"Members": [
{
"Kind": "Method",
"Name": "get_Version",
"Parameters": [],
"ReturnType": "System.String",
"Visibility": "Public",
"GenericParameter": []
},
{
"Kind": "Method",
"Name": "set_Version",
"Parameters": [
{
"Name": "value",
"Type": "System.String"
}
],
"ReturnType": "System.Void",
"Visibility": "Public",
"GenericParameter": []
},
{
"Kind": "Method",
"Name": "get_Configuration",
"Parameters": [],
"ReturnType": "Microsoft.Build.Framework.ITaskItem[]",
"Visibility": "Public",
"GenericParameter": []
},
{
"Kind": "Method",
"Name": "set_Configuration",
"Parameters": [
{
"Name": "value",
"Type": "Microsoft.Build.Framework.ITaskItem[]"
}
],
"ReturnType": "System.Void",
"Visibility": "Public",
"GenericParameter": []
},
{
"Kind": "Method",
"Name": "get_Extensions",
"Parameters": [],
"ReturnType": "Microsoft.Build.Framework.ITaskItem[]",
"Visibility": "Public",
"GenericParameter": []
},
{
"Kind": "Method",
"Name": "set_Extensions",
"Parameters": [
{
"Name": "value",
"Type": "Microsoft.Build.Framework.ITaskItem[]"
}
],
"ReturnType": "System.Void",
"Visibility": "Public",
"GenericParameter": []
},
{
"Kind": "Method",
"Name": "get_Sources",
"Parameters": [],
"ReturnType": "Microsoft.Build.Framework.ITaskItem[]",
"Visibility": "Public",
"GenericParameter": []
},
{
"Kind": "Method",
"Name": "set_Sources",
"Parameters": [
{
"Name": "value",
"Type": "Microsoft.Build.Framework.ITaskItem[]"
}
],
"ReturnType": "System.Void",
"Visibility": "Public",
"GenericParameter": []
},
{
"Kind": "Method",
"Name": "get_ProjectRoot",
"Parameters": [],
"ReturnType": "System.String",
"Visibility": "Public",
"GenericParameter": []
},
{
"Kind": "Method",
"Name": "set_ProjectRoot",
"Parameters": [
{
"Name": "value",
"Type": "System.String"
}
],
"ReturnType": "System.Void",
"Visibility": "Public",
"GenericParameter": []
},
{
"Kind": "Method",
"Name": "get_TagHelperManifest",
"Parameters": [],
"ReturnType": "System.String",
"Visibility": "Public",
"GenericParameter": []
},
{
"Kind": "Method",
"Name": "set_TagHelperManifest",
"Parameters": [
{
"Name": "value",
"Type": "System.String"
}
],
"ReturnType": "System.Void",
"Visibility": "Public",
"GenericParameter": []
},
{
"Kind": "Method",
"Name": "ValidateParameters",
"Parameters": [],
"ReturnType": "System.Boolean",
"Virtual": true,
"Override": true,
"Visibility": "Protected",
"GenericParameter": []
},
{
"Kind": "Method",
"Name": "GenerateResponseFileCommands",
"Parameters": [],
"ReturnType": "System.String",
"Virtual": true,
"Override": true,
"Visibility": "Protected",
"GenericParameter": []
},
{
"Kind": "Constructor",
"Name": ".ctor",
"Parameters": [],
"Visibility": "Public",
"GenericParameter": []
}
],
"GenericParameters": []
},
{
"Name": "Microsoft.AspNetCore.Razor.Tasks.RazorTagHelper",
"Visibility": "Public",
"Kind": "Class",
"BaseType": "Microsoft.AspNetCore.Razor.Tasks.DotNetToolTask",
"ImplementedInterfaces": [],
"Members": [
{
"Kind": "Method",
"Name": "get_Version",
"Parameters": [],
"ReturnType": "System.String",
"Visibility": "Public",
"GenericParameter": []
},
{
"Kind": "Method",
"Name": "set_Version",
"Parameters": [
{
"Name": "value",
"Type": "System.String"
}
],
"ReturnType": "System.Void",
"Visibility": "Public",
"GenericParameter": []
},
{
"Kind": "Method",
"Name": "get_Configuration",
"Parameters": [],
"ReturnType": "Microsoft.Build.Framework.ITaskItem[]",
"Visibility": "Public",
"GenericParameter": []
},
{
"Kind": "Method",
"Name": "set_Configuration",
"Parameters": [
{
"Name": "value",
"Type": "Microsoft.Build.Framework.ITaskItem[]"
}
],
"ReturnType": "System.Void",
"Visibility": "Public",
"GenericParameter": []
},
{
"Kind": "Method",
"Name": "get_Extensions",
"Parameters": [],
"ReturnType": "Microsoft.Build.Framework.ITaskItem[]",
"Visibility": "Public",
"GenericParameter": []
},
{
"Kind": "Method",
"Name": "set_Extensions",
"Parameters": [
{
"Name": "value",
"Type": "Microsoft.Build.Framework.ITaskItem[]"
}
],
"ReturnType": "System.Void",
"Visibility": "Public",
"GenericParameter": []
},
{
"Kind": "Method",
"Name": "get_Assemblies",
"Parameters": [],
"ReturnType": "System.String[]",
"Visibility": "Public",
"GenericParameter": []
},
{
"Kind": "Method",
"Name": "set_Assemblies",
"Parameters": [
{
"Name": "value",
"Type": "System.String[]"
}
],
"ReturnType": "System.Void",
"Visibility": "Public",
"GenericParameter": []
},
{
"Kind": "Method",
"Name": "get_TagHelperManifest",
"Parameters": [],
"ReturnType": "System.String",
"Visibility": "Public",
"GenericParameter": []
},
{
"Kind": "Method",
"Name": "set_TagHelperManifest",
"Parameters": [
{
"Name": "value",
"Type": "System.String"
}
],
"ReturnType": "System.Void",
"Visibility": "Public",
"GenericParameter": []
},
{
"Kind": "Method",
"Name": "get_ProjectRoot",
"Parameters": [],
"ReturnType": "System.String",
"Visibility": "Public",
"GenericParameter": []
},
{
"Kind": "Method",
"Name": "set_ProjectRoot",
"Parameters": [
{
"Name": "value",
"Type": "System.String"
}
],
"ReturnType": "System.Void",
"Visibility": "Public",
"GenericParameter": []
},
{
"Kind": "Method",
"Name": "SkipTaskExecution",
"Parameters": [],
"ReturnType": "System.Boolean",
"Virtual": true,
"Override": true,
"Visibility": "Protected",
"GenericParameter": []
},
{
"Kind": "Method",
"Name": "ValidateParameters",
"Parameters": [],
"ReturnType": "System.Boolean",
"Virtual": true,
"Override": true,
"Visibility": "Protected",
"GenericParameter": []
},
{
"Kind": "Method",
"Name": "GenerateResponseFileCommands",
"Parameters": [],
"ReturnType": "System.String",
"Virtual": true,
"Override": true,
"Visibility": "Protected",
"GenericParameter": []
},
{
"Kind": "Constructor",
"Name": ".ctor",
"Parameters": [],
"Visibility": "Public",
"GenericParameter": []
}
],
"GenericParameters": []
},
{
"Name": "Microsoft.AspNetCore.Razor.Tools.RequestArgument+ArgumentId",
"Visibility": "Public",
"Kind": "Enumeration",
"Sealed": true,
"ImplementedInterfaces": [],
"Members": [
{
"Kind": "Field",
"Name": "CurrentDirectory",
"Parameters": [],
"GenericParameter": [],
"Literal": "1360294433"
},
{
"Kind": "Field",
"Name": "CommandLineArgument",
"Parameters": [],
"GenericParameter": [],
"Literal": "1360294434"
},
{
"Kind": "Field",
"Name": "KeepAlive",
"Parameters": [],
"GenericParameter": [],
"Literal": "1360294435"
},
{
"Kind": "Field",
"Name": "Shutdown",
"Parameters": [],
"GenericParameter": [],
"Literal": "1360294436"
},
{
"Kind": "Field",
"Name": "TempDirectory",
"Parameters": [],
"GenericParameter": [],
"Literal": "1360294437"
}
],
"GenericParameters": []
},
{
"Name": "Microsoft.AspNetCore.Razor.Tools.ServerResponse+ResponseType",
"Visibility": "Public",
"Kind": "Enumeration",
"Sealed": true,
"ImplementedInterfaces": [],
"Members": [
{
"Kind": "Field",
"Name": "MismatchedVersion",
"Parameters": [],
"GenericParameter": [],
"Literal": "0"
},
{
"Kind": "Field",
"Name": "Completed",
"Parameters": [],
"GenericParameter": [],
"Literal": "1"
},
{
"Kind": "Field",
"Name": "Shutdown",
"Parameters": [],
"GenericParameter": [],
"Literal": "2"
},
{
"Kind": "Field",
"Name": "Rejected",
"Parameters": [],
"GenericParameter": [],
"Literal": "3"
}
],
"GenericParameters": []
}
]
}

View File

@ -9,7 +9,7 @@ WARNING: DO NOT MODIFY this file unless you are knowledgeable about MSBuild and
Copyright (c) .NET Foundation. All rights reserved.
***********************************************************************************************
-->
<Project ToolsVersion="14.0">
<Project ToolsVersion="14.0" TreatAsLocalProperty="_RazorSdkTasksTFM">
<!--
Targets supporting Razor MSBuild integration. Contain support for generating C# code using Razor
and including the generated code in the project lifecycle, including compiling, publishing and producing
@ -21,6 +21,13 @@ Copyright (c) .NET Foundation. All rights reserved.
-->
<Import Project="$(CustomBeforeRazorSdkTargets)" Condition="'$(CustomBeforeRazorSdkTargets)' != '' and Exists('$(CustomBeforeRazorSdkTargets)')"/>
<PropertyGroup>
<RazorSdkBuildTasksDirectoryRoot Condition="'$(RazorSdkBuildTasksDirectoryRoot)'==''">$(MSBuildThisFileDirectory)..\..\tasks\</RazorSdkBuildTasksDirectoryRoot>
<_RazorSdkTasksTFM Condition=" '$(MSBuildRuntimeType)' == 'Core'">netstandard2.0</_RazorSdkTasksTFM>
<_RazorSdkTasksTFM Condition=" '$(_RazorSdkTasksTFM)' == ''">net46</_RazorSdkTasksTFM>
<RazorSdkBuildTasksAssembly>$(RazorSdkBuildTasksDirectoryRoot)$(_RazorSdkTasksTFM)\Microsoft.NET.Sdk.Razor.Tasks.dll</RazorSdkBuildTasksAssembly>
</PropertyGroup>
<!--
Razor defines two primary targets:
'RazorGenerate' - which updates generated code

View File

@ -11,6 +11,7 @@ using Microsoft.AspNetCore.Razor.Language;
using Microsoft.AspNetCore.Razor.Language.Legacy;
using Microsoft.CodeAnalysis.Razor;
using Microsoft.CodeAnalysis.Razor.Editor;
using Microsoft.Extensions.Internal;
using Microsoft.VisualStudio.Text;
using static Microsoft.VisualStudio.Editor.Razor.BackgroundParser;
using ITextBuffer = Microsoft.VisualStudio.Text.ITextBuffer;
@ -214,7 +215,7 @@ namespace Microsoft.VisualStudio.Editor.Razor
if (_idleTimer == null)
{
// Timer will fire after a fixed delay, but only once.
_idleTimer = new Timer(Timer_Tick, null, IdleDelay, Timeout.InfiniteTimeSpan);
_idleTimer = NonCapturingTimer.Create(state => ((DefaultVisualStudioRazorParser)state).Timer_Tick(), this, IdleDelay, Timeout.InfiniteTimeSpan);
}
}
}
@ -337,7 +338,7 @@ namespace Microsoft.VisualStudio.Editor.Razor
}
}
private void Timer_Tick(object state)
private void Timer_Tick()
{
try
{

View File

@ -8,6 +8,7 @@ using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.CodeAnalysis.Razor.ProjectSystem;
using Microsoft.Extensions.Internal;
namespace Microsoft.CodeAnalysis.Razor
{
@ -147,12 +148,18 @@ namespace Microsoft.CodeAnalysis.Razor
// Access to the timer is protected by the lock in Enqueue and in Timer_Tick
if (_timer == null)
{
// Timer will fire after a fixed delay, but only once.
_timer = new Timer(Timer_Tick, null, Delay, Timeout.InfiniteTimeSpan);
_timer = NonCapturingTimer.Create(state => ((BackgroundDocumentGenerator)state).Timer_Tick(), this, Delay, Timeout.InfiniteTimeSpan);
}
}
private async void Timer_Tick(object state) // Yeah I know.
private void Timer_Tick()
{
_ = TimerTick();
}
private async Task TimerTick()
{
try
{
@ -206,7 +213,8 @@ namespace Microsoft.CodeAnalysis.Razor
{
// This is something totally unexpected, let's just send it over to the workspace.
await Task.Factory.StartNew(
() => _projectManager.ReportError(ex),
(p) => ((ProjectSnapshotManagerBase)p).ReportError(ex),
_projectManager,
CancellationToken.None,
TaskCreationOptions.None,
_foregroundDispatcher.ForegroundScheduler);
@ -216,7 +224,8 @@ namespace Microsoft.CodeAnalysis.Razor
private void ReportError(DocumentSnapshot document, Exception ex)
{
GC.KeepAlive(Task.Factory.StartNew(
() => _projectManager.ReportError(ex),
(p) => ((ProjectSnapshotManagerBase)p).ReportError(ex),
_projectManager,
CancellationToken.None,
TaskCreationOptions.None,
_foregroundDispatcher.ForegroundScheduler));

View File

@ -145,6 +145,74 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Extensions
Assert.Equal(expectedDescriptor, descriptor, TagHelperDescriptorComparer.CaseSensitive);
}
[Fact]
public void CreateDescriptor_ForSyncViewComponentWithInvokeInBaseType_Works()
{
// Arrange
var testCompilation = TestCompilation.Create(_assembly);
var factory = new ViewComponentTagHelperDescriptorFactory(testCompilation);
var expectedDescriptor = TagHelperDescriptorBuilder.Create(
ViewComponentTagHelperConventions.Kind,
"__Generated__SyncDerivedViewComponentTagHelper",
typeof(SyncDerivedViewComponent).GetTypeInfo().Assembly.GetName().Name)
.TypeName("__Generated__SyncDerivedViewComponentTagHelper")
.DisplayName("SyncDerivedViewComponentTagHelper")
.TagMatchingRuleDescriptor(rule =>
rule
.RequireTagName("vc:sync-derived")
.RequireAttributeDescriptor(attribute => attribute.Name("foo"))
.RequireAttributeDescriptor(attribute => attribute.Name("bar")))
.BoundAttributeDescriptor(attribute =>
attribute
.Name("foo")
.PropertyName("foo")
.TypeName(typeof(string).FullName)
.DisplayName("string SyncDerivedViewComponentTagHelper.foo"))
.BoundAttributeDescriptor(attribute =>
attribute
.Name("bar")
.PropertyName("bar")
.TypeName(typeof(string).FullName)
.DisplayName("string SyncDerivedViewComponentTagHelper.bar"))
.AddMetadata(ViewComponentTagHelperMetadata.Name, "SyncDerived")
.Build();
var viewComponent = testCompilation.GetTypeByMetadataName(typeof(SyncDerivedViewComponent).FullName);
// Act
var descriptor = factory.CreateDescriptor(viewComponent);
// Assert
Assert.Equal(expectedDescriptor, descriptor, TagHelperDescriptorComparer.CaseSensitive);
}
[Fact]
public void CreateDescriptor_ForAsyncViewComponentWithInvokeInBaseType_Works()
{
// Arrange
var testCompilation = TestCompilation.Create(_assembly);
var factory = new ViewComponentTagHelperDescriptorFactory(testCompilation);
var expectedDescriptor = TagHelperDescriptorBuilder.Create(
ViewComponentTagHelperConventions.Kind,
"__Generated__AsyncDerivedViewComponentTagHelper",
typeof(AsyncDerivedViewComponent).Assembly.GetName().Name)
.TypeName("__Generated__AsyncDerivedViewComponentTagHelper")
.DisplayName("AsyncDerivedViewComponentTagHelper")
.TagMatchingRuleDescriptor(rule => rule.RequireTagName("vc:async-derived"))
.AddMetadata(ViewComponentTagHelperMetadata.Name, "AsyncDerived")
.Build();
var viewComponent = testCompilation.GetTypeByMetadataName(typeof(AsyncDerivedViewComponent).FullName);
// Act
var descriptor = factory.CreateDescriptor(viewComponent);
// Assert
Assert.Equal(expectedDescriptor, descriptor, TagHelperDescriptorComparer.CaseSensitive);
}
[Fact]
public void CreateDescriptor_AddsDiagnostic_ForViewComponentWithNoInvokeMethod()
{
@ -162,6 +230,40 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Extensions
Assert.Equal(RazorExtensionsDiagnosticFactory.ViewComponent_CannotFindMethod.Id, diagnostic.Id);
}
[Fact]
public void CreateDescriptor_AddsDiagnostic_ForViewComponentWithNoInstanceInvokeMethod()
{
// Arrange
var testCompilation = TestCompilation.Create(_assembly);
var factory = new ViewComponentTagHelperDescriptorFactory(testCompilation);
var viewComponent = testCompilation.GetTypeByMetadataName(typeof(StaticInvokeAsyncViewComponent).FullName);
// Act
var descriptor = factory.CreateDescriptor(viewComponent);
// Assert
var diagnostic = Assert.Single(descriptor.GetAllDiagnostics());
Assert.Equal(RazorExtensionsDiagnosticFactory.ViewComponent_CannotFindMethod.Id, diagnostic.Id);
}
[Fact]
public void CreateDescriptor_AddsDiagnostic_ForViewComponentWithNoPublicInvokeMethod()
{
// Arrange
var testCompilation = TestCompilation.Create(_assembly);
var factory = new ViewComponentTagHelperDescriptorFactory(testCompilation);
var viewComponent = testCompilation.GetTypeByMetadataName(typeof(NonPublicInvokeAsyncViewComponent).FullName);
// Act
var descriptor = factory.CreateDescriptor(viewComponent);
// Assert
var diagnostic = Assert.Single(descriptor.GetAllDiagnostics());
Assert.Equal(RazorExtensionsDiagnosticFactory.ViewComponent_CannotFindMethod.Id, diagnostic.Id);
}
[Fact]
public void CreateDescriptor_ForViewComponentWithInvokeAsync_UnderstandsGenericTask()
{
@ -278,6 +380,23 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Extensions
var diagnostic = Assert.Single(descriptor.GetAllDiagnostics());
Assert.Equal(RazorExtensionsDiagnosticFactory.ViewComponent_SyncMethod_CannotReturnTask.Id, diagnostic.Id);
}
[Fact]
public void CreateDescriptor_ForViewComponent_WithAmbiguousMethods()
{
// Arrange
var testCompilation = TestCompilation.Create(_assembly);
var factory = new ViewComponentTagHelperDescriptorFactory(testCompilation);
var viewComponent = testCompilation.GetTypeByMetadataName(typeof(DerivedViewComponentWithAmbiguity).FullName);
// Act
var descriptor = factory.CreateDescriptor(viewComponent);
// Assert
var diagnostic = Assert.Single(descriptor.GetAllDiagnostics());
Assert.Equal(RazorExtensionsDiagnosticFactory.ViewComponent_AmbiguousMethods.Id, diagnostic.Id);
}
}
public class StringParameterViewComponent
@ -340,4 +459,27 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Extensions
{
public Task<string> Invoke() => null;
}
public class SyncDerivedViewComponent : StringParameterViewComponent
{
}
public class AsyncDerivedViewComponent : AsyncViewComponentWithNonGenericTask
{
}
public class DerivedViewComponentWithAmbiguity : AsyncViewComponentWithNonGenericTask
{
public string Invoke() => null;
}
public class StaticInvokeAsyncViewComponent
{
public static Task<string> InvokeAsync() => null;
}
public class NonPublicInvokeAsyncViewComponent
{
protected Task<string> InvokeAsync() => null;
}
}

View File

@ -552,6 +552,31 @@ namespace Microsoft.AspNetCore.Razor.Design.IntegrationTests
Assert.BuildPassed(result);
}
[Fact]
[InitializeTestProject("AppWithP2PReference", additionalProjects: new[] { "ClassLibrary", "ClassLibraryMvc21" })]
public async Task Build_WithP2P_Referencing21Project_Works()
{
// Verifies building with different versions of Razor.Tasks works. Loosely modeled after the repro
// scenario listed in https://github.com/Microsoft/msbuild/issues/3572
var additionalProjectContent = @"
<ItemGroup>
<ProjectReference Include=""..\ClassLibraryMvc21\ClassLibraryMvc21.csproj"" />
</ItemGroup>
";
AddProjectFileContent(additionalProjectContent);
var result = await DotnetMSBuild(target: default);
Assert.BuildPassed(result);
Assert.FileExists(result, OutputPath, "AppWithP2PReference.dll");
Assert.FileExists(result, OutputPath, "AppWithP2PReference.Views.dll");
Assert.FileExists(result, OutputPath, "ClassLibrary.dll");
Assert.FileExists(result, OutputPath, "ClassLibrary.Views.dll");
Assert.FileExists(result, OutputPath, "ClassLibraryMvc21.dll");
Assert.FileExists(result, OutputPath, "ClassLibraryMvc21.Views.dll");
}
[Fact]
[InitializeTestProject("SimpleMvc")]
public async Task Build_WithStartupObjectSpecified_Works()

View File

@ -17,7 +17,7 @@ namespace Microsoft.AspNetCore.Razor.Design.IntegrationTests
TimeSpan? timeout = null,
MSBuildProcessKind msBuildProcessKind = MSBuildProcessKind.Dotnet)
{
timeout = timeout ?? TimeSpan.FromSeconds(60);
timeout = timeout ?? TimeSpan.FromSeconds(120);
var processStartInfo = new ProcessStartInfo()
{
@ -60,7 +60,7 @@ namespace Microsoft.AspNetCore.Razor.Design.IntegrationTests
process.BeginErrorReadLine();
process.BeginOutputReadLine();
var timeoutTask = Task.Delay(timeout.Value).ContinueWith((t) =>
var timeoutTask = Task.Delay(timeout.Value).ContinueWith<MSBuildResult>((t) =>
{
// Don't timeout during debug sessions
while (Debugger.IsAttached)
@ -68,16 +68,13 @@ namespace Microsoft.AspNetCore.Razor.Design.IntegrationTests
Thread.Sleep(TimeSpan.FromSeconds(1));
}
if (process.HasExited)
if (!process.HasExited)
{
// This will happen on success, the 'real' task has already completed so this value will
// never be visible.
return (MSBuildResult)null;
// This is a timeout.
process.Kill();
}
// This is a timeout.
process.Kill();
throw new TimeoutException($"command '${process.StartInfo.FileName} {process.StartInfo.Arguments}' timed out after {timeout}.");
throw new TimeoutException($"command '${process.StartInfo.FileName} {process.StartInfo.Arguments}' timed out after {timeout}. Output: {output.ToString()}");
});
var waitTask = Task.Run(() =>

View File

@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<!--
@ -41,6 +41,12 @@
<ProjectReference Include="..\..\src\Microsoft.AspNetCore.Razor.Design\Microsoft.AspNetCore.Razor.Design.csproj">
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
</ProjectReference>
<ProjectReference Include="..\..\src\Microsoft.NET.Sdk.Razor\Microsoft.NET.Sdk.Razor.csproj">
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
</ProjectReference>
<ProjectReference Include="..\..\src\Microsoft.AspNetCore.Mvc.Razor.Extensions\Microsoft.AspNetCore.Mvc.Razor.Extensions.csproj">
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
</ProjectReference>
<ProjectReference Include="..\..\src\Microsoft.AspNetCore.Razor.Tools\Microsoft.AspNetCore.Razor.Tools.csproj" />
<ProjectReference Include="..\Microsoft.AspNetCore.Razor.Test.MvcShim.ClassLib\Microsoft.AspNetCore.Razor.Test.MvcShim.ClassLib.csproj" />
</ItemGroup>

View File

@ -13,7 +13,7 @@ namespace Microsoft.CodeAnalysis.Razor
public class CompilationTagHelperFeatureTest
{
[Fact]
public void IsValidCompilation_ReturnsFalseIfITagHelperInterfaceCannotBeFound()
public void IsValidCompilation_ReturnsTrueIfTagHelperInterfaceCannotBeFound()
{
// Arrange
var references = new[]
@ -26,7 +26,7 @@ namespace Microsoft.CodeAnalysis.Razor
var result = CompilationTagHelperFeature.IsValidCompilation(compilation);
// Assert
Assert.False(result);
Assert.True(result);
}
[Fact]

View File

@ -2,6 +2,7 @@
<PropertyGroup>
<_RazorMSBuildRoot>$(SolutionRoot)src\Microsoft.AspNetCore.Razor.Design\bin\$(Configuration)\</_RazorMSBuildRoot>
<RazorSdkBuildTasksDirectoryRoot>$(RazorSdkProjectDirectory)bin\$(Configuration)\</RazorSdkBuildTasksDirectoryRoot>
</PropertyGroup>
<Import Project="$(SolutionRoot)src\Microsoft.AspNetCore.Razor.Design\build\netstandard2.0\Microsoft.AspNetCore.Razor.Design.props" />
@ -26,5 +27,19 @@
<ProjectReference Include="..\ClassLibrary\ClassLibrary.csproj"/>
</ItemGroup>
<ItemGroup Condition="'$(BinariesRoot)'==''">
<!-- In test scenarios $(BinariesRoot) is defined in a generated Directory.Build.props file -->
<ProjectReference Include="..\..\Microsoft.AspNetCore.Razor.Test.MvcShim.ClassLib\Microsoft.AspNetCore.Razor.Test.MvcShim.ClassLib.csproj"/>
<ProjectReference Include="..\..\..\src\Microsoft.AspNetCore.Razor.Runtime\Microsoft.AspNetCore.Razor.Runtime.csproj"/>
<ProjectReference Include="..\..\..\src\Microsoft.AspNetCore.Razor.Design\Microsoft.AspNetCore.Razor.Design.csproj" ReferenceOutputAssembly="false" />
</ItemGroup>
<ItemGroup Condition="'$(BinariesRoot)'!=''">
<Reference Include="$(BinariesRoot)\Microsoft.AspNetCore.Html.Abstractions.dll"/>
<Reference Include="$(BinariesRoot)\Microsoft.AspNetCore.Razor.dll"/>
<Reference Include="$(BinariesRoot)\Microsoft.AspNetCore.Razor.Runtime.dll"/>
<Reference Include="$(BinariesRoot)\Microsoft.AspNetCore.Razor.Test.MvcShim.ClassLib.dll"/>
</ItemGroup>
<Import Project="$(SolutionRoot)src\Microsoft.AspNetCore.Mvc.Razor.Extensions\build\netstandard2.0\Microsoft.AspNetCore.Mvc.Razor.Extensions.targets" />
</Project>

View File

@ -2,6 +2,7 @@
<PropertyGroup>
<_RazorMSBuildRoot>$(SolutionRoot)src\Microsoft.AspNetCore.Razor.Design\bin\$(Configuration)\</_RazorMSBuildRoot>
<RazorSdkBuildTasksDirectoryRoot>$(RazorSdkProjectDirectory)bin\$(Configuration)\</RazorSdkBuildTasksDirectoryRoot>
</PropertyGroup>
<Import Project="$(SolutionRoot)src\Microsoft.AspNetCore.Razor.Design\build\netstandard2.0\Microsoft.AspNetCore.Razor.Design.props" />
@ -26,6 +27,20 @@
<UseRazorBuildServer>false</UseRazorBuildServer>
</PropertyGroup>
<ItemGroup Condition="'$(BinariesRoot)'==''">
<!-- In test scenarios $(BinariesRoot) is defined in a generated Directory.Build.props file -->
<ProjectReference Include="..\..\Microsoft.AspNetCore.Razor.Test.MvcShim.ClassLib\Microsoft.AspNetCore.Razor.Test.MvcShim.ClassLib.csproj"/>
<ProjectReference Include="..\..\..\src\Microsoft.AspNetCore.Razor.Runtime\Microsoft.AspNetCore.Razor.Runtime.csproj"/>
<ProjectReference Include="..\..\..\src\Microsoft.AspNetCore.Razor.Design\Microsoft.AspNetCore.Razor.Design.csproj" ReferenceOutputAssembly="false" />
</ItemGroup>
<ItemGroup Condition="'$(BinariesRoot)'!=''">
<Reference Include="$(BinariesRoot)\Microsoft.AspNetCore.Html.Abstractions.dll"/>
<Reference Include="$(BinariesRoot)\Microsoft.AspNetCore.Razor.dll"/>
<Reference Include="$(BinariesRoot)\Microsoft.AspNetCore.Razor.Runtime.dll"/>
<Reference Include="$(BinariesRoot)\Microsoft.AspNetCore.Razor.Test.MvcShim.ClassLib.dll"/>
</ItemGroup>
<!-- Test Placeholder -->
<Import Project="$(SolutionRoot)src\Microsoft.AspNetCore.Mvc.Razor.Extensions\build\netstandard2.0\Microsoft.AspNetCore.Mvc.Razor.Extensions.targets" />

View File

@ -2,6 +2,7 @@
<PropertyGroup>
<_RazorMSBuildRoot>$(SolutionRoot)src\Microsoft.AspNetCore.Razor.Design\bin\$(Configuration)\</_RazorMSBuildRoot>
<RazorSdkBuildTasksDirectoryRoot>$(RazorSdkProjectDirectory)bin\$(Configuration)\</RazorSdkBuildTasksDirectoryRoot>
</PropertyGroup>
<Import Project="$(SolutionRoot)src\Microsoft.AspNetCore.Razor.Design\build\netstandard2.0\Microsoft.AspNetCore.Razor.Design.props" />
@ -25,6 +26,20 @@
<ProjectReference Include="..\ClassLibrary\ClassLibrary.csproj" />
</ItemGroup>
<ItemGroup Condition="'$(BinariesRoot)'==''">
<!-- In test scenarios $(BinariesRoot) is defined in a generated Directory.Build.props file -->
<ProjectReference Include="..\..\Microsoft.AspNetCore.Razor.Test.MvcShim.ClassLib\Microsoft.AspNetCore.Razor.Test.MvcShim.ClassLib.csproj"/>
<ProjectReference Include="..\..\..\src\Microsoft.AspNetCore.Razor.Runtime\Microsoft.AspNetCore.Razor.Runtime.csproj"/>
<ProjectReference Include="..\..\..\src\Microsoft.AspNetCore.Razor.Design\Microsoft.AspNetCore.Razor.Design.csproj" ReferenceOutputAssembly="false" />
</ItemGroup>
<ItemGroup Condition="'$(BinariesRoot)'!=''">
<Reference Include="$(BinariesRoot)\Microsoft.AspNetCore.Html.Abstractions.dll"/>
<Reference Include="$(BinariesRoot)\Microsoft.AspNetCore.Razor.dll"/>
<Reference Include="$(BinariesRoot)\Microsoft.AspNetCore.Razor.Runtime.dll"/>
<Reference Include="$(BinariesRoot)\Microsoft.AspNetCore.Razor.Test.MvcShim.ClassLib.dll"/>
</ItemGroup>
<!-- Test Placeholder -->
<Import Project="$(SolutionRoot)src\Microsoft.AspNetCore.Mvc.Razor.Extensions\build\netstandard2.0\Microsoft.AspNetCore.Mvc.Razor.Extensions.targets" />

View File

@ -0,0 +1,16 @@
@page
@model ClassLibraryMvc21.MyFeature.Pages.Page1Model
@{
Layout = null;
}
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width" />
<title>Page1</title>
</head>
<body>
</body>
</html>

View File

@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
namespace ClassLibraryMvc21.MyFeature.Pages
{
public class Page1Model : PageModel
{
public void OnGet()
{
}
}
}

View File

@ -0,0 +1,18 @@
<Project Sdk="Microsoft.NET.Sdk.Razor">
<!--
This project references a shipped version of MVC and should not reference local builds of
the CodeGeneration targets, rzc, or any of the test shims.
-->
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="2.1.2">
<!-- Avoid exporting types from real MVC that will conflict with the test shim -->
<PrivateAssets>All</PrivateAssets>
</PackageReference>
</ItemGroup>
</Project>

View File

@ -6,8 +6,10 @@
<SolutionRoot>$([MSBuild]::EnsureTrailingSlash('$(SolutionRoot)'))</SolutionRoot>
<!-- Retarget tests to use the copy of the Sdk from source -->
<RazorSdkCurrentVersionProps>$(SolutionRoot)src\Microsoft.NET.Sdk.Razor\build\netstandard2.0\Sdk.Razor.CurrentVersion.props</RazorSdkCurrentVersionProps>
<RazorSdkCurrentVersionTargets>$(SolutionRoot)src\Microsoft.NET.Sdk.Razor\build\netstandard2.0\Sdk.Razor.CurrentVersion.targets</RazorSdkCurrentVersionTargets>
<RazorSdkProjectDirectory>$(SolutionRoot)src\Microsoft.NET.Sdk.Razor\</RazorSdkProjectDirectory>
<RazorSdkCurrentVersionProps>$(RazorSdkProjectDirectory)build\netstandard2.0\Sdk.Razor.CurrentVersion.props</RazorSdkCurrentVersionProps>
<RazorSdkCurrentVersionTargets>$(RazorSdkProjectDirectory)build\netstandard2.0\Sdk.Razor.CurrentVersion.targets</RazorSdkCurrentVersionTargets>
</PropertyGroup>
<!-- Import solution dependencies.props when building in place -->
@ -25,20 +27,6 @@
<UseRazorBuildServer>false</UseRazorBuildServer>
</PropertyGroup>
<ItemGroup Condition="'$(BinariesRoot)'==''">
<!-- In test scenarios $(BinariesRoot) is defined in a generated Directory.Build.props file -->
<ProjectReference Include="..\..\Microsoft.AspNetCore.Razor.Test.MvcShim.ClassLib\Microsoft.AspNetCore.Razor.Test.MvcShim.ClassLib.csproj"/>
<ProjectReference Include="..\..\..\src\Microsoft.AspNetCore.Razor.Runtime\Microsoft.AspNetCore.Razor.Runtime.csproj"/>
<ProjectReference Include="..\..\..\src\Microsoft.AspNetCore.Razor.Design\Microsoft.AspNetCore.Razor.Design.csproj" ReferenceOutputAssembly="false" />
</ItemGroup>
<ItemGroup Condition="'$(BinariesRoot)'!=''">
<Reference Include="$(BinariesRoot)\Microsoft.AspNetCore.Html.Abstractions.dll"/>
<Reference Include="$(BinariesRoot)\Microsoft.AspNetCore.Razor.dll"/>
<Reference Include="$(BinariesRoot)\Microsoft.AspNetCore.Razor.Runtime.dll"/>
<Reference Include="$(BinariesRoot)\Microsoft.AspNetCore.Razor.Test.MvcShim.ClassLib.dll"/>
</ItemGroup>
<Import Project="After.Directory.Build.props" Condition="Exists('After.Directory.Build.props')" />
</Project>

View File

@ -2,6 +2,7 @@
<PropertyGroup>
<_RazorMSBuildRoot>$(SolutionRoot)src\Microsoft.AspNetCore.Razor.Design\bin\$(Configuration)\</_RazorMSBuildRoot>
<RazorSdkBuildTasksDirectoryRoot>$(RazorSdkProjectDirectory)bin\$(Configuration)\</RazorSdkBuildTasksDirectoryRoot>
</PropertyGroup>
<Import Project="$(SolutionRoot)src\Microsoft.AspNetCore.Razor.Design\build\netstandard2.0\Microsoft.AspNetCore.Razor.Design.props" />
@ -21,6 +22,20 @@
<UseRazorBuildServer>false</UseRazorBuildServer>
</PropertyGroup>
<ItemGroup Condition="'$(BinariesRoot)'==''">
<!-- In test scenarios $(BinariesRoot) is defined in a generated Directory.Build.props file -->
<ProjectReference Include="..\..\Microsoft.AspNetCore.Razor.Test.MvcShim.ClassLib\Microsoft.AspNetCore.Razor.Test.MvcShim.ClassLib.csproj"/>
<ProjectReference Include="..\..\..\src\Microsoft.AspNetCore.Razor.Runtime\Microsoft.AspNetCore.Razor.Runtime.csproj"/>
<ProjectReference Include="..\..\..\src\Microsoft.AspNetCore.Razor.Design\Microsoft.AspNetCore.Razor.Design.csproj" ReferenceOutputAssembly="false" />
</ItemGroup>
<ItemGroup Condition="'$(BinariesRoot)'!=''">
<Reference Include="$(BinariesRoot)\Microsoft.AspNetCore.Html.Abstractions.dll"/>
<Reference Include="$(BinariesRoot)\Microsoft.AspNetCore.Razor.dll"/>
<Reference Include="$(BinariesRoot)\Microsoft.AspNetCore.Razor.Runtime.dll"/>
<Reference Include="$(BinariesRoot)\Microsoft.AspNetCore.Razor.Test.MvcShim.ClassLib.dll"/>
</ItemGroup>
<!-- Test Placeholder -->
<Import Project="$(SolutionRoot)src\Microsoft.AspNetCore.Mvc.Razor.Extensions\build\netstandard2.0\Microsoft.AspNetCore.Mvc.Razor.Extensions.targets" />

View File

@ -2,6 +2,7 @@
<PropertyGroup>
<_RazorMSBuildRoot>$(SolutionRoot)src\Microsoft.AspNetCore.Razor.Design\bin\$(Configuration)\</_RazorMSBuildRoot>
<RazorSdkBuildTasksDirectoryRoot>$(RazorSdkProjectDirectory)bin\$(Configuration)\</RazorSdkBuildTasksDirectoryRoot>
</PropertyGroup>
<Import Project="$(SolutionRoot)src\Microsoft.AspNetCore.Razor.Design\build\netstandard2.0\Microsoft.AspNetCore.Razor.Design.props" />
@ -21,6 +22,20 @@
<UseRazorBuildServer>false</UseRazorBuildServer>
</PropertyGroup>
<ItemGroup Condition="'$(BinariesRoot)'==''">
<!-- In test scenarios $(BinariesRoot) is defined in a generated Directory.Build.props file -->
<ProjectReference Include="..\..\Microsoft.AspNetCore.Razor.Test.MvcShim.ClassLib\Microsoft.AspNetCore.Razor.Test.MvcShim.ClassLib.csproj"/>
<ProjectReference Include="..\..\..\src\Microsoft.AspNetCore.Razor.Runtime\Microsoft.AspNetCore.Razor.Runtime.csproj"/>
<ProjectReference Include="..\..\..\src\Microsoft.AspNetCore.Razor.Design\Microsoft.AspNetCore.Razor.Design.csproj" ReferenceOutputAssembly="false" />
</ItemGroup>
<ItemGroup Condition="'$(BinariesRoot)'!=''">
<Reference Include="$(BinariesRoot)\Microsoft.AspNetCore.Html.Abstractions.dll"/>
<Reference Include="$(BinariesRoot)\Microsoft.AspNetCore.Razor.dll"/>
<Reference Include="$(BinariesRoot)\Microsoft.AspNetCore.Razor.Runtime.dll"/>
<Reference Include="$(BinariesRoot)\Microsoft.AspNetCore.Razor.Test.MvcShim.ClassLib.dll"/>
</ItemGroup>
<!-- Test Placeholder -->
<Import Project="$(SolutionRoot)src\Microsoft.AspNetCore.Mvc.Razor.Extensions\build\netstandard2.0\Microsoft.AspNetCore.Mvc.Razor.Extensions.targets" />

View File

@ -2,6 +2,7 @@
<PropertyGroup>
<_RazorMSBuildRoot>$(SolutionRoot)src\Microsoft.AspNetCore.Razor.Design\bin\$(Configuration)\</_RazorMSBuildRoot>
<RazorSdkBuildTasksDirectoryRoot>$(RazorSdkProjectDirectory)bin\$(Configuration)\</RazorSdkBuildTasksDirectoryRoot>
</PropertyGroup>
<Import Project="$(SolutionRoot)src\Microsoft.AspNetCore.Razor.Design\build\netstandard2.0\Microsoft.AspNetCore.Razor.Design.props" />
@ -26,6 +27,20 @@
<Compile Include="Program.fs" />
</ItemGroup>
<ItemGroup Condition="'$(BinariesRoot)'==''">
<!-- In test scenarios $(BinariesRoot) is defined in a generated Directory.Build.props file -->
<ProjectReference Include="..\..\Microsoft.AspNetCore.Razor.Test.MvcShim.ClassLib\Microsoft.AspNetCore.Razor.Test.MvcShim.ClassLib.csproj"/>
<ProjectReference Include="..\..\..\src\Microsoft.AspNetCore.Razor.Runtime\Microsoft.AspNetCore.Razor.Runtime.csproj"/>
<ProjectReference Include="..\..\..\src\Microsoft.AspNetCore.Razor.Design\Microsoft.AspNetCore.Razor.Design.csproj" ReferenceOutputAssembly="false" />
</ItemGroup>
<ItemGroup Condition="'$(BinariesRoot)'!=''">
<Reference Include="$(BinariesRoot)\Microsoft.AspNetCore.Html.Abstractions.dll"/>
<Reference Include="$(BinariesRoot)\Microsoft.AspNetCore.Razor.dll"/>
<Reference Include="$(BinariesRoot)\Microsoft.AspNetCore.Razor.Runtime.dll"/>
<Reference Include="$(BinariesRoot)\Microsoft.AspNetCore.Razor.Test.MvcShim.ClassLib.dll"/>
</ItemGroup>
<!-- Test Placeholder -->
<Import Project="$(SolutionRoot)src\Microsoft.AspNetCore.Mvc.Razor.Extensions\build\netstandard2.0\Microsoft.AspNetCore.Mvc.Razor.Extensions.targets" />

View File

@ -2,6 +2,7 @@
<PropertyGroup>
<_RazorMSBuildRoot>$(SolutionRoot)src\Microsoft.AspNetCore.Razor.Design\bin\$(Configuration)\</_RazorMSBuildRoot>
<RazorSdkBuildTasksDirectoryRoot>$(RazorSdkProjectDirectory)bin\$(Configuration)\</RazorSdkBuildTasksDirectoryRoot>
</PropertyGroup>
<Import Project="$(SolutionRoot)src\Microsoft.AspNetCore.Razor.Design\build\netstandard2.0\Microsoft.AspNetCore.Razor.Design.props" />
@ -21,6 +22,20 @@
<UseRazorBuildServer>false</UseRazorBuildServer>
</PropertyGroup>
<ItemGroup Condition="'$(BinariesRoot)'==''">
<!-- In test scenarios $(BinariesRoot) is defined in a generated Directory.Build.props file -->
<ProjectReference Include="..\..\Microsoft.AspNetCore.Razor.Test.MvcShim.ClassLib\Microsoft.AspNetCore.Razor.Test.MvcShim.ClassLib.csproj"/>
<ProjectReference Include="..\..\..\src\Microsoft.AspNetCore.Razor.Runtime\Microsoft.AspNetCore.Razor.Runtime.csproj"/>
<ProjectReference Include="..\..\..\src\Microsoft.AspNetCore.Razor.Design\Microsoft.AspNetCore.Razor.Design.csproj" ReferenceOutputAssembly="false" />
</ItemGroup>
<ItemGroup Condition="'$(BinariesRoot)'!=''">
<Reference Include="$(BinariesRoot)\Microsoft.AspNetCore.Html.Abstractions.dll"/>
<Reference Include="$(BinariesRoot)\Microsoft.AspNetCore.Razor.dll"/>
<Reference Include="$(BinariesRoot)\Microsoft.AspNetCore.Razor.Runtime.dll"/>
<Reference Include="$(BinariesRoot)\Microsoft.AspNetCore.Razor.Test.MvcShim.ClassLib.dll"/>
</ItemGroup>
<!-- Test Placeholder -->
<Import Project="$(SolutionRoot)src\Microsoft.AspNetCore.Mvc.Razor.Extensions\build\netstandard2.0\Microsoft.AspNetCore.Mvc.Razor.Extensions.targets" />