Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Conversation

@sdmaclea
Copy link

@sdmaclea sdmaclea commented Apr 23, 2019

When loading satellite assemblies, we should probe next to the parent
assembly and load into the same AssemblyLoadContext as the parent
assembly.

Disable fallback probing for satellite assemblies.

Add AssemblyLoadContext.Resolving handler to probe for satellite
assemblies next to parent

Fixes #20979
Fixes #24211

@sdmaclea
Copy link
Author

I have not yet tested this. I will write tests in corefx, and manually test before merging this.

  • I wanted to make sure we were OK w/ writing this in managed code.
  • The FindCaseInsensitiveSatellitePath() code could be simpler if a *.GetDirectories() existed in CoreCLR. It seems these are implemented in CoreFX on top of the same InterOp.

When loading satellite assemblies, we should probe next to the parent
assembly and load into the same AssemblyLoadContext as the parent
assembly.

Disable fallback probing for satellite assemblies.

Add AssemblyLoadContext.Resolving handler to probe for satellite
assemblies next to parent

Fixes #20979
Only call ResolveSatelliteAssembly from native when
resolving a satellite assembly
Minimize string creation
Remove unnecessary if null checks
Eliminate corner cases by only allowing one case insensitive matching directory.
ResolveSatelliteAssembly should always be called on the ALC which loaded parentAssembly

Simplify code.
Add Debug.Assert
@sdmaclea sdmaclea force-pushed the SatelliteAssemblies branch from 051fe9f to 2f52d2f Compare April 25, 2019 15:46
@sdmaclea sdmaclea changed the title WIP Fix Satellite Assembly loading Fix Satellite Assembly loading Apr 25, 2019
@sdmaclea
Copy link
Author

I added the lower case culture probe since there seems to be consensus that this may be a good long term approach.
This is passing my manual testing. I'll write formal corefx testing...

@sdmaclea sdmaclea merged commit a65e2b9 into dotnet:master Apr 29, 2019
@sdmaclea sdmaclea deleted the SatelliteAssemblies branch April 29, 2019 19:37
Dotnet-GitSync-Bot pushed a commit to Dotnet-GitSync-Bot/corefx that referenced this pull request Apr 29, 2019
* Fix Satellite Assembly loading

When loading satellite assemblies, we should probe next to the parent
assembly and load into the same AssemblyLoadContext as the parent
assembly.

Disable fallback probing for satellite assemblies.

Add AssemblyLoadContext.Resolving handler to probe for satellite
assemblies next to parent

Fixes #20979

* Call ResolveSatelliteAssembly from native

Only call ResolveSatelliteAssembly from native when
resolving a satellite assembly

* PR Feedback

Minimize string creation
Remove unnecessary if null checks
Eliminate corner cases by only allowing one case insensitive matching directory.

* ResolveSatelliteAssembly should ...

ResolveSatelliteAssembly should always be called on the ALC which loaded parentAssembly

Simplify code.
Add Debug.Assert

* Remove case insensitive culture search

* PR Feedback

* Fix parentAssembly logic

* Fixes from initial testing

* Add probe for lower case culture name

* PR feedback

Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
Dotnet-GitSync-Bot pushed a commit to Dotnet-GitSync-Bot/corert that referenced this pull request Apr 29, 2019
* Fix Satellite Assembly loading

When loading satellite assemblies, we should probe next to the parent
assembly and load into the same AssemblyLoadContext as the parent
assembly.

Disable fallback probing for satellite assemblies.

Add AssemblyLoadContext.Resolving handler to probe for satellite
assemblies next to parent

Fixes #20979

* Call ResolveSatelliteAssembly from native

Only call ResolveSatelliteAssembly from native when
resolving a satellite assembly

* PR Feedback

Minimize string creation
Remove unnecessary if null checks
Eliminate corner cases by only allowing one case insensitive matching directory.

* ResolveSatelliteAssembly should ...

ResolveSatelliteAssembly should always be called on the ALC which loaded parentAssembly

Simplify code.
Add Debug.Assert

* Remove case insensitive culture search

* PR Feedback

* Fix parentAssembly logic

* Fixes from initial testing

* Add probe for lower case culture name

* PR feedback

Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
Dotnet-GitSync-Bot pushed a commit to Dotnet-GitSync-Bot/mono that referenced this pull request Apr 29, 2019
* Fix Satellite Assembly loading

When loading satellite assemblies, we should probe next to the parent
assembly and load into the same AssemblyLoadContext as the parent
assembly.

Disable fallback probing for satellite assemblies.

Add AssemblyLoadContext.Resolving handler to probe for satellite
assemblies next to parent

Fixes mono#20979

* Call ResolveSatelliteAssembly from native

Only call ResolveSatelliteAssembly from native when
resolving a satellite assembly

* PR Feedback

Minimize string creation
Remove unnecessary if null checks
Eliminate corner cases by only allowing one case insensitive matching directory.

