Jump to content

Reference version error (can't target .NET7 framework) [SOLVED]


Frepo

Recommended Posts

I just got back to modding again after a long time away. I noticed the game is now .NET7-based. After downloading the SDK I started my old project and tried a rebuild, and got this error:

image.thumb.png.cc7c3ec9f97f3fdccb8dc34472acbbf2.png

My mod still works fine after I updated the game (no changes whatsoever to the mod). I'm not sure what to make of this error. I realized my project wasn't targeting the .NET7 framework. I guess that must be the cause of the error. Problem is, I can't select the .NET7 framework in my project settings. It simply isn't there! 

image.png.75b073334c8a67705a02afd35645617e.png

The SDK seems to be installed and working.
image.png.96390c324c849baae8c73077f6fbfd2b.png

Visual Studio is up to date.
image.png.b68d6cbb62400b2bd5977aa282454ec4.png

Someone at StackOverflow mentioned you should check the box "Use previews of the .NET SDK"-box, and so I did.
image.png.d568b954b817e1d750d25c990f6aedb9.png

 

Is there anything else I need to do to make VS find the new framework version?

Edited by Frepo
Link to comment
Share on other sites

  • Frepo changed the title to Reference version error (can't target .NET7 framework)

Re-installed Visual Studio and made sure the .NET desktop development workload is installed as well.

image.png.3394c871e37c122a84bad67db1ee93e8.png

Still same error. I'm not accustomed to visual studio at all, but I noticed that VintagestoryAPI.dll is compiled against an older runtime version of .NET (v4.x).

image.png.0fc700b8e21bf7502bded4e0ca65163a.png

This must be because VS i targeting a 4.x-framework (4.8 in my case), right? So changing the target framework to 7.x (if I only could) should recompile the assembly against that version instead, right?

Edited by Frepo
Link to comment
Share on other sites

  • Frepo changed the title to Reference version error (can't target .NET7 framework) [SOLVED]
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.