diff --git a/src/BuiltInTools/dotnet-watch/HotReload/CompilationHandler.cs b/src/BuiltInTools/dotnet-watch/HotReload/CompilationHandler.cs index 0416098c8054..31c75e358342 100644 --- a/src/BuiltInTools/dotnet-watch/HotReload/CompilationHandler.cs +++ b/src/BuiltInTools/dotnet-watch/HotReload/CompilationHandler.cs @@ -84,13 +84,13 @@ public async ValueTask TryHandleFileChange(DotNetWatchContext context, Fil Solution? updatedSolution = null; ProjectId updatedProjectId; - if (_currentSolution.Projects.SelectMany(p => p.Documents).FirstOrDefault(d => d.FilePath == file.FilePath) is Document documentToUpdate) + if (_currentSolution.Projects.SelectMany(p => p.Documents).FirstOrDefault(d => string.Equals(d.FilePath, file.FilePath, StringComparison.OrdinalIgnoreCase)) is Document documentToUpdate) { var sourceText = await GetSourceTextAsync(file.FilePath); updatedSolution = documentToUpdate.WithText(sourceText).Project.Solution; updatedProjectId = documentToUpdate.Project.Id; } - else if (_currentSolution.Projects.SelectMany(p => p.AdditionalDocuments).FirstOrDefault(d => d.FilePath == file.FilePath) is AdditionalDocument additionalDocument) + else if (_currentSolution.Projects.SelectMany(p => p.AdditionalDocuments).FirstOrDefault(d => string.Equals(d.FilePath, file.FilePath, StringComparison.OrdinalIgnoreCase)) is AdditionalDocument additionalDocument) { var sourceText = await GetSourceTextAsync(file.FilePath); updatedSolution = _currentSolution.WithAdditionalDocumentText(additionalDocument.Id, sourceText, PreservationMode.PreserveValue); diff --git a/src/RazorSdk/Razor.slnf b/src/RazorSdk/Razor.slnf new file mode 100644 index 000000000000..0cfea7b0c655 --- /dev/null +++ b/src/RazorSdk/Razor.slnf @@ -0,0 +1,15 @@ +{ + "solution": { + "path": "..\\..\\sdk.sln", + "projects": [ + "src\\BuiltInTools\\AspNetCoreDeltaApplier\\Microsoft.Extensions.AspNetCoreDeltaApplier.csproj", + "src\\RazorSdk\\SourceGenerators\\Microsoft.NET.Sdk.Razor.SourceGenerators.csproj", + "src\\RazorSdk\\Tasks\\Microsoft.NET.Sdk.Razor.Tasks.csproj", + "src\\RazorSdk\\Tool\\Microsoft.NET.Sdk.Razor.Tool.csproj", + "src\\Resolvers\\Microsoft.DotNet.NativeWrapper\\Microsoft.DotNet.NativeWrapper.csproj", + "src\\Tests\\Microsoft.NET.Sdk.Razor.Tests\\Microsoft.NET.Sdk.Razor.Tests.csproj", + "src\\Tests\\Microsoft.NET.Sdk.Razor.Tool.Tests\\Microsoft.NET.Sdk.Razor.Tool.Tests.csproj", + "src\\Tests\\Microsoft.NET.TestFramework\\Microsoft.NET.TestFramework.csproj" + ] + } +} \ No newline at end of file diff --git a/src/RazorSdk/Targets/Microsoft.NET.Sdk.Razor.SourceGenerators.targets b/src/RazorSdk/Targets/Microsoft.NET.Sdk.Razor.SourceGenerators.targets index 12443751c06c..aed93241b72f 100644 --- a/src/RazorSdk/Targets/Microsoft.NET.Sdk.Razor.SourceGenerators.targets +++ b/src/RazorSdk/Targets/Microsoft.NET.Sdk.Razor.SourceGenerators.targets @@ -51,7 +51,14 @@ Copyright (c) .NET Foundation. All rights reserved. <_RazorAdditionalFile Include="@(RazorComponentWithTargetPath)" /> <_RazorAdditionalFile Include="@(RazorGenerateWithTargetPath)" Condition="'$(RazorCompileOnBuild)' != 'false'" /> - + + + <_RazorOmnisharpWorkAround Include="$([System.String]::Copy(%(_RazorAdditionalFile.RootDir)).ToLower())%(Directory)%(FileName)%(Extension)" + TargetPath="%(_RazorAdditionalFile.TargetPath)" + GeneratedOutputFullPath="%(_RazorAdditionalFile.GeneratedOutputFullPath)" + CssScope="%(_RazorAdditionalFile.CssScope)" /> + +