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

Restore System.Reflection.Assembly load APIs #18532

Closed
sepidehkh opened this issue Sep 13, 2016 · 15 comments
Closed

Restore System.Reflection.Assembly load APIs #18532

sepidehkh opened this issue Sep 13, 2016 · 15 comments
Assignees
Milestone

Comments

@sepidehkh
Copy link
Contributor

These APIs need to be exposed from System.Reflection:

M:System.Reflection.Assembly.Load(byte[],byte[],System.Security.Policy.Evidence)
M:System.Reflection.Assembly.Load(byte[],byte[],System.Security.SecurityContextSource)
M:System.Reflection.Assembly.Load(System.Reflection.AssemblyName,System.Security.Policy.Evidence)
M:System.Reflection.Assembly.Load(System.String,System.Security.Policy.Evidence)
M:System.Reflection.Assembly.LoadFrom(System.String)
M:System.Reflection.Assembly.LoadFrom(System.String,byte[],System.Configuration.Assemblies.AssemblyHashAlgorithm)
M:System.Reflection.Assembly.LoadFrom(System.String,System.Security.Policy.Evidence)
M:System.Reflection.Assembly.LoadFrom(System.String,System.Security.Policy.Evidence,byte[],System.Configuration.Assemblies.AssemblyHashAlgorithm)
M:System.Reflection.Assembly.LoadFile(System.String)
M:System.Reflection.Assembly.LoadFile(System.String,System.Security.Policy.Evidence)
M:System.Reflection.Assembly.LoadModule(System.String,byte[])
M:System.Reflection.Assembly.LoadModule(System.String,byte[],byte[])
M:System.Reflection.Assembly.LoadWithPartialName(System.String)
M:System.Reflection.Assembly.LoadWithPartialName(System.String,System.Security.Policy.Evidence)
M:System.Reflection.Assembly.UnsafeLoadFrom(System.String)
@sepidehkh
Copy link
Contributor Author

The following are also missing NativeAssembly implementation:

M:System.Reflection.Assembly.get_EscapedCodeBase
M:System.Reflection.Assembly.get_GlobalAssemblyCache
M:System.Reflection.Assembly.get_HostContext
M:System.Reflection.AssemblyName.get_EscapedCodeBase

@rahku Could you please take care of these as well? Thanks.

@rahku
Copy link
Contributor

rahku commented Sep 14, 2016

