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.

Static Web Assets build error with .net 6 rc1 with .net 5 target

See original GitHub issue

.NET 6 rc1 still breaks our open source AElemental library static web assets. This issue seems similar (or possibly identical?) to #19475 but the class library that fails is targeting .NET 5. I already opened #20008 for preview 7 but the same issue happens with rc1

2>C:\Program Files\dotnet\sdk\6.0.100-rc.1.21458.32\Sdks\Microsoft.NET.Sdk.Razor\targets\Microsoft.NET.Sdk.Razor.StaticWebAssets.5_0.targets(500,5): error : Static web asset 'C:\code\elemental-blazor\Elemental\wwwroot\css\elemental.min.css' has invalid source type ''. 2>Done building project "Elemental.csproj" -- FAILED.

Repro:

  1. pull https://github.com/apption-oscode/elemental-blazor/tree/develop
  2. Use .net SDK 6.0.100-rc.1.21458.32
  3. Build solution in visual studio

Build did work with .net 6 preview 6 but breaks with .net 6 preview 7 and rc1.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:12 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
javiercncommented, Oct 15, 2021

@robertmclaws I saw your commit and explicitly removed.

This was just some build stuff that got messed up and the fix didn’t make it into the RC2 bits.

0reactions
robertmclawscommented, Oct 15, 2021

@javiercn That looks correct. However last night I checked in a change to the CloudNimble.BlazorEssentials.csproj file that works around the problem in RC2:

  <ItemGroup>
    <None Include="$(BaseIntermediateOutputPath)\$(Configuration)\net6.0\scopedcss\projectbundle\*.scp.css" Visible="false">
      <PackagePath>staticwebassets</PackagePath>
      <Pack>true</Pack>
      <InProject>false</InProject>
      <Visible>false</Visible>
    </None>
  </ItemGroup>

You may want to check to make sure that section was not in the build you just tested against.

Thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

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 >
I keep getting StaticWebAssets.xml build error but I don't ...
The trouble is, these are APIs without any static web assets and I don't want to build or deploy static web assets. Is...
Read more >
Untitled
Staticwebassets not found WebFeb 14, 2022 · Hello guys, I found the Issue with very similar question, link below: Microsoft.NET.Sdk.Razor.
Read more >
Support for the .NET SDK 5.0
NET 5, including: The first steps in C# 9 support: Top-level statements, native ints, target typed conditional expressions, static lambdas, and ...
Read more >
My ASP.NET 5 migration to .NET 6
The first step was updating the target framework moniker to net6.0 . <Project Sdk="Microsoft.NET.Sdk.Web"> <PropertyGroup> <TargetFramework>net6 ...
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