Browse Source

Add a transport package for Razor Source Generator (#34520)

Fixes https://github.com/dotnet/aspnetcore/issues/33536
Pranav K 4 years ago
parent
commit
08993388bd

+ 15 - 0
AspNetCore.sln

@@ -1634,6 +1634,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.Http.R
 EndProject
 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Logging.W3C.Sample", "src\Middleware\HttpLogging\samples\Logging.W3C.Sample\Logging.W3C.Sample.csproj", "{17459B97-1AA3-4154-83D3-C6BDC9FA3F85}"
 EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.AspNetCore.Razor.Internal.SourceGenerator.Transport", "src\Razor\Microsoft.AspNetCore.Razor.Internal.SourceGenerator.Transport\Microsoft.AspNetCore.Razor.Internal.SourceGenerator.Transport.csproj", "{247E7B6F-FBA2-41A9-BA03-C7C4DF28091C}"
+EndProject
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
 		Debug|Any CPU = Debug|Any CPU
@@ -7789,6 +7791,18 @@ Global
 		{17459B97-1AA3-4154-83D3-C6BDC9FA3F85}.Release|x64.Build.0 = Release|Any CPU
 		{17459B97-1AA3-4154-83D3-C6BDC9FA3F85}.Release|x86.ActiveCfg = Release|Any CPU
 		{17459B97-1AA3-4154-83D3-C6BDC9FA3F85}.Release|x86.Build.0 = Release|Any CPU
+		{247E7B6F-FBA2-41A9-BA03-C7C4DF28091C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{247E7B6F-FBA2-41A9-BA03-C7C4DF28091C}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{247E7B6F-FBA2-41A9-BA03-C7C4DF28091C}.Debug|x64.ActiveCfg = Debug|Any CPU
+		{247E7B6F-FBA2-41A9-BA03-C7C4DF28091C}.Debug|x64.Build.0 = Debug|Any CPU
+		{247E7B6F-FBA2-41A9-BA03-C7C4DF28091C}.Debug|x86.ActiveCfg = Debug|Any CPU
+		{247E7B6F-FBA2-41A9-BA03-C7C4DF28091C}.Debug|x86.Build.0 = Debug|Any CPU
+		{247E7B6F-FBA2-41A9-BA03-C7C4DF28091C}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{247E7B6F-FBA2-41A9-BA03-C7C4DF28091C}.Release|Any CPU.Build.0 = Release|Any CPU
+		{247E7B6F-FBA2-41A9-BA03-C7C4DF28091C}.Release|x64.ActiveCfg = Release|Any CPU
+		{247E7B6F-FBA2-41A9-BA03-C7C4DF28091C}.Release|x64.Build.0 = Release|Any CPU
+		{247E7B6F-FBA2-41A9-BA03-C7C4DF28091C}.Release|x86.ActiveCfg = Release|Any CPU
+		{247E7B6F-FBA2-41A9-BA03-C7C4DF28091C}.Release|x86.Build.0 = Release|Any CPU
 	EndGlobalSection
 	GlobalSection(SolutionProperties) = preSolution
 		HideSolutionNode = FALSE
@@ -8598,6 +8612,7 @@ Global
 		{092EA9F6-84D4-41EF-A618-BDA50A0E10A8} = {323C3EB6-1D15-4B3D-918D-699D7F64DED9}
 		{F599EAA6-399F-4A91-9B1F-D311305B43D9} = {323C3EB6-1D15-4B3D-918D-699D7F64DED9}
 		{17459B97-1AA3-4154-83D3-C6BDC9FA3F85} = {022B4B80-E813-4256-8034-11A68146F4EF}
+		{247E7B6F-FBA2-41A9-BA03-C7C4DF28091C} = {B27FBAC2-ADA3-4A05-B232-64011B6B2DA3}
 	EndGlobalSection
 	GlobalSection(ExtensibilityGlobals) = postSolution
 		SolutionGuid = {3E8720B3-DBDD-498C-B383-2CC32A054E8F}

+ 4 - 4
src/Razor/Microsoft.AspNetCore.Mvc.Razor.Extensions/src/InjectDirective.cs

@@ -1,4 +1,4 @@
-// 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.
 
 using System;
@@ -17,11 +17,11 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Extensions
             builder =>
             {
                 builder
-                    .AddTypeToken(Resources.InjectDirective_TypeToken_Name, Resources.InjectDirective_TypeToken_Description)
-                    .AddMemberToken(Resources.InjectDirective_MemberToken_Name, Resources.InjectDirective_MemberToken_Description);
+                    .AddTypeToken(RazorExtensionsResources.InjectDirective_TypeToken_Name, RazorExtensionsResources.InjectDirective_TypeToken_Description)
+                    .AddMemberToken(RazorExtensionsResources.InjectDirective_MemberToken_Name, RazorExtensionsResources.InjectDirective_MemberToken_Description);
 
                 builder.Usage = DirectiveUsage.FileScopedMultipleOccurring;
-                builder.Description = Resources.InjectDirective_Description;
+                builder.Description = RazorExtensionsResources.InjectDirective_Description;
             });
 
         public static RazorProjectEngineBuilder Register(RazorProjectEngineBuilder builder)

+ 3 - 3
src/Razor/Microsoft.AspNetCore.Mvc.Razor.Extensions/src/ModelDirective.cs

@@ -1,4 +1,4 @@
-// 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.
 
 using System;
@@ -16,9 +16,9 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Extensions
             DirectiveKind.SingleLine,
             builder =>
             {
-                builder.AddTypeToken(Resources.ModelDirective_TypeToken_Name, Resources.ModelDirective_TypeToken_Description);
+                builder.AddTypeToken(RazorExtensionsResources.ModelDirective_TypeToken_Name, RazorExtensionsResources.ModelDirective_TypeToken_Description);
                 builder.Usage = DirectiveUsage.FileScopedSinglyOccurring;
-                builder.Description = Resources.ModelDirective_Description;
+                builder.Description = RazorExtensionsResources.ModelDirective_Description;
             });
 
         public static RazorProjectEngineBuilder Register(RazorProjectEngineBuilder builder)

