question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[.Net 6.0.102] dotnet pack - Microsoft.NET.Sdk.Razor.StaticWebAssets.targets NotFoundException

See original GitHub issue

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

Hello guys, I found the Issue with very similar question, link below: Microsoft.NET.Sdk.Razor.StaticWebAssets.targets DirectoryNotFoundException maybe the same too: MauiRazorClassLibrary sometimes doesn’t build when building the SLN, causing StaticWebAssets to fail

but the defferent is, I have same problem when packing instead of building here’s my csproj file setting: <PropertyGroup> <TargetFramework>net6.0</TargetFramework> <!-- <IncludeContentInPack>true</IncludeContentInPack> --> <IsPackable>true</IsPackable> <!-- <IncludeBuildOutput>false</IncludeBuildOutput> --> <!-- <ContentTargetFolders>content</ContentTargetFolders> --> <EnableDefaultContentItems>false</EnableDefaultContentItems> <!-- <NoDefaultExcludes>true</NoDefaultExcludes> --> <GeneratePackageOnBuild>True</GeneratePackageOnBuild> <!-- <PackageOutputPath>.</PackageOutputPath> --> </PropertyGroup>

when I run commend of dotnet pack, will get the result like: dotnet\sdk\6.0.102\Sdks\Microsoft.NET.Sdk.Razor\targets\Microsoft.NET.Sdk.Razor.StaticWebAssets.targets(522,5): error : Manifest file at 'src\NineYi.ExtTemplate\obj\Debug\net6.0\staticwebassets.build.json' not found. [src\NineYi.ExtTemplate\NineYi.ExtTemplate.csproj]

Expected Behavior

can be pack well without this problem

Steps To Reproduce

No response

Exceptions (if any)

dotnet\sdk\6.0.102\Sdks\Microsoft.NET.Sdk.Razor\targets\Microsoft.NET.Sdk.Razor.StaticWebAssets.targets(522,5): error : Manifest file at ‘src\NineYi.ExtTemplate\obj\Debug\net6.0\staticwebassets.build.json’ not found. [src\NineYi.ExtTemplate\NineYi.ExtTemplate.csproj]

.NET Version

6.0.102

Anything else?

No response

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
javiercncommented, Feb 15, 2022

@charleschang0531 thanks for the additional details.

It seems that you are building a project to create templates but you are referencing the web sdk <Project Sdk="Microsoft.NET.Sdk.Web"> I believe you should reference the plain .NET SDK <Project Sdk="Microsoft.NET.Sdk"> instead and that would avoid this issue.

Alternatively, since this won’t be using static web assets, you can turn the entire feature off with <EnableStaticWebAssets>false</EnableStaticWebAssets> on your csproj.

0reactions
charleschang0531commented, Feb 16, 2022

Now I’m comfuse with what’s the difference between <Project Sdk="Microsoft.NET.Sdk.Web"> and <Project Sdk="Microsoft.NET.Sdk"> , but that’s my homework !! Thanks for the help, it’s efficient and it work.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Microsoft.NET.Sdk.Razor.StaticWebAssets.targets(442,5) ...
Similar error propped up in our project after upgrading to net6.0. Project had a .nuget package reference to said static asset(i.e ...
Read more >
NETSDK1045: The current .NET SDK does not support ...
This error occurs when the build tools can't find the version of the .NET SDK that's needed to build a project. This is...
Read more >
NETSDK1141: Unable to resolve the .NET SDK version as ...
NET Core 5.0 SDK and later versions. There was a problem with the version of the SDK specified in the global.json file.
Read more >
Download .NET 6.0 (Linux, macOS, and Windows)
NET 6.0 downloads for Linux, macOS, and Windows. .NET is a free, cross-platform, open-source developer platform for building many different types of ...
Read more >
NET project SDK overview
NET 5 and later projects are associated with a software development kit (SDK). Each project SDK is a set of MSBuild targets and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found