none
'!!0[] System.Array.Empty() error with Framework 4.6.1 installed

    Question

  • I recently upgraded my development machine and the production server (IIS V 8.0.9200 running on Windows server 2012 v 6.2) to.Net framework 4.6.1. Everything works fine on my development machine and a staging server, but on the production server I get:

    NEW ERROR 
    Message: Method not found: '!!0[] System.Array.Empty()'.
    
    Stack Trace:    at PlasmidTrackingWeb.AddNewPlasmid.GetPlasmid()
       at PlasmidTrackingWeb.AddNewPlasmid.databasePlasmidButton_Click(Object sender, EventArgs e) in C:\Visual Studio\PlasmidTrackingWeb\PlasmidTrackingWeb\AddNewPlasmid.aspx.cs:line 129
       at System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument)
       at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

    This error is only occurring with a specific method call, but since I can't reproduce on my machine, I don't see anything in that method that is not in lots of other methods which execute without error.

    It appears that the error is related to the framework version and possibly also the web.config file targeting the wrong framework. The server itself is running 4.6.1. The config file has

      <system.web>
        <compilation targetFramework="4.6.1" />
        <httpRuntime executionTimeout="200" targetFramework="4.6.1" maxRequestLength="20480" />
        <pages enableEventValidation="false" />
        <customErrors mode="Off" />
      </system.web>

    Looking at IIS configuration & Regedit ../Net Framework Setup/NDP/v4/Full the staging server & the production server look to me like they have identical configuration & framework versions.

    Any idea what could be wrong?

    Thanks,

    Ethan


    Ethan Strauss


    Tuesday, April 23, 2019 5:53 PM

Answers

  • Hi Ethan Strauss

    Welcome to the MSDN forum.

    See the error info and target version, I suspect the reason of issue is relevant with .net 4.6.1, has not updated successful in your production machine. could you please check if windows update is up to date and not warning or error shown in production machine. I suggest you to install a higher version, .NET 4.7 or later is alterative choose.

    Also, please have a look with this thread: https://stackoverflow.com/questions/31253747/method-not-found-0-system-array-empty  some members share a variety of workaround to troubleshot it.

    Please feel free to let me know if there has any update.

    Best

    May


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com


    Wednesday, April 24, 2019 6:38 AM
    Moderator

All replies

  • Hi Ethan Strauss

    Welcome to the MSDN forum.

    See the error info and target version, I suspect the reason of issue is relevant with .net 4.6.1, has not updated successful in your production machine. could you please check if windows update is up to date and not warning or error shown in production machine. I suggest you to install a higher version, .NET 4.7 or later is alterative choose.

    Also, please have a look with this thread: https://stackoverflow.com/questions/31253747/method-not-found-0-system-array-empty  some members share a variety of workaround to troubleshot it.

    Please feel free to let me know if there has any update.

    Best

    May


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com


    Wednesday, April 24, 2019 6:38 AM
    Moderator
  • Hi,

        Both the staging & production servers are running 4.6.1 (confirmed in the registry). The staging machine works fine, but the production machine does not.

    I removed and reinstalled the Framework 4.6.1 update on the production server. No change -:(

        I tracked down the specific line that was actually triggering the error. It came from

    String.Format("Text without any Arguments");

    I removed that and changed it to just the string and now everything works, but that clearly won't have fixed the underlying issue.

    There still must be a problem which caused the empty argument array to cause problems. And I am concerned about the fact that staging and production servers are behaving differently for unknown reasons.

    I don't want to upgrade to framework 4.7 unless I have to. I am going to poke at it a bit more first.

    Thanks!
    Ethan


    Ethan Strauss

    Thursday, April 25, 2019 4:06 PM
  • I just upgraded the production server to Framework to 4.7. Everything seems to work now.

    Ethan


    Ethan Strauss

    Friday, April 26, 2019 3:23 PM