will not be doing these as they are related to CAS
M:System.Reflection.Assembly.Load(byte[],byte[],System.Security.Policy.Evidence)
M:System.Reflection.Assembly.Load(byte[],byte[],System.Security.SecurityContextSource)
M:System.Reflection.Assembly.Load(System.Reflection.AssemblyName,System.Security.Policy.Evidence)
M:System.Reflection.Assembly.Load(System.String,System.Security.Policy.Evidence)
M:System.Reflection.Assembly.LoadFrom(System.String,System.Security.Policy.Evidence)
M:System.Reflection.Assembly.LoadFrom(System.String,System.Security.Policy.Evidence,byte[],System.Configuration
M:System.Reflection.Assembly.LoadFile(System.String,System.Security.Policy.Evidence)
M:System.Reflection.Assembly.LoadWithPartialName(System.String,System.Security.Policy.Evidence)

@rahku
Copy link
Contributor

rahku commented Sep 14, 2016

Below is the final list to be implemented:
M:System.Reflection.Assembly.LoadFrom(System.String)
M:System.Reflection.Assembly.LoadFrom(System.String,byte[],System.Configuration.Assemblies.AssemblyHashAlgorithm)
M:System.Reflection.Assembly.LoadFile(System.String)
M:System.Reflection.Assembly.LoadModule(System.String,byte[])
M:System.Reflection.Assembly.LoadModule(System.String,byte[],byte[])
M:System.Reflection.Assembly.LoadWithPartialName(System.String)
M:System.Reflection.Assembly.UnsafeLoadFrom(System.String)
M:System.Reflection.Assembly.get_EscapedCodeBase
M:System.Reflection.Assembly.get_GlobalAssemblyCache
M:System.Reflection.Assembly.get_HostContext
M:System.Reflection.AssemblyName.get_EscapedCodeBase

@sepidehkh
Copy link
Contributor Author

I could not add M:System.Reflection.MethodBase.get_IsSecuritySafeCritical to mscorlib either. CrossGen fails when adding this API. I believe there is something missing from VM in this case, although I couldn't get much information about it from the failure.

@rahku
Copy link
Contributor

rahku commented Sep 19, 2016

@danmosemsft @weshaggard is it fine to not implement CAS specific apis load apis listed here https://github.com/dotnet/corefx/issues/11655#issuecomment-247117297

@danmoseley
Copy link
Member

@rahku The authority is what's in https://github.com/dotnet/standard/tree/master/netstandard/ref in this case https://github.com/dotnet/standard/blob/master/netstandard/ref/mscorlib.appdomain.cs is where AppDomain is defined and it omits the CAS overloads.

@rahku
Copy link
Contributor

rahku commented Sep 19, 2016

@danmosemsft this issue is for reflection apis not appdomain. I found System.Reflection namespace in https://github.com/dotnet/standard/blob/master/netstandard/ref/mscorlib.cs and that omits CAS overloads. Thanks for the pointer.

@rahku
Copy link
Contributor

rahku commented Sep 19, 2016

CC @kouvel

@danmoseley
Copy link
Member

P:System.Reflection.Assembly.EscapedCodeBase
M:System.Reflection.Assembly.get_EscapedCodeBase
P:System.Reflection.Assembly.GlobalAssemblyCache
M:System.Reflection.Assembly.get_GlobalAssemblyCache
P:System.Reflection.Assembly.HostContext
M:System.Reflection.Assembly.get_HostContext
P:System.Reflection.Assembly.IsFullyTrusted
M:System.Reflection.Assembly.get_IsFullyTrusted
P:System.Reflection.Assembly.SecurityRuleSet
M:System.Reflection.Assembly.get_SecurityRuleSet
M:System.Reflection.Assembly.GetFile(System.String)
M:System.Reflection.Assembly.GetFiles
M:System.Reflection.Assembly.GetFiles(System.Boolean)
M:System.Reflection.Assembly.LoadFile(System.String)
M:System.Reflection.Assembly.LoadFrom(System.String)
M:System.Reflection.Assembly.LoadFrom(System.String,System.Byte[],System.Configuration.Assemblies.AssemblyHashAlgorithm)
M:System.Reflection.Assembly.LoadModule(System.String,System.Byte[])
M:System.Reflection.Assembly.LoadModule(System.String,System.Byte[],System.Byte[])
M:System.Reflection.Assembly.LoadWithPartialName(System.String)
M:System.Reflection.Assembly.UnsafeLoadFrom(System.String)

@danmoseley
Copy link
Member

@rahku Above is the list of what's left from NS2.0 -- GetFile(s) was missing from your list. Please check.

@AlexGhiondea
Copy link
Contributor

@rahku do you know how much work is left here?

@rahku
Copy link
Contributor

rahku commented Oct 19, 2016

i have completed most of work in PR dotnet/corefx#7681

@rahku
Copy link
Contributor

rahku commented Oct 19, 2016

remaining is EscapedCodeBase and getFiles which has a dependency on FileStream which needs to move to corelib

@rahku
Copy link
Contributor

rahku commented Oct 19, 2016

I still need to expose it in corefx though

@danmoseley
Copy link
Member

The following still remain missing from Assembly:

    public abstract class Assembly : ICustomAttributeProvider, ISerializable {
        public virtual string EscapedCodeBase { get; }
        public virtual FileStream GetFile(string name);
        public virtual FileStream[] GetFiles();
        public virtual FileStream[] GetFiles(bool getResourceModules);
        public virtual Module LoadModule(string moduleName, byte[] rawModule, byte[] rawSymbolStore);
    }

In the case of LoadModule it is present but misisng virtual

@rahku rahku closed this as completed Nov 18, 2016
@msftgits msftgits transferred this issue from dotnet/corefx Jan 31, 2020
@msftgits msftgits added this to the 2.0.0 milestone Jan 31, 2020
@ghost ghost locked as resolved and limited conversation to collaborators Dec 29, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants