diff --git a/src/Microsoft.AspNet.Mvc.Razor.Host/MvcCSharpCodeGenerator.cs b/src/Microsoft.AspNet.Mvc.Razor.Host/MvcCSharpCodeGenerator.cs index 7c434d54fe..78b6fba6dd 100644 --- a/src/Microsoft.AspNet.Mvc.Razor.Host/MvcCSharpCodeGenerator.cs +++ b/src/Microsoft.AspNet.Mvc.Razor.Host/MvcCSharpCodeGenerator.cs @@ -53,7 +53,7 @@ protected override CSharpCodeWritingScope BuildClassDeclaration(CSharpCodeWriter string.Equals( Path.GetFileName(Context.SourceFile), ViewHierarchyUtility.ViewImportsFileName, - StringComparison.Ordinal)) + StringComparison.OrdinalIgnoreCase)) { // Write a using TModel = System.Object; token during design time to make intellisense work writer.WriteLine($"using {ChunkHelper.TModelToken} = {typeof(object).FullName};"); diff --git a/test/Microsoft.AspNet.Mvc.Razor.Host.Test/MvcRazorHostTest.cs b/test/Microsoft.AspNet.Mvc.Razor.Host.Test/MvcRazorHostTest.cs index 4c987624d2..d06adb614a 100644 --- a/test/Microsoft.AspNet.Mvc.Razor.Host.Test/MvcRazorHostTest.cs +++ b/test/Microsoft.AspNet.Mvc.Razor.Host.Test/MvcRazorHostTest.cs @@ -478,7 +478,8 @@ private static void RunDesignTimeTest( GeneratorResults results; using (var stream = ResourceFile.GetResourceStream(_assembly, inputFile, sourceFile: true)) { - results = host.GenerateCode(inputFile, stream); + // VS tooling passes in paths in all lower case. We'll mimic this behavior in our tests. + results = host.GenerateCode(inputFile.ToLowerInvariant(), stream); } // Assert diff --git a/test/Microsoft.AspNet.Mvc.Razor.Host.Test/TestFiles/Output/DesignTime/Basic.cs b/test/Microsoft.AspNet.Mvc.Razor.Host.Test/TestFiles/Output/DesignTime/Basic.cs index 12b8fe71b3..956b7cbb40 100644 --- a/test/Microsoft.AspNet.Mvc.Razor.Host.Test/TestFiles/Output/DesignTime/Basic.cs +++ b/test/Microsoft.AspNet.Mvc.Razor.Host.Test/TestFiles/Output/DesignTime/Basic.cs @@ -2,7 +2,7 @@ namespace Asp { using System.Threading.Tasks; - public class ASPV_TestFiles_Input_Basic_cshtml : Microsoft.AspNet.Mvc.Razor.RazorPage + public class ASPV_testfiles_input_basic_cshtml : Microsoft.AspNet.Mvc.Razor.RazorPage { private static object @__o; private void @__RazorDesignTimeHelpers__() @@ -11,7 +11,7 @@ private void @__RazorDesignTimeHelpers__() #pragma warning restore 219 } #line hidden - public ASPV_TestFiles_Input_Basic_cshtml() + public ASPV_testfiles_input_basic_cshtml() { } #line hidden @@ -29,12 +29,12 @@ public ASPV_TestFiles_Input_Basic_cshtml() #pragma warning disable 1998 public override async Task ExecuteAsync() { -#line 1 "TestFiles/Input/Basic.cshtml" +#line 1 "testfiles/input/basic.cshtml" __o = logo; #line default #line hidden -#line 3 "TestFiles/Input/Basic.cshtml" +#line 3 "testfiles/input/basic.cshtml" __o = Html.Input("SomeKey"); #line default diff --git a/test/Microsoft.AspNet.Mvc.Razor.Host.Test/TestFiles/Output/DesignTime/Inject.cs b/test/Microsoft.AspNet.Mvc.Razor.Host.Test/TestFiles/Output/DesignTime/Inject.cs index daeb196d90..f60ec6a112 100644 --- a/test/Microsoft.AspNet.Mvc.Razor.Host.Test/TestFiles/Output/DesignTime/Inject.cs +++ b/test/Microsoft.AspNet.Mvc.Razor.Host.Test/TestFiles/Output/DesignTime/Inject.cs @@ -1,6 +1,6 @@ namespace Asp { -#line 1 "TestFiles/Input/Inject.cshtml" +#line 1 "testfiles/input/inject.cshtml" using MyNamespace #line default @@ -8,7 +8,7 @@ namespace Asp ; using System.Threading.Tasks; - public class ASPV_TestFiles_Input_Inject_cshtml : Microsoft.AspNet.Mvc.Razor.RazorPage + public class ASPV_testfiles_input_inject_cshtml : Microsoft.AspNet.Mvc.Razor.RazorPage { private static object @__o; private void @__RazorDesignTimeHelpers__() @@ -17,13 +17,13 @@ private void @__RazorDesignTimeHelpers__() #pragma warning restore 219 } #line hidden - public ASPV_TestFiles_Input_Inject_cshtml() + public ASPV_testfiles_input_inject_cshtml() { } #line hidden [Microsoft.AspNet.Mvc.Razor.Internal.RazorInjectAttribute] public -#line 2 "TestFiles/Input/Inject.cshtml" +#line 2 "testfiles/input/inject.cshtml" MyApp MyPropertyName #line default diff --git a/test/Microsoft.AspNet.Mvc.Razor.Host.Test/TestFiles/Output/DesignTime/InjectWithModel.cs b/test/Microsoft.AspNet.Mvc.Razor.Host.Test/TestFiles/Output/DesignTime/InjectWithModel.cs index d493fee840..49752f998d 100644 --- a/test/Microsoft.AspNet.Mvc.Razor.Host.Test/TestFiles/Output/DesignTime/InjectWithModel.cs +++ b/test/Microsoft.AspNet.Mvc.Razor.Host.Test/TestFiles/Output/DesignTime/InjectWithModel.cs @@ -2,13 +2,13 @@ namespace Asp { using System.Threading.Tasks; - public class ASPV_TestFiles_Input_InjectWithModel_cshtml : Microsoft.AspNet.Mvc.Razor.RazorPage + public class ASPV_testfiles_input_injectwithmodel_cshtml : Microsoft.AspNet.Mvc.Razor.RazorPage { private static object @__o; private void @__RazorDesignTimeHelpers__() { #pragma warning disable 219 -#line 1 "TestFiles/Input/InjectWithModel.cshtml" +#line 1 "testfiles/input/injectwithmodel.cshtml" var __modelHelper = default(MyModel); #line default @@ -16,13 +16,13 @@ private void @__RazorDesignTimeHelpers__() #pragma warning restore 219 } #line hidden - public ASPV_TestFiles_Input_InjectWithModel_cshtml() + public ASPV_testfiles_input_injectwithmodel_cshtml() { } #line hidden [Microsoft.AspNet.Mvc.Razor.Internal.RazorInjectAttribute] public -#line 2 "TestFiles/Input/InjectWithModel.cshtml" +#line 2 "testfiles/input/injectwithmodel.cshtml" MyApp MyPropertyName #line default @@ -30,7 +30,7 @@ MyApp MyPropertyName { get; private set; } [Microsoft.AspNet.Mvc.Razor.Internal.RazorInjectAttribute] public -#line 3 "TestFiles/Input/InjectWithModel.cshtml" +#line 3 "testfiles/input/injectwithmodel.cshtml" MyService Html #line default diff --git a/test/Microsoft.AspNet.Mvc.Razor.Host.Test/TestFiles/Output/DesignTime/InjectWithSemicolon.cs b/test/Microsoft.AspNet.Mvc.Razor.Host.Test/TestFiles/Output/DesignTime/InjectWithSemicolon.cs index bc1e89c2da..defb7d8386 100644 --- a/test/Microsoft.AspNet.Mvc.Razor.Host.Test/TestFiles/Output/DesignTime/InjectWithSemicolon.cs +++ b/test/Microsoft.AspNet.Mvc.Razor.Host.Test/TestFiles/Output/DesignTime/InjectWithSemicolon.cs @@ -2,13 +2,13 @@ namespace Asp { using System.Threading.Tasks; - public class ASPV_TestFiles_Input_InjectWithSemicolon_cshtml : Microsoft.AspNet.Mvc.Razor.RazorPage + public class ASPV_testfiles_input_injectwithsemicolon_cshtml : Microsoft.AspNet.Mvc.Razor.RazorPage { private static object @__o; private void @__RazorDesignTimeHelpers__() { #pragma warning disable 219 -#line 1 "TestFiles/Input/InjectWithSemicolon.cshtml" +#line 1 "testfiles/input/injectwithsemicolon.cshtml" var __modelHelper = default(MyModel); #line default @@ -16,13 +16,13 @@ private void @__RazorDesignTimeHelpers__() #pragma warning restore 219 } #line hidden - public ASPV_TestFiles_Input_InjectWithSemicolon_cshtml() + public ASPV_testfiles_input_injectwithsemicolon_cshtml() { } #line hidden [Microsoft.AspNet.Mvc.Razor.Internal.RazorInjectAttribute] public -#line 2 "TestFiles/Input/InjectWithSemicolon.cshtml" +#line 2 "testfiles/input/injectwithsemicolon.cshtml" MyApp MyPropertyName #line default @@ -30,7 +30,7 @@ MyApp MyPropertyName { get; private set; } [Microsoft.AspNet.Mvc.Razor.Internal.RazorInjectAttribute] public -#line 3 "TestFiles/Input/InjectWithSemicolon.cshtml" +#line 3 "testfiles/input/injectwithsemicolon.cshtml" MyService Html #line default @@ -38,7 +38,7 @@ MyService Html { get; private set; } [Microsoft.AspNet.Mvc.Razor.Internal.RazorInjectAttribute] public -#line 4 "TestFiles/Input/InjectWithSemicolon.cshtml" +#line 4 "testfiles/input/injectwithsemicolon.cshtml" MyApp MyPropertyName2 #line default @@ -46,7 +46,7 @@ MyApp MyPropertyName2 { get; private set; } [Microsoft.AspNet.Mvc.Razor.Internal.RazorInjectAttribute] public -#line 5 "TestFiles/Input/InjectWithSemicolon.cshtml" +#line 5 "testfiles/input/injectwithsemicolon.cshtml" MyService Html2 #line default diff --git a/test/Microsoft.AspNet.Mvc.Razor.Host.Test/TestFiles/Output/DesignTime/Model.cs b/test/Microsoft.AspNet.Mvc.Razor.Host.Test/TestFiles/Output/DesignTime/Model.cs index 57ebd130fe..811d5e2444 100644 --- a/test/Microsoft.AspNet.Mvc.Razor.Host.Test/TestFiles/Output/DesignTime/Model.cs +++ b/test/Microsoft.AspNet.Mvc.Razor.Host.Test/TestFiles/Output/DesignTime/Model.cs @@ -2,13 +2,13 @@ namespace Asp { using System.Threading.Tasks; - public class ASPV_TestFiles_Input_Model_cshtml : Microsoft.AspNet.Mvc.Razor.RazorPage + public class ASPV_testfiles_input_model_cshtml : Microsoft.AspNet.Mvc.Razor.RazorPage { private static object @__o; private void @__RazorDesignTimeHelpers__() { #pragma warning disable 219 -#line 1 "TestFiles/Input/Model.cshtml" +#line 1 "testfiles/input/model.cshtml" var __modelHelper = default(System.Collections.IEnumerable); #line default @@ -16,7 +16,7 @@ private void @__RazorDesignTimeHelpers__() #pragma warning restore 219 } #line hidden - public ASPV_TestFiles_Input_Model_cshtml() + public ASPV_testfiles_input_model_cshtml() { } #line hidden diff --git a/test/Microsoft.AspNet.Mvc.Razor.Host.Test/TestFiles/Output/DesignTime/ModelExpressionTagHelper.cs b/test/Microsoft.AspNet.Mvc.Razor.Host.Test/TestFiles/Output/DesignTime/ModelExpressionTagHelper.cs index 1e70626c41..1a7f31d98e 100644 --- a/test/Microsoft.AspNet.Mvc.Razor.Host.Test/TestFiles/Output/DesignTime/ModelExpressionTagHelper.cs +++ b/test/Microsoft.AspNet.Mvc.Razor.Host.Test/TestFiles/Output/DesignTime/ModelExpressionTagHelper.cs @@ -8,7 +8,7 @@ namespace Asp using Microsoft.AspNet.Mvc.Rendering; using System.Threading.Tasks; - public class ASPV_TestFiles_Input_ModelExpressionTagHelper_cshtml : Microsoft.AspNet.Mvc.Razor.RazorPage + public class ASPV_testfiles_input_modelexpressiontaghelper_cshtml : Microsoft.AspNet.Mvc.Razor.RazorPage { private static object @__o; private void @__RazorDesignTimeHelpers__() @@ -16,13 +16,13 @@ private void @__RazorDesignTimeHelpers__() #pragma warning disable 219 string __tagHelperDirectiveSyntaxHelper = null; __tagHelperDirectiveSyntaxHelper = -#line 3 "TestFiles/Input/ModelExpressionTagHelper.cshtml" +#line 3 "testfiles/input/modelexpressiontaghelper.cshtml" "Microsoft.AspNet.Mvc.Razor.InputTestTagHelper, Microsoft.AspNet.Mvc.Razor.Host.Test" #line default #line hidden ; -#line 1 "TestFiles/Input/ModelExpressionTagHelper.cshtml" +#line 1 "testfiles/input/modelexpressiontaghelper.cshtml" var __modelHelper = default(DateTime); #line default @@ -32,7 +32,7 @@ private void @__RazorDesignTimeHelpers__() #line hidden private Microsoft.AspNet.Mvc.Razor.InputTestTagHelper __Microsoft_AspNet_Mvc_Razor_InputTestTagHelper = null; #line hidden - public ASPV_TestFiles_Input_ModelExpressionTagHelper_cshtml() + public ASPV_testfiles_input_modelexpressiontaghelper_cshtml() { } #line hidden @@ -51,13 +51,13 @@ public ASPV_TestFiles_Input_ModelExpressionTagHelper_cshtml() public override async Task ExecuteAsync() { __Microsoft_AspNet_Mvc_Razor_InputTestTagHelper = CreateTagHelper(); -#line 5 "TestFiles/Input/ModelExpressionTagHelper.cshtml" +#line 5 "testfiles/input/modelexpressiontaghelper.cshtml" __Microsoft_AspNet_Mvc_Razor_InputTestTagHelper.For = CreateModelExpression(__model => __model.Now); #line default #line hidden __Microsoft_AspNet_Mvc_Razor_InputTestTagHelper = CreateTagHelper(); -#line 6 "TestFiles/Input/ModelExpressionTagHelper.cshtml" +#line 6 "testfiles/input/modelexpressiontaghelper.cshtml" __Microsoft_AspNet_Mvc_Razor_InputTestTagHelper.For = CreateModelExpression(__model => Model); #line default diff --git a/test/Microsoft.AspNet.Mvc.Razor.Host.Test/TestFiles/Output/DesignTime/_ViewImports.cs b/test/Microsoft.AspNet.Mvc.Razor.Host.Test/TestFiles/Output/DesignTime/_ViewImports.cs index 7dc8c0a827..2fda13e053 100644 --- a/test/Microsoft.AspNet.Mvc.Razor.Host.Test/TestFiles/Output/DesignTime/_ViewImports.cs +++ b/test/Microsoft.AspNet.Mvc.Razor.Host.Test/TestFiles/Output/DesignTime/_ViewImports.cs @@ -3,7 +3,7 @@ namespace Asp using System.Threading.Tasks; using TModel = System.Object; - public class ASPV_TestFiles_Input__ViewImports_cshtml : Microsoft.AspNet.Mvc.Razor.RazorPage + public class ASPV_testfiles_input__viewimports_cshtml : Microsoft.AspNet.Mvc.Razor.RazorPage { private static object @__o; private void @__RazorDesignTimeHelpers__() @@ -12,13 +12,13 @@ private void @__RazorDesignTimeHelpers__() #pragma warning restore 219 } #line hidden - public ASPV_TestFiles_Input__ViewImports_cshtml() + public ASPV_testfiles_input__viewimports_cshtml() { } #line hidden [Microsoft.AspNet.Mvc.Razor.Internal.RazorInjectAttribute] public -#line 1 "TestFiles/Input/_ViewImports.cshtml" +#line 1 "testfiles/input/_viewimports.cshtml" IHtmlHelper Model #line default