Dotnet Pack throwing staticwebassetts.build.json f...
# help-with-other
n
Hi All, I'm trying to pack up a nuget package locally (as a test), the package is an RCL with static assets in it, targetting dotnet 8 and Umbraco v13. The Build works find, and I can directly reference the project and it works, but when I do
dotnet pack
from the CLI I get the following error:
Copy code
..dotnet\sdk\8.0.402\Sdks\Microsoft.NET.Sdk.StaticWebAssets\targets\Microsoft.NET.Sdk.StaticWebAssets.Pu
blish.targets(57,5): error : Manifest file at 'obj\Release\net8.0\staticwebassets.build.json' not found. [..pathto/project.csproj]
I've tried bumping my dotnet sdk from 8.0.400 to 8.0.402 (the latest) and that's not worked. If I use the "pack" feature in visual studio it works, but the CLI doesn't.
For anyone interested, what I didn't notice in the error message is that it refers to obj/Release - I hadn't done a release build yet! #DevError #Oops
m
Have you thought about using the pack on build functionality in VS? Then you shouldn't hit this?
used in conjunction with...
dotnet add "www" package MyPackage --source "D:\_work\{..}\dist" --prerelease
when spinning up a clean test (extending on PSW)
n
The reason I wanted to get the CLI working is that is what github actions will use to do the CI/CD releases - you are right the VS pack functionality did just work, I tried that to test if it was a project issue or a CLI issue (once I saw it existed) - I also have the GeneratePackageOnBuild set to true (I think) but because the objective is to use the git tag as the version, I think it made it slightly redundant.
m
We use the pack on build in our CI/CD 🙂
dotnet build --configuration Release --version-suffix ${{ github.run_number }}
guessing you can grab the tag there too? and override the version, though could be more involved if you are updating readme, and other settings in the csproj with the version no in them?
325 Views