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

Single Assembly resolver #214

Open
mxprshn opened this issue Dec 29, 2022 · 0 comments
Open

Single Assembly resolver #214

mxprshn opened this issue Dec 29, 2022 · 0 comments

Comments

@mxprshn
Copy link
Member

mxprshn commented Dec 29, 2022

Now in runner and test runner we have different code which resolves assemblies:

  • https://github.com/VSharp-team/VSharp/blob/master/VSharp.Utils/AssemblyManager.fs for runner (and test renderer)
  • and
    private static Assembly TryLoadAssemblyFrom(object sender, ResolveEventArgs args)
    {
    var existingInstance = AppDomain.CurrentDomain.GetAssemblies().FirstOrDefault(assembly => assembly.FullName == args.Name);
    if (existingInstance != null)
    {
    return existingInstance;
    }
    foreach (string path in _extraAssemblyLoadDirs)
    {
    string assemblyPath = Path.Combine(path, new AssemblyName(args.Name).Name + ".dll");
    if (!File.Exists(assemblyPath))
    return null;
    Assembly assembly = Assembly.LoadFrom(assemblyPath);
    return assembly;
    }
    return null;
    }
    for test runner

In particular, this code loads assemblies into different contexts, which means that something can work fine in runner, but don't work in test runner, or vice versa.

So, we need to use a single assembly manager for the whole V#. This manager should load assemblies into separate context (like https://github.com/VSharp-team/VSharp/blob/master/VSharp.Utils/AssemblyManager.fs)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant