Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Method not found: '!!0[] System.Array.Empty()'

I had this situation on the production server while on development machine everything was OK.

Installing .NET Framework 4.6 on the target machine has fixed the problem.


Sorry for being late to the party, but in case someone else gets this problem via a TeamCity build, I can describe what we had to do.

.NET 4.6 was installed on our build server (but not on the application server), and the RunnerType was Visual Studio (sln) and the Visual Studio option was set to 2015.

This forced the build to use 4.6, and I needed to change the Visual Studio option to 2013 to force the build to use 4.5.2


Just For others facing this situation:

if you look in the web.config file you will realize that in <compilation> tag you have the value targetFramework set to a version below 4.6. but in fact , at build time you published your application via .NET FrameWork 4.6 or above (Corresponds to ASP.NET MVC 4.6 and above).

So if you change the value of targetFramework to 4.6 the error will change shape into :

The 'targetFramework' attribute currently references a version that is later than the installed version of the .NET Framework.

this is the real error and you will get rid of it by installing appropriate Version of .Net FrameWork in production environment of your Web App.


Updating the .NET Framework to its latest (4.7.2) resolved the issue. Thanks to @Andrey Kovalenko for solution.

But should not the error be like,

enter image description here

I am not sure telling each customer about updating their .NET Framework is applicable. I had this issue especially at Windows Embedded OS installed system, only at production environment.

Is there any other way to overcome the behavior, from our code base itself.?


I try these solution without success.

The solution for me was go to the application pool, turn to 2.0, execute the site on browser, see the error (because the version is wrong) and turn back to 4.0 and "voilà", I got it, the website open.