web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

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

(0) ShareShare
ReportReport
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

I have the same question (0)
  • Suggested answer
    shivaram Profile Picture
    3,315 on at

    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.

  • benPWP Profile Picture
    65 on at

    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!

  • Verified answer
    benPWP Profile Picture
    65 on at

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

  • Angel A. Rodriguez Profile Picture
    25 on at

    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)

  • Mohd Tahir Profile Picture
    676 on at

    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.

  • Micchael Profile Picture
    390 on at

    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 :)

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans