gpt4 book ai didi

Error after updating Blazor WASM Project - Conflicting assets with the same path '/wwwroot/_content(更新Blazor WASM项目后出错-具有相同路径‘/wwwroot/_content’的冲突资产)

转载 作者:bug小助手 更新时间:2023-10-28 10:26:24 28 4
gpt4 key购买 nike



I just updated a project with all new microsoft.aspnetcore.components.webassembly(s).. v5.0.10 from v5.0.5. Now when I recompile I get the following error:
enter image description here

我刚刚用全新的microsoft.aspnetcore.components.webassembly(s)..更新了一个项目从v5.0.5到v5.0.10。现在,当我重新编译时,我得到以下错误:


I've search everywhere and cannot find anymore reference to v5.0.5, only 5.0.10 and cannot find /wwwroot/_content either.

我到处搜索,都找不到对v5.0.5的引用,只找到5.0.10,也找不到/wwwroot/_content。


Any help/guidance is much appreciated.
Thanks,
Mike

如有任何帮助/指导,我们不胜感激。谢谢,迈克


更多回答

Tried closing VS. deleting all the .vs bin and obj folders in the solution projects?

已尝试关闭VS。是否删除解决方案项目中的所有.vs bin和obj文件夹?

Thanks Brian for the quick response! Worked perfectly!!

感谢Brian的快速响应!完美的工作!!

优秀答案推荐

By default, there's no reason for an RCL file to conflict with a file on the host. RCL files are prefixed with _content/${PackageId}. Blazor WebAssembly files are placed at the root of the host URL space, which makes conflicts easier. For example, Blazor WebAssembly apps contain a favicon.ico file that the host might also include in its wwwroot folder.

默认情况下,RCL文件没有理由与主机上的文件冲突。RCL文件以_Content/${Packageid}为前缀。Blazor WebAssembly文件放置在主机URL空间的根位置,这使得冲突更容易发生。例如,Blazor WebAssembly应用程序包含主机可能也包含在其wwwroot文件夹中的Favic.ico文件。


If the conflict's source is an RCL file, it often means code is copying assets from the library into the project's wwwroot folder. Writing code to copy files defeats a primary goal of static web assets. This goal is fundamental to get updates on the browser when the contents are updated without having to trigger a new compilation.

如果冲突的来源是RCL文件,则通常意味着代码正在将资源从库复制到项目的wwwroot文件夹中。编写复制文件的代码违背了静态Web资产的主要目标。这一目标对于在内容更新时在浏览器上获得更新而不必触发新的编译是基本的。


You may choose to preserve this behavior and maintain the file on the host. To do so, remove the file from the list of static web assets with a custom MSBuild target.

您可以选择保留此行为并在主机上维护文件。为此,请从具有自定义MSBuild目标的静态Web资源列表中删除该文件。


To use the RCL's file or the Blazor WebAssembly app's file instead of the host project's file, remove the file from the host project.

要使用RCL的文件或Blazor WebAssembly应用程序的文件而不是宿主项目的文件,请从宿主项目中删除该文件。


Microsoft Support

微软支持


更多回答

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com