+ 3 - 3
src/Razor/Microsoft.AspNetCore.Mvc.Razor.Extensions/src/PageDirective.cs

@@ -1,4 +1,4 @@
-// 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.
 
 using System;
@@ -17,9 +17,9 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Extensions
             DirectiveKind.SingleLine,
             builder =>
             {
-                builder.AddOptionalStringToken(Resources.PageDirective_RouteToken_Name, Resources.PageDirective_RouteToken_Description);
+                builder.AddOptionalStringToken(RazorExtensionsResources.PageDirective_RouteToken_Name, RazorExtensionsResources.PageDirective_RouteToken_Description);
                 builder.Usage = DirectiveUsage.FileScopedSinglyOccurring;
-                builder.Description = Resources.PageDirective_Description;
+                builder.Description = RazorExtensionsResources.PageDirective_Description;
             });
 
         private PageDirective(string routeTemplate, IntermediateNode directiveNode)

+ 8 - 10
src/Razor/Microsoft.AspNetCore.Mvc.Razor.Extensions/src/RazorExtensionsDiagnosticFactory.cs

@@ -1,4 +1,4 @@
-// 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.
 
 using System.IO;
@@ -14,7 +14,7 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Extensions
         internal static readonly RazorDiagnosticDescriptor ViewComponent_CannotFindMethod =
             new RazorDiagnosticDescriptor(
                 $"{DiagnosticPrefix}3900",
-                () => ViewComponentResources.ViewComponent_CannotFindMethod,
+                () => RazorExtensionsResources.ViewComponent_CannotFindMethod,
                 RazorDiagnosticSeverity.Error);
 
         public static RazorDiagnostic CreateViewComponent_CannotFindMethod(string tagHelperType)
@@ -32,7 +32,7 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Extensions
         internal static readonly RazorDiagnosticDescriptor ViewComponent_AmbiguousMethods =
             new RazorDiagnosticDescriptor(
                 $"{DiagnosticPrefix}3901",
-                () => ViewComponentResources.ViewComponent_AmbiguousMethods,
+                () => RazorExtensionsResources.ViewComponent_AmbiguousMethods,
                 RazorDiagnosticSeverity.Error);
 
         public static RazorDiagnostic CreateViewComponent_AmbiguousMethods(string tagHelperType)
@@ -50,7 +50,7 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Extensions
         internal static readonly RazorDiagnosticDescriptor ViewComponent_AsyncMethod_ShouldReturnTask =
             new RazorDiagnosticDescriptor(
                 $"{DiagnosticPrefix}3902",
-                () => ViewComponentResources.ViewComponent_AsyncMethod_ShouldReturnTask,
+                () => RazorExtensionsResources.ViewComponent_AsyncMethod_ShouldReturnTask,
                 RazorDiagnosticSeverity.Error);
 
         public static RazorDiagnostic CreateViewComponent_AsyncMethod_ShouldReturnTask(string tagHelperType)
@@ -68,7 +68,7 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Extensions
         internal static readonly RazorDiagnosticDescriptor ViewComponent_SyncMethod_ShouldReturnValue =
             new RazorDiagnosticDescriptor(
                 $"{DiagnosticPrefix}3903",
-                () => ViewComponentResources.ViewComponent_SyncMethod_ShouldReturnValue,
+                () => RazorExtensionsResources.ViewComponent_SyncMethod_ShouldReturnValue,
                 RazorDiagnosticSeverity.Error);
 
         public static RazorDiagnostic CreateViewComponent_SyncMethod_ShouldReturnValue(string tagHelperType)
@@ -85,7 +85,7 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Extensions
         internal static readonly RazorDiagnosticDescriptor ViewComponent_SyncMethod_CannotReturnTask =
             new RazorDiagnosticDescriptor(
                 $"{DiagnosticPrefix}3904",
-                () => ViewComponentResources.ViewComponent_SyncMethod_CannotReturnTask,
+                () => RazorExtensionsResources.ViewComponent_SyncMethod_CannotReturnTask,
                 RazorDiagnosticSeverity.Error);
 
         public static RazorDiagnostic CreateViewComponent_SyncMethod_CannotReturnTask(string tagHelperType)
@@ -103,7 +103,7 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Extensions
         internal static readonly RazorDiagnosticDescriptor PageDirective_CannotBeImported =
             new RazorDiagnosticDescriptor(
                 $"{DiagnosticPrefix}3905",
-                () => Resources.PageDirectiveCannotBeImported,
+                () => RazorExtensionsResources.PageDirectiveCannotBeImported,
                 RazorDiagnosticSeverity.Error);
 
         public static RazorDiagnostic CreatePageDirective_CannotBeImported(SourceSpan source)
@@ -117,14 +117,12 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Extensions
         internal static readonly RazorDiagnosticDescriptor PageDirective_MustExistAtTheTopOfFile =
             new RazorDiagnosticDescriptor(
                 $"{DiagnosticPrefix}3906",
-                () => Resources.PageDirectiveMustExistAtTheTopOfFile,
+                () => RazorExtensionsResources.PageDirectiveMustExistAtTheTopOfFile,
                 RazorDiagnosticSeverity.Error);
 
         public static RazorDiagnostic CreatePageDirective_MustExistAtTheTopOfFile(SourceSpan source)
         {
-            var fileName = Path.GetFileName(source.FilePath);
             var diagnostic = RazorDiagnostic.Create(PageDirective_MustExistAtTheTopOfFile, source, PageDirective.Directive.Directive);
-
             return diagnostic;
         }
     }

+ 15 - 0
src/Razor/Microsoft.AspNetCore.Mvc.Razor.Extensions/src/Resources.resx → src/Razor/Microsoft.AspNetCore.Mvc.Razor.Extensions/src/RazorExtensionsResources.resx

@@ -174,4 +174,19 @@
   <data name="PageDirective_RouteToken_Name" xml:space="preserve">
     <value>RouteTemplate</value>
   </data>