* ResolveSatelliteAssembly should ...

ResolveSatelliteAssembly should always be called on the ALC which loaded parentAssembly

Simplify code.
Add Debug.Assert

* Remove case insensitive culture search

* PR Feedback

* Fix parentAssembly logic

* Fixes from initial testing

* Add probe for lower case culture name

* PR feedback

Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
marek-safar pushed a commit to mono/mono that referenced this pull request Apr 29, 2019
* Fix Satellite Assembly loading

When loading satellite assemblies, we should probe next to the parent
assembly and load into the same AssemblyLoadContext as the parent
assembly.

Disable fallback probing for satellite assemblies.

Add AssemblyLoadContext.Resolving handler to probe for satellite
assemblies next to parent

Fixes #20979

* Call ResolveSatelliteAssembly from native

Only call ResolveSatelliteAssembly from native when
resolving a satellite assembly

* PR Feedback

Minimize string creation
Remove unnecessary if null checks
Eliminate corner cases by only allowing one case insensitive matching directory.

* ResolveSatelliteAssembly should ...

ResolveSatelliteAssembly should always be called on the ALC which loaded parentAssembly

Simplify code.
Add Debug.Assert

* Remove case insensitive culture search

* PR Feedback

* Fix parentAssembly logic

* Fixes from initial testing

* Add probe for lower case culture name

* PR feedback

Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
jkotas pushed a commit to dotnet/corert that referenced this pull request Apr 29, 2019
* Fix Satellite Assembly loading

When loading satellite assemblies, we should probe next to the parent
assembly and load into the same AssemblyLoadContext as the parent
assembly.

Disable fallback probing for satellite assemblies.

Add AssemblyLoadContext.Resolving handler to probe for satellite
assemblies next to parent

Fixes #20979

* Call ResolveSatelliteAssembly from native

Only call ResolveSatelliteAssembly from native when
resolving a satellite assembly

* PR Feedback

Minimize string creation
Remove unnecessary if null checks
Eliminate corner cases by only allowing one case insensitive matching directory.

* ResolveSatelliteAssembly should ...

ResolveSatelliteAssembly should always be called on the ALC which loaded parentAssembly

Simplify code.
Add Debug.Assert

* Remove case insensitive culture search

* PR Feedback

* Fix parentAssembly logic

* Fixes from initial testing

* Add probe for lower case culture name

* PR feedback

Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
stephentoub pushed a commit to dotnet/corefx that referenced this pull request Apr 29, 2019
* Fix Satellite Assembly loading

When loading satellite assemblies, we should probe next to the parent
assembly and load into the same AssemblyLoadContext as the parent
assembly.

Disable fallback probing for satellite assemblies.

Add AssemblyLoadContext.Resolving handler to probe for satellite
assemblies next to parent

Fixes #20979

* Call ResolveSatelliteAssembly from native

Only call ResolveSatelliteAssembly from native when
resolving a satellite assembly

* PR Feedback

Minimize string creation
Remove unnecessary if null checks
Eliminate corner cases by only allowing one case insensitive matching directory.

* ResolveSatelliteAssembly should ...

ResolveSatelliteAssembly should always be called on the ALC which loaded parentAssembly

Simplify code.
Add Debug.Assert

* Remove case insensitive culture search

* PR Feedback

* Fix parentAssembly logic

* Fixes from initial testing

* Add probe for lower case culture name

* PR feedback

Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
sdmaclea added a commit to sdmaclea/corefx that referenced this pull request Apr 30, 2019
sdmaclea added a commit to dotnet/corefx that referenced this pull request Apr 30, 2019
Enable SatelliteAssembly tests relying on dotnet/coreclr#24191
picenka21 pushed a commit to picenka21/runtime that referenced this pull request Feb 18, 2022
* Fix Satellite Assembly loading

When loading satellite assemblies, we should probe next to the parent
assembly and load into the same AssemblyLoadContext as the parent
assembly.

Disable fallback probing for satellite assemblies.

Add AssemblyLoadContext.Resolving handler to probe for satellite
assemblies next to parent

Fixes dotnet/coreclr#20979

* Call ResolveSatelliteAssembly from native

Only call ResolveSatelliteAssembly from native when
resolving a satellite assembly

* PR Feedback

Minimize string creation
Remove unnecessary if null checks
Eliminate corner cases by only allowing one case insensitive matching directory.

* ResolveSatelliteAssembly should ...

ResolveSatelliteAssembly should always be called on the ALC which loaded parentAssembly

Simplify code.
Add Debug.Assert

* Remove case insensitive culture search

* PR Feedback

* Fix parentAssembly logic

* Fixes from initial testing

* Add probe for lower case culture name

* PR feedback


Commit migrated from dotnet/coreclr@a65e2b9
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Satellite Lookup on case sensitive file systems... LoadFrom Resource Fallback search fails to search next to current executing assembly

4 participants