Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Plugin Assembly returning error when compiled with VS 2015: "Method not found: '!!0[] System.Array.Empty()'"

Posted on by 65

Hi all, I have a bizarre issue regarding plugin Assembly compilation. I have raised a case with Microsoft but I thought I'd ask here also in case anybody else has experienced this issue.

I have a plugin assembly which I have developed in VS 2012 Professional. The assembly has no issues and all plugins run correctly.

I now wish to upgrade to VS 2015 Community edition, however when I compile *exactly* the same project with *no* changes whatsoever, and upload it to CRM Online, I get the error "System.MissingMethodException: Method not found: '!!0[] System.Array.Empty()'" whenever a plugin runs.

I have tried removing the old assembly - completely unregistering it - and re-registering the new assembly - but no joy. I can overwrite the assembly generated with VS 2015 with the assembly generated by VS 2012 as a simple update, and everything works fine. Updating to the VS 2015 assembly and everything errors out.

This seems pretty crazy! Has anybody here experienced anything similar?

AHA, Ben

*This post is locked for comments

  • Micchael Profile Picture
    Micchael 390 on at
    RE: Plugin Assembly returning error when compiled with VS 2015: "Method not found: '!!0[] System.Array.Empty()'"

    Hi Ben,

    There is a sequel for this. Moving to version 9 you cannot downgrade to 4.5.2. The 4.6.2  is the minimal required version.

    Then this known issue comes up again: connect.microsoft.com/.../missingmethodexception-additional-information-method-not-found-0-system-array-empty

    We don't have option to change tenant run  time , hence:

    There are two actions required:

    1. Change all ur string.Format signature from (IFormatProvider, String, Object) to  (IFormatProvider, String, Object[])

    2. Change TracingService.Trace signature from (message) to (message, Object[]).

       I've tried to do TracingService.Trace(message, null) but it throws Null Refenece exception.

    Have a nice move to version 9, guys :)

  • Mohd Tahir Profile Picture
    Mohd Tahir 676 on at
    RE: Plugin Assembly returning error when compiled with VS 2015: "Method not found: '!!0[] System.Array.Empty()'"

    Angel A. Rodriguez Thank you so much, that worked like a charm. I just had to change the target .Net framework. You saved me a ton time.

  • RE: Plugin Assembly returning error when compiled with VS 2015: "Method not found: '!!0[] System.Array.Empty()'"

    Downgrading the project to 4.5.2 and building with VS 2015 work fine for me!

    Microsoft Dynamics® CRM Online 2016-Update(8.1.0.549) (DB 8.1.0.538)

  • Verified answer
    benPWP Profile Picture
    benPWP 65 on at
    RE: Plugin Assembly returning error when compiled with VS 2015: "Method not found: '!!0[] System.Array.Empty()'"

    Some further info - I checked CRM Online compatibility with .Net Framework 4.6 at support.microsoft.com/.../3124955

    4.6 is compatible from CRM 8.0.0.2074 (in CRM 2016, CRM 2015 also supports it) - we are using CRM 8.1.0.452.

    I downgraded the project from 4.6.1 to 4.6 and rebuilt. Same thing - using VS 2012 no problem, using VS 2015 "System.MissingMethodException: Method not found: '!!0[] System.Array.Empty()'".

    There are no Roslyn-specific language features in the code - otherwise VS 2012 would not build it.

    Downgrading the project to 4.5.2 and building with VS 2015 *DOES* work!! Therefore, is support.microsoft.com/.../3124955 incorrect in saying that 4.6 is supported?! I will follow up with Microsoft...

  • benPWP Profile Picture
    benPWP 65 on at
    RE: Plugin Assembly returning error when compiled with VS 2015: "Method not found: '!!0[] System.Array.Empty()'"

    Hi Shivaram, thanks for your reply. I had already seen that post and considered it. However the framework version is defined in the project file (.csproj), therefore since I am using the same source but different compilers, the target framework version is identical in both cases (which is 4.6.1).

    Therefore I can't see how this could be affecting things - let me know if you see something I don't!

  • Suggested answer
    shivaram Profile Picture
    shivaram 3,315 on at
    RE: Plugin Assembly returning error when compiled with VS 2015: "Method not found: '!!0[] System.Array.Empty()'"

    Hi Ben,

    I have no idea about this. But following link might be useful for you.

    stackoverflow.com/.../method-not-found-0-system-array-empty-asapp-bundleconfig-registerbundl

    Thanks.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,253 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans