-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Mono's RuntimeAssembly.GetName calls CodeBase #54835
Comments
Tagging subscribers to this area: Issue DetailsCodeBase is marked as runtime/src/mono/System.Private.CoreLib/src/System/Reflection/RuntimeAssembly.cs Lines 253 to 256 in bde0322
We should decide what to do here for Mono. In CoreCLR, we don't call CodeBase directly, but instead we call the underlying runtime/src/coreclr/System.Private.CoreLib/src/System/Reflection/RuntimeAssembly.cs Lines 102 to 117 in bde0322
Maybe we should do the same?
|
/cc @lambdageek |
I needed to suppress the new IL3002 warning from the |
Fixed by #54895 |
It's marked as not available in single file apps. Call the underlying get_code_base icall. Fixes dotnet#54835
…me (#54895) * [mono] Don't call Assembly.CodeBase directly in RuntimeAssembly.GetName It's marked as not available in single file apps. Call the underlying get_code_base icall. Fixes #54835 * [icall] Use MonoImage:filename for RuntimeAssembly.get_code_base For bundled asssemblies in single file scenarios, RuntimeAssembly.CodeBase will be null, matching CoreCLR. * disable codebase test on wasm
CodeBase is marked as
RequiresAssemblyFiles
, which means that it can throw an exception if the application is published as a single-file application.runtime/src/mono/System.Private.CoreLib/src/System/Reflection/RuntimeAssembly.cs
Lines 253 to 256 in bde0322
We should decide what to do here for Mono. In CoreCLR, we don't call CodeBase directly, but instead we call the underlying
GetCodeBase()
method, which returnsnull
when running in a single-file application:runtime/src/coreclr/System.Private.CoreLib/src/System/Reflection/RuntimeAssembly.cs
Lines 102 to 117 in bde0322
Maybe we should do the same?
cc @akoeplinger @steveisok
The text was updated successfully, but these errors were encountered: