~ruther/NosSmooth.Local

52f1450245efae1e62d37b8976fae0ef1511fa63 — Rutherther 2 years ago 4b22cbc main
fix: correct paths to nethost.dll
M src/Inject/NosSmooth.Injector/NosInjector.cs => src/Inject/NosSmooth.Injector/NosInjector.cs +11 -3
@@ 67,7 67,14 @@ public class NosInjector
    )
    {
        using var process = Process.GetProcessById(processId);
        return Inject(process, dllPath, classPath, methodName, data);
        return Inject
        (
            process,
            dllPath,
            classPath,
            methodName,
            data
        );
    }

    /// <summary>


@@ 113,8 120,8 @@ public class NosInjector
            var netHostInjectionResult = InjectNetHostDll
            (
                injector,
                Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location),
                System.IO.Path.GetDirectoryName(dllPath),
                Path.GetFullPath("."),
                System.IO.Path.GetDirectoryName(Path.GetFullPath(dllPath)),
                System.IO.Path.GetDirectoryName(process.MainModule?.FileName)
            );



@@ 204,6 211,7 @@ public class NosInjector
    private Result InjectNetHostDll(Reloaded.Injector.Injector injector, params string?[] pathsToSearch)
    {
        string? foundPath = pathsToSearch
            .Where(x => !string.IsNullOrEmpty(x))
            .Select(x => Path.Join(x, "nethost.dll"))
            .Select(Path.GetFullPath)
            .FirstOrDefault(File.Exists);

M src/Inject/NosSmooth.Injector/NosSmooth.Injector.csproj => src/Inject/NosSmooth.Injector/NosSmooth.Injector.csproj +1 -1
@@ 5,7 5,7 @@
    <AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb;.dll</AllowedOutputExtensionsInPackageBuildOutputFolder>
    <ImplicitUsings>enable</ImplicitUsings>
    <Nullable>enable</Nullable>
    <VersionPrefix>2.0.0</VersionPrefix>
    <VersionPrefix>2.0.1</VersionPrefix>
    <PackageReleaseNotes>Inject with possibility to return an integer and pass in arbitrary arguments.</PackageReleaseNotes>
  </PropertyGroup>


Do not follow this link