handzlikchris / FastScriptReload

Hot Reload implementation for Unity. Iterate on code insanely fast without breaking play session. Supports any editor. 1. Play 2. Make change 3. See results
https://immersivevrtools.com/projects/fast-script-reload
MIT License
1.56k stars 113 forks source link

Visual Studio Code: Omnisharp can't resolve primary reference "0Harmony" #51

Open Tuntenfisch opened 1 year ago

Tuntenfisch commented 1 year ago

I'm using Visual Studio Code and Omnisharp complains that it cannot resolve "0Harmony" because it was built against a different framework version (v4.8) than the currently targeted one (v4.7.1):

[info]: OmniSharp.MSBuild.ProjectManager
        Successfully loaded project file 'c:\dev\unity\Simulator\FastScriptReload.Runtime.csproj'.
c:\dev\unity\Simulator\FastScriptReload.Runtime.csproj
C:\Program Files\dotnet\sdk\7.0.103\Microsoft.Common.CurrentVersion.targets(2352,5): Error: The primary reference "0Harmony" could not be resolved because it was built against the ".NETFramework,Version=v4.8" framework. This is a higher version than the currently targeted framework ".NETFramework,Version=v4.7.1".

Some more info:

Is there any way to resolve this issue?

handzlikchris commented 1 year ago

Hi, thanks for raising.

It's down to VSCode proj file adding some specific version of framework.

There are some workarounds, easiest probably to replace harmony dll with 4.8 compiled one. Attached is harmony targetting 4.8 that one of the guys on Discord compiled and shared

publish.zip

Also some more chat on Discord for that https://discord.com/channels/1054303923743227925/1054304339868516372/1093077874430464102

handzlikchris commented 1 year ago

need to add info in FAQ / docs secion