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












101














I created a new app with VS 2015 RC and the MVC template and without modifying any line of code I have this error:



Method not found: '!!0 System.Array.Empty()'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.MissingMethodException: Method not found: '!!0 System.Array.Empty()'.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:


[MissingMethodException: Method not found: '!!0 System.Array.Empty()'.]
SAASApp.BundleConfig.RegisterBundles(BundleCollection bundles) in C:ProyectosSAASAppSAASAppApp_StartBundleConfig.cs:29
SAASApp.MvcApplication.Application_Start() in C:ProyectosSAASAppSAASAppGlobal.asax.cs:18

[HttpException (0x80004005): Method not found: '!!0 System.Array.Empty()'.]
System.Web.HttpApplicationFactory.EnsureAppStartCalledForIntegratedMode(HttpContext context, HttpApplication app) +483
System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo handlers) +118
System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo handlers, IntPtr appContext, HttpContext context) +176
System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +350
System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +305

[HttpException (0x80004005): Method not found: '!!0 System.Array.Empty()'.]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +661
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +96
System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +189


First time it happens to me, so I am stuck at the moment










share|improve this question
























  • possible duplicate of MVC 5 Bundle Error
    – ramiramilu
    Jul 6 '15 at 19:16
















101














I created a new app with VS 2015 RC and the MVC template and without modifying any line of code I have this error:



Method not found: '!!0 System.Array.Empty()'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.MissingMethodException: Method not found: '!!0 System.Array.Empty()'.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:


[MissingMethodException: Method not found: '!!0 System.Array.Empty()'.]
SAASApp.BundleConfig.RegisterBundles(BundleCollection bundles) in C:ProyectosSAASAppSAASAppApp_StartBundleConfig.cs:29
SAASApp.MvcApplication.Application_Start() in C:ProyectosSAASAppSAASAppGlobal.asax.cs:18

[HttpException (0x80004005): Method not found: '!!0 System.Array.Empty()'.]
System.Web.HttpApplicationFactory.EnsureAppStartCalledForIntegratedMode(HttpContext context, HttpApplication app) +483
System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo handlers) +118
System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo handlers, IntPtr appContext, HttpContext context) +176
System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +350
System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +305

[HttpException (0x80004005): Method not found: '!!0 System.Array.Empty()'.]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +661
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +96
System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +189


First time it happens to me, so I am stuck at the moment










share|improve this question
























  • possible duplicate of MVC 5 Bundle Error
    – ramiramilu
    Jul 6 '15 at 19:16














101












101








101


11





I created a new app with VS 2015 RC and the MVC template and without modifying any line of code I have this error:



Method not found: '!!0 System.Array.Empty()'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.MissingMethodException: Method not found: '!!0 System.Array.Empty()'.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:


[MissingMethodException: Method not found: '!!0 System.Array.Empty()'.]
SAASApp.BundleConfig.RegisterBundles(BundleCollection bundles) in C:ProyectosSAASAppSAASAppApp_StartBundleConfig.cs:29
SAASApp.MvcApplication.Application_Start() in C:ProyectosSAASAppSAASAppGlobal.asax.cs:18

[HttpException (0x80004005): Method not found: '!!0 System.Array.Empty()'.]
System.Web.HttpApplicationFactory.EnsureAppStartCalledForIntegratedMode(HttpContext context, HttpApplication app) +483
System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo handlers) +118
System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo handlers, IntPtr appContext, HttpContext context) +176
System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +350
System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +305

[HttpException (0x80004005): Method not found: '!!0 System.Array.Empty()'.]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +661
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +96
System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +189


First time it happens to me, so I am stuck at the moment










share|improve this question















I created a new app with VS 2015 RC and the MVC template and without modifying any line of code I have this error:



Method not found: '!!0 System.Array.Empty()'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.MissingMethodException: Method not found: '!!0 System.Array.Empty()'.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:


[MissingMethodException: Method not found: '!!0 System.Array.Empty()'.]
SAASApp.BundleConfig.RegisterBundles(BundleCollection bundles) in C:ProyectosSAASAppSAASAppApp_StartBundleConfig.cs:29
SAASApp.MvcApplication.Application_Start() in C:ProyectosSAASAppSAASAppGlobal.asax.cs:18