+  <data name="ViewComponent_AmbiguousMethods" xml:space="preserve">
+    <value>View component '{0}' must have exactly one public method named '{1}' or '{2}'.</value>
+  </data>
+  <data name="ViewComponent_AsyncMethod_ShouldReturnTask" xml:space="preserve">
+    <value>Method '{0}' of view component '{1}' should be declared to return {2}&amp;lt;T&amp;gt;.</value>
+  </data>
+  <data name="ViewComponent_CannotFindMethod" xml:space="preserve">
+    <value>Could not find an '{0}' or '{1}' method for the view component '{2}'.</value>
+  </data>
+  <data name="ViewComponent_SyncMethod_CannotReturnTask" xml:space="preserve">
+    <value>Method '{0}' of view component '{1}' cannot return a {2}.</value>
+  </data>
+  <data name="ViewComponent_SyncMethod_ShouldReturnValue" xml:space="preserve">
+    <value>Method '{0}' of view component '{1}' should be declared to return a value.</value>
+  </data>
 </root>

+ 0 - 135
src/Razor/Microsoft.AspNetCore.Mvc.Razor.Extensions/src/ViewComponentResources.resx

@@ -1,135 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<root>
-  <!-- 
-    Microsoft ResX Schema 
-    
-    Version 2.0
-    
-    The primary goals of this format is to allow a simple XML format 
-    that is mostly human readable. The generation and parsing of the 
-    various data types are done through the TypeConverter classes 
-    associated with the data types.
-    
-    Example:
-    
-    ... ado.net/XML headers & schema ...
-    <resheader name="resmimetype">text/microsoft-resx</resheader>
-    <resheader name="version">2.0</resheader>
-    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
-    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
-    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
-    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
-    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
-        <value>[base64 mime encoded serialized .NET Framework object]</value>
-    </data>
-    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
-        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
-        <comment>This is a comment</comment>
-    </data>
-                
-    There are any number of "resheader" rows that contain simple 
-    name/value pairs.
-    
-    Each data row contains a name, and value. The row also contains a 
-    type or mimetype. Type corresponds to a .NET class that support 
-    text/value conversion through the TypeConverter architecture. 
-    Classes that don't support this are serialized and stored with the 
-    mimetype set.
-    
-    The mimetype is used for serialized objects, and tells the 
-    ResXResourceReader how to depersist the object. This is currently not 
-    extensible. For a given mimetype the value must be set accordingly:
-    
-    Note - application/x-microsoft.net.object.binary.base64 is the format 
-    that the ResXResourceWriter will generate, however the reader can 
-    read any of the formats listed below.
-    
-    mimetype: application/x-microsoft.net.object.binary.base64
-    value   : The object must be serialized with 
-            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
-            : and then encoded with base64 encoding.
-    
-    mimetype: application/x-microsoft.net.object.soap.base64
-    value   : The object must be serialized with 
-            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
-            : and then encoded with base64 encoding.
-
-    mimetype: application/x-microsoft.net.object.bytearray.base64
-    value   : The object must be serialized into a byte array 
-            : using a System.ComponentModel.TypeConverter
-            : and then encoded with base64 encoding.
-    -->
-  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
-    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
-    <xsd:element name="root" msdata:IsDataSet="true">
-      <xsd:complexType>
-        <xsd:choice maxOccurs="unbounded">
-          <xsd:element name="metadata">
-            <xsd:complexType>
-              <xsd:sequence>
-                <xsd:element name="value" type="xsd:string" minOccurs="0" />
-              </xsd:sequence>
-              <xsd:attribute name="name" use="required" type="xsd:string" />
-              <xsd:attribute name="type" type="xsd:string" />
-              <xsd:attribute name="mimetype" type="xsd:string" />
-              <xsd:attribute ref="xml:space" />
-            </xsd:complexType>
-          </xsd:element>
-          <xsd:element name="assembly">
-            <xsd:complexType>
-              <xsd:attribute name="alias" type="xsd:string" />
-              <xsd:attribute name="name" type="xsd:string" />
-            </xsd:complexType>
-          </xsd:element>
-          <xsd:element name="data">
-            <xsd:complexType>
-              <xsd:sequence>
-                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
-                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
-              </xsd:sequence>
-              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
-              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
-              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
-              <xsd:attribute ref="xml:space" />
-            </xsd:complexType>
-          </xsd:element>
-          <xsd:element name="resheader">
-            <xsd:complexType>
-              <xsd:sequence>
-                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
-              </xsd:sequence>
-              <xsd:attribute name="name" type="xsd:string" use="required" />
-            </xsd:complexType>
-          </xsd:element>
-        </xsd:choice>
-      </xsd:complexType>
-    </xsd:element>
-  </xsd:schema>
-  <resheader name="resmimetype">
-    <value>text/microsoft-resx</value>
-  </resheader>
-  <resheader name="version">
-    <value>2.0</value>
-  </resheader>
-  <resheader name="reader">
-    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
-  </resheader>
-  <resheader name="writer">
-    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
-  </resheader>
-  <data name="ViewComponent_AmbiguousMethods" xml:space="preserve">
-    <value>View component '{0}' must have exactly one public method named '{1}' or '{2}'.</value>
-  </data>
-  <data name="ViewComponent_AsyncMethod_ShouldReturnTask" xml:space="preserve">
-    <value>Method '{0}' of view component '{1}' should be declared to return {2}&amp;lt;T&amp;gt;.</value>
-  </data>
-  <data name="ViewComponent_CannotFindMethod" xml:space="preserve">
-    <value>Could not find an '{0}' or '{1}' method for the view component '{2}'.</value>
-  </data>
-  <data name="ViewComponent_SyncMethod_CannotReturnTask" xml:space="preserve">
-    <value>Method '{0}' of view component '{1}' cannot return a {2}.</value>
-  </data>
-  <data name="ViewComponent_SyncMethod_ShouldReturnValue" xml:space="preserve">
-    <value>Method '{0}' of view component '{1}' should be declared to return a value.</value>
-  </data>
-</root>

+ 37 - 0
src/Razor/Microsoft.AspNetCore.Razor.Internal.SourceGenerator.Transport/Microsoft.AspNetCore.Razor.Internal.SourceGenerator.Transport.csproj

@@ -0,0 +1,37 @@
+<Project Sdk="Microsoft.NET.Sdk">
+
+  <PropertyGroup>
+    <Description>Transport package for Razor Source Generator support.</Description>
+    <TargetFramework>netstandard2.0</TargetFramework>
+    <PublishWindowsPdb>true</PublishWindowsPdb>
+    <!-- Need to build this project in source build -->
+    <ExcludeFromSourceBuild>false</ExcludeFromSourceBuild>
+    <AddPublicApiAnalyzers>false</AddPublicApiAnalyzers>
+    <IsPackable>true</IsPackable>
+    <IsShipping>false</IsShipping>
+  </PropertyGroup>
+
+  <ItemGroup>
+    <Compile Include="$(SharedSourceRoot)HashCodeCombiner\HashCodeCombiner.cs" />
+
+    <Compile Include="..\Microsoft.AspNetCore.Razor.Language\src\**\*.cs" LinkBase="Language" />
+    <EmbeddedResource Include="..\Microsoft.AspNetCore.Razor.Language\src\Resources.resx"
+      ClassName="Microsoft.AspNetCore.Razor.Language.Resources" />
+    <EmbeddedResource Include="..\Microsoft.AspNetCore.Razor.Language\src\ComponentResources.resx"
+      ClassName="Microsoft.AspNetCore.Razor.Language.ComponentResources" />
+
+    <Compile Include="..\Microsoft.CodeAnalysis.Razor\src\**\*.cs" LinkBase="CodeAnalysis" />
+    <EmbeddedResource Include="..\Microsoft.CodeAnalysis.Razor\src\CodeAnalysisResources.resx"
+       ClassName="Microsoft.CodeAnalysis.Razor.CodeAnalysisResources" />
+
+    <Compile Include="..\Microsoft.AspNetCore.Mvc.Razor.Extensions\src\**\*.cs" LinkBase="RazorExtensions" />
+    <EmbeddedResource Include="..\Microsoft.AspNetCore.Mvc.Razor.Extensions\src\RazorExtensionsResources.resx"
+      ClassName="Microsoft.AspNetCore.Mvc.Razor.Extensions.RazorExtensionsResources" />
+  </ItemGroup>
+
+  <ItemGroup>
+    <Reference Include="Microsoft.CodeAnalysis.Common" />
+    <Reference Include="Microsoft.CodeAnalysis.CSharp" />
+  </ItemGroup>
+
+</Project>

