首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >"GetFileHash“任务意外失败

"GetFileHash“任务意外失败
EN

Stack Overflow用户
提问于 2020-11-08 15:38:39
回答 1查看 285关注 0票数 2

我正在处理Blazor Web Assembly项目,但在构建过程中遇到一个错误,声明如下:

代码语言:javascript
复制
Severity    Code    Description Project File    Line    Suppression State
Error   MSB4018 The "GetFileHash" task failed unexpectedly.
System.AggregateException: One or more errors occurred. ---> System.IO.IOException: The process cannot access the file 'D:\New folder\projects\Al-Tanzil.org\Source\TechFlurry.AlTanzil\TechFlurry.AlTanzil.App\wwwroot\debug.log' because it is being used by another process.
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)
   at Microsoft.Build.Tasks.GetFileHash.ComputeHash(Func`1 algorithmFactory, String filePath)
   at Microsoft.Build.Tasks.GetFileHash.<>c__DisplayClass28_0.<Execute>b__0(Int32 index)
   at System.Threading.Tasks.Parallel.<>c__DisplayClass17_0`1.<ForWorker>b__1()
   at System.Threading.Tasks.Task.InnerInvoke()
   at System.Threading.Tasks.Task.InnerInvokeWithArg(Task childTask)
   at System.Threading.Tasks.Task.<>c__DisplayClass176_0.<ExecuteSelfReplicating>b__0(Object <p0>)
   --- End of inner exception stack trace ---
   at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
   at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
   at System.Threading.Tasks.Task.Wait()
   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)
   at System.Threading.Tasks.Parallel.For(Int32 fromInclusive, Int32 toExclusive, Action`1 body)
   at Microsoft.Build.Tasks.GetFileHash.Execute()
   at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
   at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext()
---> (Inner Exception #0) System.IO.IOException: The process cannot access the file 'D:\New folder\projects\Al-Tanzil.org\Source\TechFlurry.AlTanzil\TechFlurry.AlTanzil.App\wwwroot\debug.log' because it is being used by another process.
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)
   at Microsoft.Build.Tasks.GetFileHash.ComputeHash(Func`1 algorithmFactory, String filePath)
   at Microsoft.Build.Tasks.GetFileHash.<>c__DisplayClass28_0.<Execute>b__0(Int32 index)
   at System.Threading.Tasks.Parallel.<>c__DisplayClass17_0`1.<ForWorker>b__1()
   at System.Threading.Tasks.Task.InnerInvoke()
   at System.Threading.Tasks.Task.InnerInvokeWithArg(Task childTask)
   at System.Threading.Tasks.Task.<>c__DisplayClass176_0.<ExecuteSelfReplicating>b__0(Object <p0>)<---
    TechFlurry.AlTanzil.App C:\Users\nobel\.nuget\packages\microsoft.aspnetcore.components.webassembly.build\3.2.1\targets\ServiceWorkerAssetsManifest.targets  134 


The service worker assets manifest file:

    <GetFileHash Files="@(_StaticWebAssetsWithoutHash)" Algorithm="SHA256" HashEncoding="base64">
          <Output TaskParameter="Items" ItemName="_StaticWebAssetHash" />
    </GetFileHash>

在这个问题上,有人能帮我吗?我迫切需要一个解决方案,在互联网上搜索,但没有找到。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2020-11-10 04:36:55

您使用的是打开的文件debug.log,可能在记事本中,您需要关闭它以便可以写入日志。

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/64735829

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档