admin管理员组文章数量:1122832
Downloaded latest stable version of aspnetboilerplate
,
Installed client libraries using libman.json restore,
getting following strange errors on very first build
- InvalidOperationException
- Expected Identifier
System.InvalidOperationException: No file exists for the asset at either location 'wwwroot\view-resources\Views\Account\Login.min.js' or 'wwwroot\view-resources\Views\Account\Login.min.js'.
at Microsoft.AspNetCore.StaticWebAssets.Tasks.StaticWebAsset.ComputeFingerprintAndIntegrity(String identity, String originalItemSpec)
at Microsoft.AspNetCore.StaticWebAssets.Tasks.DefineStaticWebAssets.Execute()
Expected identifier: . \wwwroot\view-resources\Views\_Bundles\shared-layout.min.js
Expected expression: . \wwwroot\view-resources\Views\_Bundles\shared-layout.min.js
actually wwwroot\view-resources\Views\Account\Login.min.js
this file exists
Downloaded latest stable version of aspnetboilerplate
,
Installed client libraries using libman.json restore,
getting following strange errors on very first build
- InvalidOperationException
- Expected Identifier
System.InvalidOperationException: No file exists for the asset at either location 'wwwroot\view-resources\Views\Account\Login.min.js' or 'wwwroot\view-resources\Views\Account\Login.min.js'.
at Microsoft.AspNetCore.StaticWebAssets.Tasks.StaticWebAsset.ComputeFingerprintAndIntegrity(String identity, String originalItemSpec)
at Microsoft.AspNetCore.StaticWebAssets.Tasks.DefineStaticWebAssets.Execute()
Expected identifier: . \wwwroot\view-resources\Views\_Bundles\shared-layout.min.js
Expected expression: . \wwwroot\view-resources\Views\_Bundles\shared-layout.min.js
actually wwwroot\view-resources\Views\Account\Login.min.js
this file exists
1 Answer
Reset to default 0The CS0006
error (the last one illustrated in the Error tool window) is pretty generic error. While it may be also useful to search for other its possible causes,
getting following strange errors on very first build
this fact often indicates the obj
folder simply cannot be created (most likely because of the file system permissions' issues), while subsequent attempts are fine. The remaining build errors look consequent of this one.
To check this assumption, do the following:
- Download a brand new archive with a template;
- Extract it into a some subdir (for further experiments) and ensure the everyone / full control permissions on the created / extracted directory;
- Make sure that you open sln with the Visual Studio at least
Pro
(in addition to the folders' permissions, sometimes such the error may occur when using Visual Studio CommunityEdition
), better under theAdministrator
privileges; - Build / Rebuild to check if it is ok after the proposed settings during the first build.
- If not, ensure the same permissions settings on bin / obj folder of the stratup / entry point ASP.NET Core proj and try again.
UPDATED #1:
CS0006 is occuring because shared-layout.min.js is not generating
It appears that the problem is in any of inputs (may be any is malformed, or/and cannot be minified). Try to remove certain files from the "inputFiles" source to determine the problematic one:
bundleconfig.json:
{
"outputFileName": "wwwroot/view-resources/Views/_Bundles/shared-layout.min.js",
"inputFiles": [
"wwwroot/libs/jquery/jquery.js",
...
]
},
UPDATED #2:
at Microsoft.AspNetCore.StaticWebAssets.Tasks.StaticWebAsset.ComputeFingerprintAndIntegrity(String identity, String originalItemSpec) at Microsoft.AspNetCore.StaticWebAssets.Tasks.DefineStaticWebAssets.Execute()
Note that net9 has some known issues related to StaticWebAssets. Check if this works under the v8x / net8 cfg.
本文标签: aspnet coreaspnetboilerplate InvalidOperationExceptionStack Overflow
版权声明:本文标题:asp.net core - aspnetboilerplate InvalidOperationException - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736401745a1944317.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论