Closed winstxnhdw closed 2 years ago
What sort of project is SomeMode and what sort of library is the Harmony lib (managed, unmanged, etc)?
What sort of project is SomeMode and what sort of library is the Harmony lib (managed, unmanged, etc)?
@GeertvanHorrik No idea what managed or unmanaged means, but according to this forum, I am guessing it is managed.
I am not sure what to tell you about SomeMod. It's a DLL that'll be injected into a Mono program?
Might be useful to show my .csproj here.
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutDir>../bin</OutDir>
<LangVersion>latest</LangVersion>
<TargetFramework>net35</TargetFramework>
<RootNamespace>SomeMod</RootNamespace>
<ImplicitUsings>disable</ImplicitUsings>
</PropertyGroup>
<ItemGroup>
<Reference Include="Assembly-CSharp">
<HintPath>./SomeMod/References/Assembly-CSharp.dll</HintPath>
</Reference>
<Reference Include="UnityEngine">
<HintPath>./References/UnityEngine.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.UI">
<HintPath>./References/UnityEngine.UI.dll</HintPath>
</Reference>
<Reference Include="Photon3Unity3D">
<HintPath>./References/Photon3Unity3D.dll</HintPath>
</Reference>
<PackageReference Include="Fody" Version="6.6.3">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive; compile</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Costura.Fody" Version="5.7.0">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive; compile</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Lib.Harmony" Version="2.2.1" />
</ItemGroup>
</Project>
<TargetFramework>net35</TargetFramework>
This is an unsupported target framework. Also not marking the Lib.Harmony as private assets defeats the purpose of Costura.
I think it's important to understand managed vs. unmanaged first since it makes a huge difference on how to use Costura. Please read more here
Also please note that Costura is in maintenance mode and getting support is not very likely.
MSBuild Error
SOLUTION: No need to use Fody for something like this. Simply embed the DLL as a resource in your .csproj, and then load the resource on runtime. It’s a lot more complex than it sounds without Visual Studios.
I heard Fody.Costura is able to add reference assemblies as resources. Seen at pardeike/Harmony#234. In this case, I am trying to embed the Lib.Harmony.dll into my main .DLL file.
Please check all of the platforms you are having the issue on (if platform is not listed, it is not supported)
Version of Library
v5.7.0 (Latest)
Version of OS(s) listed above with issue
Windows 10
Steps to Reproduce
Expected Behavior
Actual Behavior