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

Conversation

Projects
None yet
2 participants
@hughbe
Copy link
Contributor

hughbe commented Apr 13, 2019

The GAC is not supported in .NET Core - Assembly.GlobalAssemblyCache always returns false, for example.

Therefore this is all dead in .NET Core. However, there may be a breaking change. Consider that the user defines their own non-runtime assembly by directly subclassing Assembly instead of using typeof(int).Assembly for example. If they overrode GlobalAssemblyCache to return true in .NET Core then the code that I deleted would have been run. However, the entire GAC feature has been removed in .NET Core so I firstly don't see this happening and secondly the code is actually meaningless anyway.

Contributes to #485

@hughbe hughbe requested a review from dotnet/dotnet-winforms as a code owner Apr 13, 2019

@hughbe hughbe force-pushed the hughbe:remove-gac branch from 01726c0 to 63fe721 Apr 13, 2019

@hughbe

This comment has been minimized.

Copy link
Contributor Author

hughbe commented Apr 13, 2019

In ResXDataNote.cs we have the following code:

            if(result != null) {
                // Only cache types from .Net framework  because they don't need to update.
                // For simplicity, don't cache custom types
                if (IsNetFrameworkAssembly(result.Assembly.Location)) {
                    cachedTypes[name] = result;
                }
            }
...
        /// <devdoc>
        /// This is matching %windir%\Microsoft.NET\Framework*, so both 32bit and 64bit framework will be covered.
        /// </devdoc>
        private bool IsNetFrameworkAssembly(string assemblyPath)
        {
            return assemblyPath != null && assemblyPath.StartsWith(NetFrameworkPath, StringComparison.OrdinalIgnoreCase);
        }

This code refers to the .NET Framework (which is obviously not .NET Core). Should it be removed?

@hughbe hughbe force-pushed the hughbe:remove-gac branch from 63fe721 to e4f0930 Apr 15, 2019

@zsd4yr

zsd4yr approved these changes Apr 15, 2019

Copy link
Member

zsd4yr left a comment

bless you. I was JUST about to do this haha

@zsd4yr

This comment has been minimized.

Copy link
Member

zsd4yr commented Apr 15, 2019

@hughbe #485 is a task to remove framework isms. If you'd like to venture such a PR, you are welcome to. However, I think this will be a bit tricky and will not simply be a matter of deleting all references and references to those references.

@zsd4yr zsd4yr merged commit 5e0710c into dotnet:master Apr 15, 2019

1 check passed

license/cla All CLA requirements met.
Details

@hughbe hughbe deleted the hughbe:remove-gac branch Apr 15, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.