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

Remove references to GlobalAssemblyCache #772

Merged
merged 1 commit into from
Apr 15, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -708,10 +708,6 @@ public virtual void Initialize(Type type)
{
TypeName = type.FullName;
AssemblyName assemblyName = type.Assembly.GetName(true);
if (type.Assembly.GlobalAssemblyCache)
{
assemblyName.CodeBase = null;
}

Dictionary<string, AssemblyName> parents = new Dictionary<string, AssemblyName>();
Type parentType = type;
Expand Down
16 changes: 4 additions & 12 deletions src/System.Windows.Forms/src/System/Resources/ResXDataNode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -825,13 +825,7 @@ public Assembly GetAssembly(AssemblyName name, bool throwOnError) {
}

if (result == null) {
// try to load it first from the gac
#pragma warning disable 0618
//Although LoadWithPartialName is obsolete, we still have to call it: changing
//this would be breaking in cases where people edited their resource files by
//hand.
result = Assembly.LoadWithPartialName(name.FullName);
#pragma warning restore 0618
result = Assembly.Load(name.FullName);
if(result != null) {
cachedAssemblies[name] = result;
}
Expand Down Expand Up @@ -882,13 +876,11 @@ public Type GetType(string name, bool throwOnError, bool ignoreCase) {
return result;
}

// Missed in cache, try to resolve the type. First try to resolve in the GAC
// Missed in cache, try to resolve the type from the reference assemblies.
if(name.IndexOf(',') != -1) {
result = Type.GetType(name, false, ignoreCase);
}

//
// Did not find it in the GAC, check the reference assemblies
if(result == null && names != null) {
//
// If the type is assembly qualified name, we sort the assembly names
Expand Down Expand Up @@ -944,9 +936,9 @@ public Type GetType(string name, bool throwOnError, bool ignoreCase) {
}

if(result != null) {
// Only cache types from .Net framework or GAC because they don't need to update.
// Only cache types from .Net framework because they don't need to update.
// For simplicity, don't cache custom types
if (result.Assembly.GlobalAssemblyCache || IsNetFrameworkAssembly(result.Assembly.Location)) {
if (IsNetFrameworkAssembly(result.Assembly.Location)) {
cachedTypes[name] = result;
}
}
Expand Down