metaCore
Forcing metaSite references from a new metaCore model

If you're using the new metaCore/metaSite you'll need to reference the metaSite.Core assembly from your metaCore model. But the compiler will helpfully remove any references it considers redundant, so you'll need to add a piece of code to force the compiler to include a reference to metaSite. We had this early on in MiVoice - Vote, but have just had a resurfacing of the issue when doing a release build. Previously we had the following included in the model assembly:

using System;
using System.Collections.Generic;
using System.Text;

namespace com.iMeta.MiVoice.Vote
{
   static class metaSiteReferenceForce
   {
      private static void Nothing()
      {
         com.iMeta.metaSite.schema.msURL m = null;
      }
   }
}
 

which worked fine for debug builds. Having been fighting with release builds we hit an issue where the compiler does further optimisations and completely removed the null reference above (very cleverly). So we've ended up with:

using System;
using System.Collections.Generic;
using System.Text;

namespace com.iMeta.MiVoice.Vote
{
   static class metaSiteReferenceForce
   {
      private static void Nothing()
      {
         com.iMeta.metaSite.schema.msURL m = com.iMeta.metaSite.schema.msURL.Factory.Create();
      }
   }
}