【发布时间】:2021-09-01 14:58:50
【问题描述】:
我们正在使用 nuget 包 BuildWebCompiler 在我们的 blazor Web 程序集应用程序中编译 scss 文件。在本地 Visual Studio 中,这按预期工作,但在我们的 azure 构建管道中,我们收到以下错误:
WebCompiler: Begin compiling compilerconfig.json
Compiled wwwroot/app.css
Minified wwwroot/app.min.css
Compiled Pages/ErrorsPage.razor.css
Compiled Shared/NavMenu.razor.css
Compiled Shared/MainLayout.razor.css
Compiled Components/ErrorComponent.razor.css
Compiled Components/ErrorDetailComponent.razor.css
Compiled Components/NameValueBaseComponent.razor.css
Compiled Components/NavigationComponent.razor.css
Compiled Components/StackframeComponent.razor.css
Compiled Pages/ErrorEventPage.razor.css
Compiled Components/FilterComponent.razor.css
Minified Components/FilterComponent.razor.min.css
WebCompiler: Done compiling compilerconfig.json
{AppName}.Services.App -> D:\core-1-2\1\s\src\{AppName}.Services.App\bin\release\net5.0\{AppName}.Services.App.dll
{AppName}.Services.App (Blazor output) -> D:\core-1-2\1\s\src\{AppName}.Services.App\bin\release\net5.0\wwwroot
{AppName}.Services.Api -> D:\core-1-2\1\s\src\{AppName}.Services.Api\bin\release\net5.0\{AppName}.Services.Api.dll
{AppName}.Services.Api -> D:\core-1-2\1\s\src\{AppName}.Services.Api\bin\release\net5.0\{AppName}.Services.Api.Views.dll
Optimizing assemblies for size, which may change the behavior of the app. Be sure to test after publishing. See: https://aka.ms/dotnet-illink
D:\core-1-2\_tool\dotnet\sdk\5.0.400\Sdks\Microsoft.NET.Sdk.BlazorWebAssembly\targets\Microsoft.NET.Sdk.BlazorWebAssembly.ServiceWorkerAssetsManifest.targets(140,5): error MSB4018: The "GenerateServiceWorkerAssetsManifest" task failed unexpectedly. [D:\core-1-2\1\s\src\{AppName}.Services.App\{AppName}.Services.App.csproj]
D:\core-1-2\_tool\dotnet\sdk\5.0.400\Sdks\Microsoft.NET.Sdk.BlazorWebAssembly\targets\Microsoft.NET.Sdk.BlazorWebAssembly.ServiceWorkerAssetsManifest.targets(140,5): error MSB4018: System.AggregateException: One or more errors occurred. (Could not find a part of the path 'D:\core-1-2\1\s\src\{AppName}.Services.App\obj\release\net5.0\scopedcss\bundle\{AppName}.Services.App.styles.css'.) [D:\core-1-2\1\s\src\{AppName}.Services.App\{AppName}.Services.App.csproj]
D:\core-1-2\_tool\dotnet\sdk\5.0.400\Sdks\Microsoft.NET.Sdk.BlazorWebAssembly\targets\Microsoft.NET.Sdk.BlazorWebAssembly.ServiceWorkerAssetsManifest.targets(140,5): error MSB4018: ---> System.IO.DirectoryNotFoundException: Could not find a part of the path 'D:\core-1-2\1\s\src\{AppName}.Services.App\obj\release\net5.0\scopedcss\bundle\{AppName}.Services.App.styles.css'. [D:\core-1-2\1\s\src\{AppName}.Services.App\{AppName}.Services.App.csproj]
D:\core-1-2\_tool\dotnet\sdk\5.0.400\Sdks\Microsoft.NET.Sdk.BlazorWebAssembly\targets\Microsoft.NET.Sdk.BlazorWebAssembly.ServiceWorkerAssetsManifest.targets(140,5): error MSB4018: at System.IO.FileStream.ValidateFileHandle(SafeFileHandle fileHandle) [D:\core-1-2\1\s\src\{AppName}.Services.App\{AppName}.Services.App.csproj]
D:\core-1-2\_tool\dotnet\sdk\5.0.400\Sdks\Microsoft.NET.Sdk.BlazorWebAssembly\targets\Microsoft.NET.Sdk.BlazorWebAssembly.ServiceWorkerAssetsManifest.targets(140,5): error MSB4018: at System.IO.FileStream.CreateFileOpenHandle(FileMode mode, FileShare share, FileOptions options) [D:\core-1-2\1\s\src\{AppName}.Services.App\{AppName}.Services.App.csproj]
D:\core-1-2\_tool\dotnet\sdk\5.0.400\Sdks\Microsoft.NET.Sdk.BlazorWebAssembly\targets\Microsoft.NET.Sdk.BlazorWebAssembly.ServiceWorkerAssetsManifest.targets(140,5): error MSB4018: at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options) [D:\core-1-2\1\s\src\{AppName}.Services.App\{AppName}.Services.App.csproj]
D:\core-1-2\_tool\dotnet\sdk\5.0.400\Sdks\Microsoft.NET.Sdk.BlazorWebAssembly\targets\Microsoft.NET.Sdk.BlazorWebAssembly.ServiceWorkerAssetsManifest.targets(140,5): error MSB4018: at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share) [D:\core-1-2\1\s\src\{AppName}.Services.App\{AppName}.Services.App.csproj]
D:\core-1-2\_tool\dotnet\sdk\5.0.400\Sdks\Microsoft.NET.Sdk.BlazorWebAssembly\targets\Microsoft.NET.Sdk.BlazorWebAssembly.ServiceWorkerAssetsManifest.targets(140,5): error MSB4018: at System.IO.File.OpenRead(String path) [D:\core-1-2\1\s\src\{AppName}.Services.App\{AppName}.Services.App.csproj]
D:\core-1-2\_tool\dotnet\sdk\5.0.400\Sdks\Microsoft.NET.Sdk.BlazorWebAssembly\targets\Microsoft.NET.Sdk.BlazorWebAssembly.ServiceWorkerAssetsManifest.targets(140,5): error MSB4018: at Microsoft.NET.Sdk.BlazorWebAssembly.GenerateServiceWorkerAssetsManifest.<>c__DisplayClass17_0.<GenerateAssetManifest>b__0(Int32 i) [D:\core-1-2\1\s\src\{AppName}.Services.App\{AppName}.Services.App.csproj]
D:\core-1-2\_tool\dotnet\sdk\5.0.400\Sdks\Microsoft.NET.Sdk.BlazorWebAssembly\targets\Microsoft.NET.Sdk.BlazorWebAssembly.ServiceWorkerAssetsManifest.targets(140,5): error MSB4018: at System.Threading.Tasks.Parallel.<>c__DisplayClass19_0`1.<ForWorker>b__1(RangeWorker& currentWorker, Int32 timeout, Boolean& replicationDelegateYieldedBeforeCompletion) [D:\core-1-2\1\s\src\{AppName}.Services.App\{AppName}.Services.App.csproj]
D:\core-1-2\_tool\dotnet\sdk\5.0.400\Sdks\Microsoft.NET.Sdk.BlazorWebAssembly\targets\Microsoft.NET.Sdk.BlazorWebAssembly.ServiceWorkerAssetsManifest.targets(140,5): error MSB4018: --- End of stack trace from previous location --- [D:\core-1-2\1\s\src\{AppName}.Services.App\{AppName}.Services.App.csproj]
D:\core-1-2\_tool\dotnet\sdk\5.0.400\Sdks\Microsoft.NET.Sdk.BlazorWebAssembly\targets\Microsoft.NET.Sdk.BlazorWebAssembly.ServiceWorkerAssetsManifest.targets(140,5): error MSB4018: at System.Threading.Tasks.Parallel.<>c__DisplayClass19_0`1.<ForWorker>b__1(RangeWorker& currentWorker, Int32 timeout, Boolean& replicationDelegateYieldedBeforeCompletion) [D:\core-1-2\1\s\src\{AppName}.Services.App\{AppName}.Services.App.csproj]
D:\core-1-2\_tool\dotnet\sdk\5.0.400\Sdks\Microsoft.NET.Sdk.BlazorWebAssembly\targets\Microsoft.NET.Sdk.BlazorWebAssembly.ServiceWorkerAssetsManifest.targets(140,5): error MSB4018: at System.Threading.Tasks.TaskReplicator.Replica.Execute() [D:\core-1-2\1\s\src\{AppName}.Services.App\{AppName}.Services.App.csproj]
D:\core-1-2\_tool\dotnet\sdk\5.0.400\Sdks\Microsoft.NET.Sdk.BlazorWebAssembly\targets\Microsoft.NET.Sdk.BlazorWebAssembly.ServiceWorkerAssetsManifest.targets(140,5): error MSB4018: --- End of inner exception stack trace --- [D:\core-1-2\1\s\src\{AppName}.Services.App\{AppName}.Services.App.csproj]
D:\core-1-2\_tool\dotnet\sdk\5.0.400\Sdks\Microsoft.NET.Sdk.BlazorWebAssembly\targets\Microsoft.NET.Sdk.BlazorWebAssembly.ServiceWorkerAssetsManifest.targets(140,5): error MSB4018: at System.Threading.Tasks.TaskReplicator.Run[TState](ReplicatableUserAction`1 action, ParallelOptions options, Boolean stopOnFirstFailure) [D:\core-1-2\1\s\src\{AppName}.Services.App\{AppName}.Services.App.csproj]
D:\core-1-2\_tool\dotnet\sdk\5.0.400\Sdks\Microsoft.NET.Sdk.BlazorWebAssembly\targets\Microsoft.NET.Sdk.BlazorWebAssembly.ServiceWorkerAssetsManifest.targets(140,5): error MSB4018: at System.Threading.Tasks.Parallel.ForWorker[TLocal](Int32 fromInclusive, Int32 toExclusive, ParallelOptions parallelOptions, Action`1 body, Action`2 bodyWithState, Func`4 bodyWithLocal, Func`1 localInit, Action`1 localFinally) [D:\core-1-2\1\s\src\{AppName}.Services.App\{AppName}.Services.App.csproj]
D:\core-1-2\_tool\dotnet\sdk\5.0.400\Sdks\Microsoft.NET.Sdk.BlazorWebAssembly\targets\Microsoft.NET.Sdk.BlazorWebAssembly.ServiceWorkerAssetsManifest.targets(140,5): error MSB4018: --- End of stack trace from previous location --- [D:\core-1-2\1\s\src\{AppName}.Services.App\{AppName}.Services.App.csproj]
D:\core-1-2\_tool\dotnet\sdk\5.0.400\Sdks\Microsoft.NET.Sdk.BlazorWebAssembly\targets\Microsoft.NET.Sdk.BlazorWebAssembly.ServiceWorkerAssetsManifest.targets(140,5): error MSB4018: at System.Threading.Tasks.Parallel.ThrowSingleCancellationExceptionOrOtherException(ICollection exceptions, CancellationToken cancelToken, Exception otherException) [D:\core-1-2\1\s\src\{AppName}.Services.App\{AppName}.Services.App.csproj]
D:\core-1-2\_tool\dotnet\sdk\5.0.400\Sdks\Microsoft.NET.Sdk.BlazorWebAssembly\targets\Microsoft.NET.Sdk.BlazorWebAssembly.ServiceWorkerAssetsManifest.targets(140,5): error MSB4018: at System.Threading.Tasks.Parallel.ForWorker[TLocal](Int32 fromInclusive, Int32 toExclusive, ParallelOptions parallelOptions, Action`1 body, Action`2 bodyWithState, Func`4 bodyWithLocal, Func`1 localInit, Action`1 localFinally) [D:\core-1-2\1\s\src\{AppName}.Services.App\{AppName}.Services.App.csproj]
D:\core-1-2\_tool\dotnet\sdk\5.0.400\Sdks\Microsoft.NET.Sdk.BlazorWebAssembly\targets\Microsoft.NET.Sdk.BlazorWebAssembly.ServiceWorkerAssetsManifest.targets(140,5): error MSB4018: at System.Threading.Tasks.Parallel.For(Int32 fromInclusive, Int32 toExclusive, Action`1 body) [D:\core-1-2\1\s\src\{AppName}.Services.App\{AppName}.Services.App.csproj]
D:\core-1-2\_tool\dotnet\sdk\5.0.400\Sdks\Microsoft.NET.Sdk.BlazorWebAssembly\targets\Microsoft.NET.Sdk.BlazorWebAssembly.ServiceWorkerAssetsManifest.targets(140,5): error MSB4018: at Microsoft.NET.Sdk.BlazorWebAssembly.GenerateServiceWorkerAssetsManifest.GenerateAssetManifest(Stream stream) [D:\core-1-2\1\s\src\{AppName}.Services.App\{AppName}.Services.App.csproj]
D:\core-1-2\_tool\dotnet\sdk\5.0.400\Sdks\Microsoft.NET.Sdk.BlazorWebAssembly\targets\Microsoft.NET.Sdk.BlazorWebAssembly.ServiceWorkerAssetsManifest.targets(140,5): error MSB4018: at Microsoft.NET.Sdk.BlazorWebAssembly.GenerateServiceWorkerAssetsManifest.Execute() [D:\core-1-2\1\s\src\{AppName}.Services.App\{AppName}.Services.App.csproj]
D:\core-1-2\_tool\dotnet\sdk\5.0.400\Sdks\Microsoft.NET.Sdk.BlazorWebAssembly\targets\Microsoft.NET.Sdk.BlazorWebAssembly.ServiceWorkerAssetsManifest.targets(140,5): error MSB4018: at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute() [D:\core-1-2\1\s\src\{AppName}.Services.App\{AppName}.Services.App.csproj]
D:\core-1-2\_tool\dotnet\sdk\5.0.400\Sdks\Microsoft.NET.Sdk.BlazorWebAssembly\targets\Microsoft.NET.Sdk.BlazorWebAssembly.ServiceWorkerAssetsManifest.targets(140,5): error MSB4018: at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(ITaskExecutionHost taskExecutionHost, TaskLoggingContext taskLoggingContext, TaskHost taskHost, ItemBucket bucket, TaskExecutionMode howToExecuteTask) [D:\core-1-2\1\s\src\{AppName}.Services.App\{AppName}.Services.App.csproj]
你们有什么想法,怎么了?
提前致谢!
【问题讨论】:
标签: sass msbuild azure-pipelines blazor blazor-webassembly