Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

assemblymanager.cs: ResolveHandler finds assemblies based on StartsWith #533

Closed
Labels
Milestone
@rmadsen-ks

Description

@rmadsen-ks

Environment

  • Pythonnet version: All
  • Python version: All
  • Operating System: All

Details

  • Describe what you were trying to get done.
    Loading an assembly called MyAssembly. Assembly did not exist, should have resulted in an error, but instead it loaded MyAssemblyTest.
    This can be done using Assembly.Load("AssemblyName").

Effectively this changes the way .NET normally loads assemblies and it ignores things such as strong naming. This could cause all kinds of unexpected effects in larger systems.

staticAssemblyResolveHandler(Objectob,ResolveEventArgsargs){stringname=args.Name.ToLower();for(inti=0;i<assemblies.Count;i++){Assemblya=(Assembly)assemblies[i];stringfull=a.FullName.ToLower();if(full.StartsWith(name)){// this is a problem!returna;}}returnLoadAssemblyPath(args.Name);}

The FindAssembly method has obvious issues as well, but it only searches inside the python path, so the effect there is limited. The ResolveHandler searches through all currently loaded assemblies, which is a bigger problem.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp