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

RuntimeLicenseContext.GetSavedLicenseKey throws exception for dynamic assemblies #51924

Closed
BickelLukas opened this issue Apr 27, 2021 · 10 comments
Labels
area-System.Reflection.Emit needs-author-action An issue or pull request that requires more info or actions from the author.
Milestone

Comments

@BickelLukas
Copy link

Description

// Assemblies loaded in memory return empty string from Location.
string location = asm.Location;
if (location == string.Empty)
continue;

In the System.ComponentModel.Design.RuntimeLicenseContext the following lines state that Location returns null for in memory loaded assemblies.

However System.Reflection.Emit.InternalAssemblyBuilder throws an exception when Location is accessed:

public override string Location => throw new NotSupportedException(SR.NotSupported_DynamicAssembly);

Configuration

.NET 5.0
Windows x86

@dotnet-issue-labeler dotnet-issue-labeler bot added area-System.ComponentModel untriaged New issue has not been triaged by the area owner labels Apr 27, 2021
@ghost
Copy link

ghost commented Apr 27, 2021

Tagging subscribers to this area: @safern
See info in area-owners.md if you want to be subscribed.

Issue Details

Description

// Assemblies loaded in memory return empty string from Location.
string location = asm.Location;
if (location == string.Empty)
continue;

In the System.ComponentModel.Design.RuntimeLicenseContext the following lines state that Location returns null for in memory loaded assemblies.

However System.Reflection.Emit.InternalAssemblyBuilder throws an exception when Location is accessed:

public override string Location => throw new NotSupportedException(SR.NotSupported_DynamicAssembly);

Configuration

.NET 5.0
Windows x86

Author: BickelLukas
Assignees: -
Labels:

area-System.ComponentModel, untriaged

Milestone: -

@safern
Copy link
Member

safern commented Apr 27, 2021

@jkotas, @vitek-karas is this expected? It seems like this was changed on: b19d798 and on the PR review this is what was suggested to be done.

@jkotas
Copy link
Member

jkotas commented Apr 27, 2021

We can either revert offending bit in the PR, or change the AssemblyBuilder string Location to just return empty string. I would vote for the latter.

@safern
Copy link
Member

safern commented Apr 27, 2021

to just return empty string. I would vote for the latter.

Sounds good. It seems like this regressed 3.1 -> 5.0 on RuntimeLicenseContext.GetSavedLicenseKey I think we should port it back to 5.0?

@ghost
Copy link

ghost commented May 6, 2021

Tagging subscribers to this area: @vitek-karas, @agocke, @CoffeeFlux, @VSadov
See info in area-owners.md if you want to be subscribed.

Issue Details

Description

// Assemblies loaded in memory return empty string from Location.
string location = asm.Location;
if (location == string.Empty)
continue;

In the System.ComponentModel.Design.RuntimeLicenseContext the following lines state that Location returns null for in memory loaded assemblies.

However System.Reflection.Emit.InternalAssemblyBuilder throws an exception when Location is accessed:

public override string Location => throw new NotSupportedException(SR.NotSupported_DynamicAssembly);

Configuration

.NET 5.0
Windows x86

Author: BickelLukas
Assignees: -
Labels:

area-AssemblyLoader-coreclr, area-System.Reflection.Emit, untriaged

Milestone: -

@eerhardt
Copy link
Member

eerhardt commented May 6, 2021

Moving to System.Reflection.Emit to change the AssemblyBuilder.Location behavior to return string.Empty as proposed by @jkotas above.

@buyaa-n buyaa-n added this to the 6.0.0 milestone May 12, 2021
@buyaa-n buyaa-n added help wanted [up-for-grabs] Good issue for external contributors and removed untriaged New issue has not been triaged by the area owner labels May 12, 2021
@krwq krwq modified the milestones: 6.0.0, 7.0.0 Jul 19, 2021
@ghost ghost added the needs-further-triage Issue has been initially triaged, but needs deeper consideration or reconsideration label Jul 19, 2021
@pedrobsaila
Copy link
Contributor

Hi, I made a PR for this issue #57396

@joperezr joperezr removed the needs-further-triage Issue has been initially triaged, but needs deeper consideration or reconsideration label Aug 16, 2021
@vitek-karas
Copy link
Member

Thanks to @pedrobsaila #57396 is merged and should fix the underlying issue in AssemblyBuilder. Could you please validate that the issue is fixed (in a couple of days one the fix makes it into the nightly build).

@ghost ghost added the needs-further-triage Issue has been initially triaged, but needs deeper consideration or reconsideration label Aug 20, 2021
@buyaa-n buyaa-n removed the needs-further-triage Issue has been initially triaged, but needs deeper consideration or reconsideration label Aug 24, 2021
@buyaa-n buyaa-n added needs-author-action An issue or pull request that requires more info or actions from the author. and removed help wanted [up-for-grabs] Good issue for external contributors labels Jul 7, 2022
@ghost
Copy link

ghost commented Jul 7, 2022

This issue has been marked needs-author-action and may be missing some important information.

@BickelLukas
Copy link
Author

Seems to work now!

@ghost ghost locked as resolved and limited conversation to collaborators Aug 11, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-System.Reflection.Emit needs-author-action An issue or pull request that requires more info or actions from the author.
Projects
No open projects
Development

No branches or pull requests