[HttpException (0x80004005): Method not found: '!!0 System.Array.Empty()'.]
System.Web.HttpApplicationFactory.EnsureAppStartCalledForIntegratedMode(HttpContext context, HttpApplication app) +483
System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo handlers) +118
System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo handlers, IntPtr appContext, HttpContext context) +176
System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +350
System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +305

[HttpException (0x80004005): Method not found: '!!0 System.Array.Empty()'.]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +661
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +96
System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +189


First time it happens to me, so I am stuck at the moment







c# asp.net asp.net-mvc asp.net-mvc-3






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Aug 28 at 18:02









DaveInCaz

2,96831635




2,96831635










asked Jul 6 '15 at 19:10









Luis Valencia

8,85144163300




8,85144163300












  • possible duplicate of MVC 5 Bundle Error
    – ramiramilu
    Jul 6 '15 at 19:16


















  • possible duplicate of MVC 5 Bundle Error
    – ramiramilu
    Jul 6 '15 at 19:16
















possible duplicate of MVC 5 Bundle Error
– ramiramilu
Jul 6 '15 at 19:16




possible duplicate of MVC 5 Bundle Error
– ramiramilu
Jul 6 '15 at 19:16












9 Answers
9






active

oldest

votes


















195














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.






share|improve this answer

















  • 10




    Thank you. What an unbelievable error message!
    – TEK
    Apr 4 '16 at 16:21






  • 41




    PC LOAD LETTER!
    – JeremyWeir
    May 19 '16 at 22:56










  • Much appreciated!!!
    – Neelam
    Jun 1 '16 at 5:42






  • 5




    Thank you. Most likely what is happening is that: - The code is compiling against .NET 4.6, where the reference assemblies include Array.Empty<T>(). - The Roslyn compiler sees that Array.Empty<T> 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 exit.
    – wkalter
    Mar 21 '17 at 10:31






  • 1




    Our Windows 2008R2 Server had to restart once after installation.
    – Karl
    May 7 at 10:53



















23














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






share|improve this answer

















  • 5




    A good colleague of mine pointed out to me that you can build with Visual Studio 2015 if your build agent has the requirement DotNetFrameworkTargetingPack4.5.2_Path TeamCity will then build the solution towards 4.5.2, even if 4.6 is installed
    – gautejohan
    Feb 17 '16 at 8:10








  • 2




    I resolved this issue by using the 4.5.2 dev pack as @gman suggested. In situations where you don't want to have 4.6 installed, this seems like a better solution.
    – Dougc
    Mar 9 '16 at 16:05










  • Asking after many years, this is for you @Dougc. I am in a similar situation, i don't want 4.6 installed and i have 4.5.2 installed. Still i get this issue. What is it that gman suggested??
    – singsuyash
    Apr 23 '16 at 9:43










  • @singsuyash, in the project configuration, go to Agent Requirements. There you click add new requirement. Type DotNetFrameworkTargetingPack4.5.2_Path in the parameter name and set condition to exist.
    – gautejohan
    Apr 26 '16 at 6:08



















9














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.






share|improve this answer





















  • However, after you do this, and depending on the project template selected when the application was created, if you have the insight and codeDom applications installed, you may have to uninstall them as I did. I received an array error which traced back to roslyn and Microsoft Application Insight.
    – Clarence
    Oct 16 '17 at 6:00



















1














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.






share|improve this answer





























    1














    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.?






    share|improve this answer























    • Targeting older .NET Framework (4.0 Client Profile) for my project and all DLL projects also worked. :)
      – Naveen Kumar V
      yesterday





















    0














    In my case, I had a corrupt .NET installation on my Windows Server 2012 R2. I had to install a more recent version of .NET (v4.7.1) and the site is working now.






    share|improve this answer





























      0














      In my case, I don't have access to the IIS itself and I was having this problem when I was using a single method which doesn't have anything special only things from .net 2.



      The solution: I've Extracted that method and created a Class Library with .net 2.0 and it works.






      share|improve this answer





























        0














        Maybe it too late but I got the same problem and fixed as below.
        I use Visual Studio 2015 ,the configuration compilation on web.config point to .NET FrameWork 4.6 by default. I could not just edit only on the web.config file. If you can not install .NET FrameWork 4.6 on server and your application don't use it.




        1. Go to menu Debug > [Project Name] Properties > Application .

        2. choose the .NET Framework 4.5 (or any which server support and compatible your application) from Target Framwork dropdown list.

        3. Rebuild again.






        share|improve this answer































          0














          I have downgraded 4.6.x to 4.5.2 and it worked fine.






          share|improve this answer























            Your Answer






            StackExchange.ifUsing("editor", function () {
            StackExchange.using("externalEditor", function () {
            StackExchange.using("snippets", function () {
            StackExchange.snippets.init();
            });
            });
            }, "code-snippets");

            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "1"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f31253747%2fmethod-not-found-0-system-array-empty%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            9 Answers
            9






            active

            oldest

            votes








            9 Answers
            9






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            195














            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.






            share|improve this answer

















            • 10




              Thank you. What an unbelievable error message!
              – TEK
              Apr 4 '16 at 16:21






            • 41




              PC LOAD LETTER!
              – JeremyWeir
              May 19 '16 at 22:56










            • Much appreciated!!!
              – Neelam
              Jun 1 '16 at 5:42






            • 5




              Thank you. Most likely what is happening is that: - The code is compiling against .NET 4.6, where the reference assemblies include Array.Empty<T>(). - The Roslyn compiler sees that Array.Empty<T> 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 exit.
              – wkalter
              Mar 21 '17 at 10:31






            • 1




              Our Windows 2008R2 Server had to restart once after installation.
              – Karl
              May 7 at 10:53
















            195














            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.






            share|improve this answer

















            • 10




              Thank you. What an unbelievable error message!
              – TEK
              Apr 4 '16 at 16:21






            • 41




              PC LOAD LETTER!
              – JeremyWeir
              May 19 '16 at 22:56










            • Much appreciated!!!
              – Neelam
              Jun 1 '16 at 5:42






            • 5




              Thank you. Most likely what is happening is that: - The code is compiling against .NET 4.6, where the reference assemblies include Array.Empty<T>(). - The Roslyn compiler sees that Array.Empty<T> 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 exit.
              – wkalter
              Mar 21 '17 at 10:31






            • 1




              Our Windows 2008R2 Server had to restart once after installation.
              – Karl
              May 7 at 10:53














            195












            195








            195






            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.






            share|improve this answer












            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.







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Aug 18 '15 at 15:00









            Andrey Kovalenko

            1,974163




            1,974163








            • 10




              Thank you. What an unbelievable error message!
              – TEK
              Apr 4 '16 at 16:21






            • 41




              PC LOAD LETTER!
              – JeremyWeir
              May 19 '16 at 22:56










            • Much appreciated!!!
              – Neelam
              Jun 1 '16 at 5:42






            • 5




              Thank you. Most likely what is happening is that: - The code is compiling against .NET 4.6, where the reference assemblies include Array.Empty<T>(). - The Roslyn compiler sees that Array.Empty<T> 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 exit.
              – wkalter
              Mar 21 '17 at 10:31






            • 1




              Our Windows 2008R2 Server had to restart once after installation.
              – Karl
              May 7 at 10:53














            • 10




              Thank you. What an unbelievable error message!
              – TEK
              Apr 4 '16 at 16:21






            • 41




              PC LOAD LETTER!
              – JeremyWeir
              May 19 '16 at 22:56










            • Much appreciated!!!
              – Neelam
              Jun 1 '16 at 5:42






            • 5




              Thank you. Most likely what is happening is that: - The code is compiling against .NET 4.6, where the reference assemblies include Array.Empty<T>(). - The Roslyn compiler sees that Array.Empty<T> 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 exit.
              – wkalter
              Mar 21 '17 at 10:31






            • 1




              Our Windows 2008R2 Server had to restart once after installation.
              – Karl
              May 7 at 10:53








            10




            10




            Thank you. What an unbelievable error message!
            – TEK
            Apr 4 '16 at 16:21




            Thank you. What an unbelievable error message!
            – TEK
            Apr 4 '16 at 16:21




            41




            41




            PC LOAD LETTER!
            – JeremyWeir
            May 19 '16 at 22:56




            PC LOAD LETTER!
            – JeremyWeir
            May 19 '16 at 22:56












            Much appreciated!!!
            – Neelam
            Jun 1 '16 at 5:42




            Much appreciated!!!
            – Neelam
            Jun 1 '16 at 5:42




            5




            5




            Thank you. Most likely what is happening is that: - The code is compiling against .NET 4.6, where the reference assemblies include Array.Empty<T>(). - The Roslyn compiler sees that Array.Empty<T> 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 exit.
            – wkalter
            Mar 21 '17 at 10:31




            Thank you. Most likely what is happening is that: - The code is compiling against .NET 4.6, where the reference assemblies include Array.Empty<T>(). - The Roslyn compiler sees that Array.Empty<T> 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 exit.
            – wkalter
            Mar 21 '17 at 10:31




            1




            1




            Our Windows 2008R2 Server had to restart once after installation.
            – Karl
            May 7 at 10:53




            Our Windows 2008R2 Server had to restart once after installation.
            – Karl
            May 7 at 10:53













            23














            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






            share|improve this answer

















            • 5




              A good colleague of mine pointed out to me that you can build with Visual Studio 2015 if your build agent has the requirement DotNetFrameworkTargetingPack4.5.2_Path TeamCity will then build the solution towards 4.5.2, even if 4.6 is installed
              – gautejohan
              Feb 17 '16 at 8:10








            • 2




              I resolved this issue by using the 4.5.2 dev pack as @gman suggested. In situations where you don't want to have 4.6 installed, this seems like a better solution.
              – Dougc
              Mar 9 '16 at 16:05










            • Asking after many years, this is for you @Dougc. I am in a similar situation, i don't want 4.6 installed and i have 4.5.2 installed. Still i get this issue. What is it that gman suggested??
              – singsuyash
              Apr 23 '16 at 9:43










            • @singsuyash, in the project configuration, go to Agent Requirements. There you click add new requirement. Type DotNetFrameworkTargetingPack4.5.2_Path in the parameter name and set condition to exist.
              – gautejohan
              Apr 26 '16 at 6:08
















            23














            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






            share|improve this answer

















            • 5




              A good colleague of mine pointed out to me that you can build with Visual Studio 2015 if your build agent has the requirement DotNetFrameworkTargetingPack4.5.2_Path TeamCity will then build the solution towards 4.5.2, even if 4.6 is installed
              – gautejohan
              Feb 17 '16 at 8:10








            • 2




              I resolved this issue by using the 4.5.2 dev pack as @gman suggested. In situations where you don't want to have 4.6 installed, this seems like a better solution.
              – Dougc
              Mar 9 '16 at 16:05










            • Asking after many years, this is for you @Dougc. I am in a similar situation, i don't want 4.6 installed and i have 4.5.2 installed. Still i get this issue. What is it that gman suggested??
              – singsuyash
              Apr 23 '16 at 9:43










            • @singsuyash, in the project configuration, go to Agent Requirements. There you click add new requirement. Type DotNetFrameworkTargetingPack4.5.2_Path in the parameter name and set condition to exist.
              – gautejohan
              Apr 26 '16 at 6:08














            23












            23








            23






            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






            share|improve this answer












            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







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Feb 12 '16 at 9:22









            gautejohan

            36838




            36838








            • 5




              A good colleague of mine pointed out to me that you can build with Visual Studio 2015 if your build agent has the requirement DotNetFrameworkTargetingPack4.5.2_Path TeamCity will then build the solution towards 4.5.2, even if 4.6 is installed
              – gautejohan
              Feb 17 '16 at 8:10








            • 2




              I resolved this issue by using the 4.5.2 dev pack as @gman suggested. In situations where you don't want to have 4.6 installed, this seems like a better solution.
              – Dougc
              Mar 9 '16 at 16:05










            • Asking after many years, this is for you @Dougc. I am in a similar situation, i don't want 4.6 installed and i have 4.5.2 installed. Still i get this issue. What is it that gman suggested??
              – singsuyash
              Apr 23 '16 at 9:43










            • @singsuyash, in the project configuration, go to Agent Requirements. There you click add new requirement. Type DotNetFrameworkTargetingPack4.5.2_Path in the parameter name and set condition to exist.
              – gautejohan
              Apr 26 '16 at 6:08














            • 5




              A good colleague of mine pointed out to me that you can build with Visual Studio 2015 if your build agent has the requirement DotNetFrameworkTargetingPack4.5.2_Path TeamCity will then build the solution towards 4.5.2, even if 4.6 is installed
              – gautejohan
              Feb 17 '16 at 8:10








            • 2




              I resolved this issue by using the 4.5.2 dev pack as @gman suggested. In situations where you don't want to have 4.6 installed, this seems like a better solution.
              – Dougc
              Mar 9 '16 at 16:05










            • Asking after many years, this is for you @Dougc. I am in a similar situation, i don't want 4.6 installed and i have 4.5.2 installed. Still i get this issue. What is it that gman suggested??
              – singsuyash
              Apr 23 '16 at 9:43










            • @singsuyash, in the project configuration, go to Agent Requirements. There you click add new requirement. Type DotNetFrameworkTargetingPack4.5.2_Path in the parameter name and set condition to exist.
              – gautejohan
              Apr 26 '16 at 6:08








            5




            5




            A good colleague of mine pointed out to me that you can build with Visual Studio 2015 if your build agent has the requirement DotNetFrameworkTargetingPack4.5.2_Path TeamCity will then build the solution towards 4.5.2, even if 4.6 is installed
            – gautejohan
            Feb 17 '16 at 8:10






            A good colleague of mine pointed out to me that you can build with Visual Studio 2015 if your build agent has the requirement DotNetFrameworkTargetingPack4.5.2_Path TeamCity will then build the solution towards 4.5.2, even if 4.6 is installed
            – gautejohan
            Feb 17 '16 at 8:10






            2




            2




            I resolved this issue by using the 4.5.2 dev pack as @gman suggested. In situations where you don't want to have 4.6 installed, this seems like a better solution.
            – Dougc
            Mar 9 '16 at 16:05




            I resolved this issue by using the 4.5.2 dev pack as @gman suggested. In situations where you don't want to have 4.6 installed, this seems like a better solution.
            – Dougc
            Mar 9 '16 at 16:05












            Asking after many years, this is for you @Dougc. I am in a similar situation, i don't want 4.6 installed and i have 4.5.2 installed. Still i get this issue. What is it that gman suggested??
            – singsuyash
            Apr 23 '16 at 9:43




            Asking after many years, this is for you @Dougc. I am in a similar situation, i don't want 4.6 installed and i have 4.5.2 installed. Still i get this issue. What is it that gman suggested??
            – singsuyash
            Apr 23 '16 at 9:43












            @singsuyash, in the project configuration, go to Agent Requirements. There you click add new requirement. Type DotNetFrameworkTargetingPack4.5.2_Path in the parameter name and set condition to exist.
            – gautejohan
            Apr 26 '16 at 6:08




            @singsuyash, in the project configuration, go to Agent Requirements. There you click add new requirement. Type DotNetFrameworkTargetingPack4.5.2_Path in the parameter name and set condition to exist.
            – gautejohan
            Apr 26 '16 at 6:08











            9














            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.






            share|improve this answer





















            • However, after you do this, and depending on the project template selected when the application was created, if you have the insight and codeDom applications installed, you may have to uninstall them as I did. I received an array error which traced back to roslyn and Microsoft Application Insight.
              – Clarence
              Oct 16 '17 at 6:00
















            9














            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.






            share|improve this answer





















            • However, after you do this, and depending on the project template selected when the application was created, if you have the insight and codeDom applications installed, you may have to uninstall them as I did. I received an array error which traced back to roslyn and Microsoft Application Insight.
              – Clarence
              Oct 16 '17 at 6:00














            9












            9








            9






            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.






            share|improve this answer












            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.







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Aug 30 '16 at 15:21









            AmiNadimi

            1,62211732




            1,62211732












            • However, after you do this, and depending on the project template selected when the application was created, if you have the insight and codeDom applications installed, you may have to uninstall them as I did. I received an array error which traced back to roslyn and Microsoft Application Insight.
              – Clarence
              Oct 16 '17 at 6:00


















            • However, after you do this, and depending on the project template selected when the application was created, if you have the insight and codeDom applications installed, you may have to uninstall them as I did. I received an array error which traced back to roslyn and Microsoft Application Insight.
              – Clarence
              Oct 16 '17 at 6:00
















            However, after you do this, and depending on the project template selected when the application was created, if you have the insight and codeDom applications installed, you may have to uninstall them as I did. I received an array error which traced back to roslyn and Microsoft Application Insight.
            – Clarence
            Oct 16 '17 at 6:00




            However, after you do this, and depending on the project template selected when the application was created, if you have the insight and codeDom applications installed, you may have to uninstall them as I did. I received an array error which traced back to roslyn and Microsoft Application Insight.
            – Clarence
            Oct 16 '17 at 6:00











            1














            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.






            share|improve this answer


























              1














              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.






              share|improve this answer
























                1












                1








                1






                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.






                share|improve this answer












                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.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered May 17 '17 at 17:27









                Roberto Gentile

                111




                111























                    1














                    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.?






                    share|improve this answer























                    • Targeting older .NET Framework (4.0 Client Profile) for my project and all DLL projects also worked. :)
                      – Naveen Kumar V
                      yesterday


















                    1














                    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.?






                    share|improve this answer























                    • Targeting older .NET Framework (4.0 Client Profile) for my project and all DLL projects also worked. :)
                      – Naveen Kumar V
                      yesterday
















                    1












                    1








                    1






                    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.?






                    share|improve this answer














                    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.?







                    share|improve this answer














                    share|improve this answer



                    share|improve this answer








                    edited yesterday

























                    answered Dec 25 at 13:04









                    Naveen Kumar V

                    504722




                    504722












                    • Targeting older .NET Framework (4.0 Client Profile) for my project and all DLL projects also worked. :)
                      – Naveen Kumar V
                      yesterday




















                    • Targeting older .NET Framework (4.0 Client Profile) for my project and all DLL projects also worked. :)
                      – Naveen Kumar V
                      yesterday


















                    Targeting older .NET Framework (4.0 Client Profile) for my project and all DLL projects also worked. :)
                    – Naveen Kumar V
                    yesterday






                    Targeting older .NET Framework (4.0 Client Profile) for my project and all DLL projects also worked. :)
                    – Naveen Kumar V
                    yesterday













                    0














                    In my case, I had a corrupt .NET installation on my Windows Server 2012 R2. I had to install a more recent version of .NET (v4.7.1) and the site is working now.






                    share|improve this answer


























                      0














                      In my case, I had a corrupt .NET installation on my Windows Server 2012 R2. I had to install a more recent version of .NET (v4.7.1) and the site is working now.






                      share|improve this answer
























                        0












                        0








                        0






                        In my case, I had a corrupt .NET installation on my Windows Server 2012 R2. I had to install a more recent version of .NET (v4.7.1) and the site is working now.






                        share|improve this answer












                        In my case, I had a corrupt .NET installation on my Windows Server 2012 R2. I had to install a more recent version of .NET (v4.7.1) and the site is working now.







                        share|improve this answer












                        share|improve this answer



                        share|improve this answer










                        answered Oct 28 '17 at 11:20









                        André Hauptfleisch

                        1,53842242




                        1,53842242























                            0














                            In my case, I don't have access to the IIS itself and I was having this problem when I was using a single method which doesn't have anything special only things from .net 2.



                            The solution: I've Extracted that method and created a Class Library with .net 2.0 and it works.






                            share|improve this answer


























                              0














                              In my case, I don't have access to the IIS itself and I was having this problem when I was using a single method which doesn't have anything special only things from .net 2.



                              The solution: I've Extracted that method and created a Class Library with .net 2.0 and it works.






                              share|improve this answer
























                                0












                                0








                                0






                                In my case, I don't have access to the IIS itself and I was having this problem when I was using a single method which doesn't have anything special only things from .net 2.



                                The solution: I've Extracted that method and created a Class Library with .net 2.0 and it works.






                                share|improve this answer












                                In my case, I don't have access to the IIS itself and I was having this problem when I was using a single method which doesn't have anything special only things from .net 2.



                                The solution: I've Extracted that method and created a Class Library with .net 2.0 and it works.







                                share|improve this answer












                                share|improve this answer



                                share|improve this answer










                                answered Jan 10 at 15:15









                                Ricardo França

                                2,02521015




                                2,02521015























                                    0














                                    Maybe it too late but I got the same problem and fixed as below.
                                    I use Visual Studio 2015 ,the configuration compilation on web.config point to .NET FrameWork 4.6 by default. I could not just edit only on the web.config file. If you can not install .NET FrameWork 4.6 on server and your application don't use it.




                                    1. Go to menu Debug > [Project Name] Properties > Application .

                                    2. choose the .NET Framework 4.5 (or any which server support and compatible your application) from Target Framwork dropdown list.

                                    3. Rebuild again.






                                    share|improve this answer




























                                      0














                                      Maybe it too late but I got the same problem and fixed as below.
                                      I use Visual Studio 2015 ,the configuration compilation on web.config point to .NET FrameWork 4.6 by default. I could not just edit only on the web.config file. If you can not install .NET FrameWork 4.6 on server and your application don't use it.




                                      1. Go to menu Debug > [Project Name] Properties > Application .

                                      2. choose the .NET Framework 4.5 (or any which server support and compatible your application) from Target Framwork dropdown list.

                                      3. Rebuild again.






                                      share|improve this answer


























                                        0












                                        0








                                        0






                                        Maybe it too late but I got the same problem and fixed as below.
                                        I use Visual Studio 2015 ,the configuration compilation on web.config point to .NET FrameWork 4.6 by default. I could not just edit only on the web.config file. If you can not install .NET FrameWork 4.6 on server and your application don't use it.




                                        1. Go to menu Debug > [Project Name] Properties > Application .

                                        2. choose the .NET Framework 4.5 (or any which server support and compatible your application) from Target Framwork dropdown list.

                                        3. Rebuild again.






                                        share|improve this answer














                                        Maybe it too late but I got the same problem and fixed as below.
                                        I use Visual Studio 2015 ,the configuration compilation on web.config point to .NET FrameWork 4.6 by default. I could not just edit only on the web.config file. If you can not install .NET FrameWork 4.6 on server and your application don't use it.




                                        1. Go to menu Debug > [Project Name] Properties > Application .

                                        2. choose the .NET Framework 4.5 (or any which server support and compatible your application) from Target Framwork dropdown list.

                                        3. Rebuild again.







                                        share|improve this answer














                                        share|improve this answer



                                        share|improve this answer








                                        edited Jun 21 at 7:48

























                                        answered Jun 21 at 7:34









                                        waewta artpongsa

                                        13




                                        13























                                            0














                                            I have downgraded 4.6.x to 4.5.2 and it worked fine.






                                            share|improve this answer




























                                              0














                                              I have downgraded 4.6.x to 4.5.2 and it worked fine.






                                              share|improve this answer


























                                                0












                                                0








                                                0






                                                I have downgraded 4.6.x to 4.5.2 and it worked fine.






                                                share|improve this answer














                                                I have downgraded 4.6.x to 4.5.2 and it worked fine.







                                                share|improve this answer














                                                share|improve this answer



                                                share|improve this answer








                                                edited Oct 2 at 9:56









                                                scopchanov

                                                3,63191942




                                                3,63191942










                                                answered Oct 2 at 9:26









                                                Bhavesh Patel

                                                12




                                                12






























                                                    draft saved

                                                    draft discarded




















































                                                    Thanks for contributing an answer to Stack Overflow!


                                                    • Please be sure to answer the question. Provide details and share your research!

                                                    But avoid



                                                    • Asking for help, clarification, or responding to other answers.

                                                    • Making statements based on opinion; back them up with references or personal experience.


                                                    To learn more, see our tips on writing great answers.





                                                    Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                                                    Please pay close attention to the following guidance:


                                                    • Please be sure to answer the question. Provide details and share your research!

                                                    But avoid



                                                    • Asking for help, clarification, or responding to other answers.

                                                    • Making statements based on opinion; back them up with references or personal experience.


                                                    To learn more, see our tips on writing great answers.




                                                    draft saved


                                                    draft discarded














                                                    StackExchange.ready(
                                                    function () {
                                                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f31253747%2fmethod-not-found-0-system-array-empty%23new-answer', 'question_page');
                                                    }
                                                    );

                                                    Post as a guest















                                                    Required, but never shown





















































                                                    Required, but never shown














                                                    Required, but never shown












                                                    Required, but never shown







                                                    Required, but never shown

































                                                    Required, but never shown














                                                    Required, but never shown












                                                    Required, but never shown







                                                    Required, but never shown







                                                    Popular posts from this blog

                                                    Mossoró

                                                    Error while reading .h5 file using the rhdf5 package in R

                                                    Pushsharp Apns notification error: 'InvalidToken'