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

Could not scan /usr/local/share/dotnet/packs/Microsoft.AspNetCore.App.Ref/9.0.0/ref/net9.0/Microsoft.JSInterop.dll for Fable plugins #3974

Closed
forki opened this issue Dec 10, 2024 · 4 comments · Fixed by #4066

Comments

@forki
Copy link
Collaborator

forki commented Dec 10, 2024

Description

In .NET Aspire I always get: Could not scan /usr/local/share/dotnet/packs/Microsoft.AspNetCore.App.Ref/9.0.0/ref/net9.0/Microsoft.JSInterop.dll for Fable plugins

Is there anything I can do to work around that?

@MangelMaxime
Copy link
Member

Hello,

Last time I worked on Fable plugin loading, I was not able to determine why we can't scan some of the assemblies for plugins. In theory, this warning is harmless I kept it because otherwise we had a silent error or the compiler would continue but with an unexpected result.

Does the associated Original error message contains some meaningful information?

Currently Fable scan all the assemblies for plugins, but if we could identity assemblies that we know for sure don't contains Fable plugins we could either not scan them or not report the errors.

For example, we know that any .NET Standard assemblies will never contains a Fable plugins. The question is how do we identify them?

@alfonsogarciacaro
Copy link
Member

The list of core assemblies is just hardcoded XD

But we could do the same strategy as the project cracker to identify system packages... which is just checking if they start with "Microsoft.", "System.", etc.

Here:

if Compiler.CoreAssemblyNames.Contains(asmName) then
coreAssemblies.Add(asmName, asm)
else
let scanForPlugins =
try
asm.Contents.Attributes
|> Seq.exists (fun attr ->
attr.AttributeType.TryFullName = Some "Fable.ScanForPluginsAttribute"
)

@forki
Copy link
Collaborator Author

forki commented Feb 22, 2025

Could not scan /usr/local/share/dotnet/packs/Microsoft.AspNetCore.App.Ref/9.0.2/ref/net9.0/Microsoft.AspNetCore.Mvc.dll for Fable plugins, skipping this assembly. Original error: The exception has been reported. This internal exception should now be caught at an error recovery point on the stack. Original message: The type 'MetadataUpdateHandlerAttribute' is required here and is unavailable. You must add a reference to assembly 'System.Runtime.Loader, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.)

that's all I have as info.

@MangelMaxime
Copy link
Member

@forki I think what Alfonso is saying is that we could decide that we don't scan assemblies starting with "Microsoft.", "System.", etc. because they probably will never have a Fable plugin in them.

I don't think anyone outside of Microsoft can releases package starting with these names.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants