IAmBatby / Tremor

Tremor mod, for tModLoader Terraria
38 stars 22 forks source link

RecipeWrapper: Method not found: '!!0[] System.Array.Empty()'. at Tremor.RecipeData..cctor() #10

Closed Jofairden closed 7 years ago

Jofairden commented 7 years ago
    The type initializer for 'Tremor.RecipeData' threw an exception.
    at Tremor.RecipeWrapper.RemoveRecipes()
    at Tremor.Tremor.AddRecipes()
    at Terraria.ModLoader.RecipeHooks.AddRecipes()

    Inner Exception:
    Method not found: '!!0[] System.Array.Empty()'.
    at Tremor.RecipeData..cctor()

Something something Roselyn/Optimalization stuff https://github.com/dotnet/roslyn/issues/4889 https://github.com/Microsoft/vsts-agent/issues/192 https://connect.microsoft.com/VisualStudio/feedback/details/1097462/missingmethodexception-additional-information-method-not-found-0-system-array-empty https://stackoverflow.com/questions/31253747/method-not-found-0-system-array-empty-asapp-bundleconfig-registerbundl

Jofairden commented 7 years ago

Most likely what is happening is that:

  • The code is compiling against .NET 4.6, where the reference assemblies include Array.Empty().
  • The Roslyn compiler sees that Array.Empty is available and so uses it when generating the empty array needed for the params.
  • The compiled app is trying to run on .NET 4.5 where Array.Empty doesn’t exist
RagingWarrior2 commented 7 years ago

So what do I need to do in order to fix this issue?

Jofairden commented 7 years ago

This is a weird .NET issue. The current workaround is to install .NET 4.6: https://www.microsoft.com/en-us/download/details.aspx?id=48130

RagingWarrior2 commented 7 years ago

Ok thank you for the help with this issue, because the last time this happened all i needed to do was to manually install the update and it worked but this time is another story.

NovaKampfer commented 7 years ago

im geting the same thing even after i dowanloaded the thing