Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doesn't work with Blazor projects #8

Open
bugproof opened this issue Aug 20, 2022 · 3 comments
Open

Doesn't work with Blazor projects #8

bugproof opened this issue Aug 20, 2022 · 3 comments
Labels
bug Something isn't working enhancement New feature or request polar

Comments

@bugproof
Copy link
Owner

bugproof commented Aug 20, 2022

Upvote & Fund

  • We're using Polar.sh so you can upvote and help fund this issue.
  • We receive the funding once the issue is completed & confirmed by you.
  • Thank you in advance for helping prioritize & fund our backlog.
Fund with Polar
@bugproof bugproof added bug Something isn't working enhancement New feature or request labels Aug 20, 2022
@bugproof bugproof added the polar label Aug 21, 2023
@danielklecha
Copy link
Collaborator

It worked with version 0.3.2.

  1. create Blazor app in .NET 8
  2. add any reference e.g. Serilog
  3. add <StaticWebAssetsEnabled>false</StaticWebAssetsEnabled> to csproj
  4. run dotnet-thirdpartynotices in solution folder
  5. Confirm that third-party-notices.txt wa generated with one license (PASS)

@bugproof
Copy link
Owner Author

bugproof commented Mar 15, 2024

Just tried it. For some reason my Blazor WASM project in .NET 8 doesn't compile with <StaticWebAssetsEnabled>false</StaticWebAssetsEnabled> and without it I get Resolved files count: 0

part of the csproj file:

<Project Sdk="Microsoft.NET.Sdk.BlazorWebAssembly">

	<PropertyGroup>
		<TargetFramework>net8.0</TargetFramework>
		<Nullable>enable</Nullable>
		<ImplicitUsings>enable</ImplicitUsings>
		<RootNamespace>Client</RootNamespace>
		<PublishTrimmed>true</PublishTrimmed>
		<ServiceWorkerAssetsManifest>service-worker-assets.js</ServiceWorkerAssetsManifest>
		<LangVersion>preview</LangVersion>
		<BlazorWebAssemblyLoadAllGlobalizationData>true</BlazorWebAssemblyLoadAllGlobalizationData>
	</PropertyGroup>

I have for example

<PackageReference Include="MudBlazor" Version="6.17.0" />

There is some issue with

public IEnumerable<ResolvedFileInfo> ResolveFiles(Project project)

@bugproof bugproof reopened this Mar 15, 2024
@bugproof
Copy link
Owner Author

bugproof commented Mar 19, 2024

This tool works perfectly though: ThirdLicense

I did some small analysis and:

It wraps dotnet list package --include-transitive command to extract the dependencies - I don't know which .NET versions it supports. Their license finder code is very basic and it doesn't embed full license text in the file.

So ways to solve this issue is:

A. Wrapping dotnet list package as alternative for ComputeFilesToPublish and just use resolver logic as usual
B. Checking how dotnet list package is implemented and replicate it here -- which is just a wrapper over nuget cli ListPackageCommandRunner

This class seems to be responsible for it MSBuildAPIUtility which I think is just based on project.assets.json file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request polar
Projects
None yet
Development

No branches or pull requests

2 participants