+ 0 - 0
src/Razor/Microsoft.CodeAnalysis.Razor/src/Resources.resx → src/Razor/Microsoft.CodeAnalysis.Razor/src/CodeAnalysisResources.resx


+ 9 - 9
src/Razor/Microsoft.CodeAnalysis.Razor/src/RazorDiagnosticFactory.cs

@@ -1,4 +1,4 @@
-// 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.
 
 using Microsoft.AspNetCore.Razor.Language;
@@ -37,7 +37,7 @@ namespace Microsoft.CodeAnalysis.Razor
         internal static readonly RazorDiagnosticDescriptor TagHelper_InvalidAttributeNameNullOrEmpty =
             new RazorDiagnosticDescriptor(
                 $"{DiagnosticPrefix}3500",
-                () => Resources.TagHelper_InvalidAttributeNameNotNullOrEmpty,
+                () => CodeAnalysisResources.TagHelper_InvalidAttributeNameNotNullOrEmpty,
                 RazorDiagnosticSeverity.Error);
         public static RazorDiagnostic CreateTagHelper_InvalidAttributeNameNullOrEmpty(string tagHelperDisplayName, string propertyDisplayName)
         {
@@ -55,7 +55,7 @@ namespace Microsoft.CodeAnalysis.Razor
         internal static readonly RazorDiagnosticDescriptor TagHelper_InvalidAttributePrefixNotNull =
             new RazorDiagnosticDescriptor(
                 $"{DiagnosticPrefix}3501",
-                () => Resources.TagHelper_InvalidAttributePrefixNotNull,
+                () => CodeAnalysisResources.TagHelper_InvalidAttributePrefixNotNull,
                 RazorDiagnosticSeverity.Error);
         public static RazorDiagnostic CreateTagHelper_InvalidAttributePrefixNotNull(string tagHelperDisplayName, string propertyDisplayName)
         {
@@ -74,7 +74,7 @@ namespace Microsoft.CodeAnalysis.Razor
         internal static readonly RazorDiagnosticDescriptor TagHelper_InvalidAttributePrefixNull =
             new RazorDiagnosticDescriptor(
                 $"{DiagnosticPrefix}3502",
-                () => Resources.TagHelper_InvalidAttributePrefixNull,
+                () => CodeAnalysisResources.TagHelper_InvalidAttributePrefixNull,
                 RazorDiagnosticSeverity.Error);
         public static RazorDiagnostic CreateTagHelper_InvalidAttributePrefixNull(string tagHelperDisplayName, string propertyDisplayName)
         {
@@ -93,7 +93,7 @@ namespace Microsoft.CodeAnalysis.Razor
         internal static readonly RazorDiagnosticDescriptor TagHelper_InvalidRequiredAttributeCharacter =
             new RazorDiagnosticDescriptor(
                 $"{DiagnosticPrefix}3503",
-                () => Resources.TagHelper_InvalidRequiredAttributeCharacter,
+                () => CodeAnalysisResources.TagHelper_InvalidRequiredAttributeCharacter,
                 RazorDiagnosticSeverity.Error);
         public static RazorDiagnostic CreateTagHelper_InvalidRequiredAttributeCharacter(char invalidCharacter, string requiredAttributes)
         {
@@ -109,7 +109,7 @@ namespace Microsoft.CodeAnalysis.Razor
         internal static readonly RazorDiagnosticDescriptor TagHelper_PartialRequiredAttributeOperator =
             new RazorDiagnosticDescriptor(
                 $"{DiagnosticPrefix}3504",
-                () => Resources.TagHelper_PartialRequiredAttributeOperator,
+                () => CodeAnalysisResources.TagHelper_PartialRequiredAttributeOperator,
                 RazorDiagnosticSeverity.Error);
         public static RazorDiagnostic CreateTagHelper_PartialRequiredAttributeOperator(char partialOperator, string requiredAttributes)
         {
@@ -125,7 +125,7 @@ namespace Microsoft.CodeAnalysis.Razor
         internal static readonly RazorDiagnosticDescriptor TagHelper_InvalidRequiredAttributeOperator =
             new RazorDiagnosticDescriptor(
                 $"{DiagnosticPrefix}3505",
-                () => Resources.TagHelper_InvalidRequiredAttributeOperator,
+                () => CodeAnalysisResources.TagHelper_InvalidRequiredAttributeOperator,
                 RazorDiagnosticSeverity.Error);
         public static RazorDiagnostic CreateTagHelper_InvalidRequiredAttributeOperator(char invalidOperator, string requiredAttributes)
         {
@@ -141,7 +141,7 @@ namespace Microsoft.CodeAnalysis.Razor
         internal static readonly RazorDiagnosticDescriptor TagHelper_InvalidRequiredAttributeMismatchedQuotes =
             new RazorDiagnosticDescriptor(
                 $"{DiagnosticPrefix}3506",
-                () => Resources.TagHelper_InvalidRequiredAttributeMismatchedQuotes,
+                () => CodeAnalysisResources.TagHelper_InvalidRequiredAttributeMismatchedQuotes,
                 RazorDiagnosticSeverity.Error);
         public static RazorDiagnostic CreateTagHelper_InvalidRequiredAttributeMismatchedQuotes(char quote, string requiredAttributes)
         {
@@ -157,7 +157,7 @@ namespace Microsoft.CodeAnalysis.Razor
         internal static readonly RazorDiagnosticDescriptor TagHelper_CouldNotFindMatchingEndBrace =
             new RazorDiagnosticDescriptor(
                 $"{DiagnosticPrefix}3507",
-                () => Resources.TagHelper_CouldNotFindMatchingEndBrace,
+                () => CodeAnalysisResources.TagHelper_CouldNotFindMatchingEndBrace,
                 RazorDiagnosticSeverity.Error);
         public static RazorDiagnostic CreateTagHelper_CouldNotFindMatchingEndBrace(string requiredAttributes)
         {

+ 14 - 13
src/Razor/Razor.slnf

@@ -1,30 +1,31 @@
-{
+{
   "solution": {
     "path": "..\\..\\AspNetCore.sln",
-    "projects" : [
-      "src\\Razor\\Razor\\src\\Microsoft.AspNetCore.Razor.csproj",
-      "src\\Razor\\Razor\\test\\Microsoft.AspNetCore.Razor.Test.csproj",
-      "src\\Razor\\Razor.Runtime\\src\\Microsoft.AspNetCore.Razor.Runtime.csproj",
-      "src\\Razor\\Razor.Runtime\\test\\Microsoft.AspNetCore.Razor.Runtime.Test.csproj",
-      "src\\Razor\\Microsoft.AspNetCore.Mvc.Razor.Extensions\\src\\Microsoft.AspNetCore.Mvc.Razor.Extensions.csproj",
-      "src\\Razor\\Microsoft.AspNetCore.Mvc.Razor.Extensions\\test\\Microsoft.AspNetCore.Mvc.Razor.Extensions.Test.csproj",
+    "projects": [
       "src\\Razor\\Microsoft.AspNetCore.Mvc.Razor.Extensions.Version1_X\\src\\Microsoft.AspNetCore.Mvc.Razor.Extensions.Version1_X.csproj",
       "src\\Razor\\Microsoft.AspNetCore.Mvc.Razor.Extensions.Version1_X\\test\\Microsoft.AspNetCore.Mvc.Razor.Extensions.Version1_X.Test.csproj",
       "src\\Razor\\Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X\\src\\Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X.csproj",
       "src\\Razor\\Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X\\test\\Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X.Test.csproj",
+      "src\\Razor\\Microsoft.AspNetCore.Mvc.Razor.Extensions\\src\\Microsoft.AspNetCore.Mvc.Razor.Extensions.csproj",
+      "src\\Razor\\Microsoft.AspNetCore.Mvc.Razor.Extensions\\test\\Microsoft.AspNetCore.Mvc.Razor.Extensions.Test.csproj",
       "src\\Razor\\Microsoft.AspNetCore.Razor.Language\\src\\Microsoft.AspNetCore.Razor.Language.csproj",
       "src\\Razor\\Microsoft.AspNetCore.Razor.Language\\test\\Microsoft.AspNetCore.Razor.Language.Test.csproj",
+      "src\\Razor\\Microsoft.AspNetCore.Razor.Internal.SourceGenerator.Transport\\Microsoft.AspNetCore.Razor.Internal.SourceGenerator.Transport.csproj",
       "src\\Razor\\Microsoft.CodeAnalysis.Razor\\src\\Microsoft.CodeAnalysis.Razor.csproj",
       "src\\Razor\\Microsoft.CodeAnalysis.Razor\\test\\Microsoft.CodeAnalysis.Razor.Test.csproj",
-      "src\\Razor\\tools\\Microsoft.AspNetCore.Razor.Internal.Transport\\Microsoft.AspNetCore.Razor.Internal.Transport.csproj",
-      "src\\Razor\\tools\\RazorSyntaxGenerator\\RazorSyntaxGenerator.csproj",
+      "src\\Razor\\Razor.Runtime\\src\\Microsoft.AspNetCore.Razor.Runtime.csproj",
+      "src\\Razor\\Razor.Runtime\\test\\Microsoft.AspNetCore.Razor.Runtime.Test.csproj",
+      "src\\Razor\\Razor\\src\\Microsoft.AspNetCore.Razor.csproj",
+      "src\\Razor\\Razor\\test\\Microsoft.AspNetCore.Razor.Test.csproj",
       "src\\Razor\\perf\\Microbenchmarks\\Microsoft.AspNetCore.Razor.Microbenchmarks.csproj",
       "src\\Razor\\test\\Microsoft.AspNetCore.Razor.Test.Common\\Microsoft.AspNetCore.Razor.Test.Common.csproj",
       "src\\Razor\\test\\Microsoft.AspNetCore.Razor.Test.ComponentShim\\Microsoft.AspNetCore.Razor.Test.ComponentShim.csproj",
-      "src\\Razor\\test\\Microsoft.AspNetCore.Razor.Test.MvcShim\\Microsoft.AspNetCore.Razor.Test.MvcShim.csproj",
       "src\\Razor\\test\\Microsoft.AspNetCore.Razor.Test.MvcShim.ClassLib\\Microsoft.AspNetCore.Razor.Test.MvcShim.ClassLib.csproj",
       "src\\Razor\\test\\Microsoft.AspNetCore.Razor.Test.MvcShim.Version1_X\\Microsoft.AspNetCore.Razor.Test.MvcShim.Version1_X.csproj",
-      "src\\Razor\\test\\Microsoft.AspNetCore.Razor.Test.MvcShim.Version2_X\\Microsoft.AspNetCore.Razor.Test.MvcShim.Version2_X.csproj"
+      "src\\Razor\\test\\Microsoft.AspNetCore.Razor.Test.MvcShim.Version2_X\\Microsoft.AspNetCore.Razor.Test.MvcShim.Version2_X.csproj",
+      "src\\Razor\\test\\Microsoft.AspNetCore.Razor.Test.MvcShim\\Microsoft.AspNetCore.Razor.Test.MvcShim.csproj",
+      "src\\Razor\\tools\\Microsoft.AspNetCore.Razor.Internal.Transport\\Microsoft.AspNetCore.Razor.Internal.Transport.csproj",
+      "src\\Razor\\tools\\RazorSyntaxGenerator\\RazorSyntaxGenerator.csproj"
     ]
   }
-}
+}