Print Page | Close Window

License key or compilation errors when using multiple models

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce 2010
Forum Discription: For .NET 4.0
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=1797
Printed Date: 21-Apr-2026 at 3:49pm


Topic: License key or compilation errors when using multiple models
Posted By: ting
Subject: License key or compilation errors when using multiple models
Date Posted: 07-May-2010 at 5:29pm
Quite a number of you are working with multiple EDMX models in the same solution.  This is a great DevForce feature, but we're still working out some kinks with the Visual Studio IDE.  The next release will be much improved in this regard.
 
In the meantime, if you are getting license violation or compilation errors this process may solve the issue:
  1. Make sure you have checked out the EDMX and Designer.cs for each model and that they are writable.
  2. Run the custom tool for each .tt (right click and select "RunCustom Tool") and save the changes.  Make sure to do this on the files with the .tt extension.
  3. It may help if you restart Visual Studio and try steps 1 and 2 again.

If you're still getting the license error, open the .Designer.cs files and copy the IBCore.IdeaBladeLicense and IbCore.IdeaBladeGuid attributes from one file to the other.

 



Replies:
Posted By: ting
Date Posted: 24-May-2010 at 6:23pm
We now have a patch for this.  See this thread:
http://www.ideablade.com/forum/forum_posts.asp?TID=1841 - http://www.ideablade.com/forum/forum_posts.asp?TID=1841
 


Posted By: mikewishart
Date Posted: 09-Jul-2010 at 1:58pm
If you have a single EntityManager managing multiple edmx files, this gets a little more complicated.  There is no constructor or license information automatically generated in the generated Designer.cs code files.

We just got this to work:

* find or create a project with a single edmx file, then locate the Designer.cs file under the .tt file.  Grab the IBCore.IdeaBladeLicense and IbCore.IdeaBladeGuid lines out of this file.

* Create a new class file in your model right next to your edmx files.  This will be the constructor for your EntityManager.  see code below...

* Replace everything in red with the appropriate information (namespace, entitymanager class name, IdeaBladeLicense and IdeaBladeGuid).  Of course, the namespace must be the same across all your edmx files and this constructor class file.

Thanks to support for helping figure this one out!

-------------

using System;
using System.Reflection;
using IbCore = IdeaBlade.Core;
using IbEm = IdeaBlade.EntityModel;

[module: IbCore.IdeaBladeLicense("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx")]

namespace DomainModel
{
  public partial class DomainModelEntityManager
  {
    #region Constructors

    /// <summary>See <see cref="M:IbEm.EntityManager.#ctor()"/>. </summary>
    public DomainModelEntityManager() : base() { }

    /// <summary>See <see cref="M:IbEm.EntityManager.#ctor(Boolean)"/>. </summary>
    public DomainModelEntityManager(Boolean shouldConnect) : base(shouldConnect) { }

    /// <summary>See <see cref="M:IbEm.EntityManager.#ctor(Boolean, String)"/>. </summary>
    public DomainModelEntityManager(Boolean shouldConnect, String dataSourceExtension) : base(shouldConnect, dataSourceExtension) { }

    /// <summary>See <see cref="M:IbEm.EntityManager.#ctor(Boolean, String, IbEm.EntityServiceOption)"/>. </summary>
    public DomainModelEntityManager(Boolean shouldConnect, String dataSourceExtension, IbEm.EntityServiceOption entityServiceOption) : base(shouldConnect, dataSourceExtension, entityServiceOption) { }

    /// <summary>See <see cref="M:IbEm.EntityManager.#ctor(IbEm.EntityManager)"/>. </summary>
    public DomainModelEntityManager(IbEm.EntityManager entityManager) : base(entityManager) { }

    /// <summary>See <see cref="M:IbEm.EntityManager.#ctor(IbEm.EntityManager, Boolean, String, IbEm.EntityServiceOption)"/>. </summary>
    public DomainModelEntityManager(IbEm.EntityManager entityManager, Boolean shouldConnect, String dataSourceExtension, IbEm.EntityServiceOption entityServiceOption) : base(entityManager, shouldConnect, dataSourceExtension, entityServiceOption) { }

    static DomainModelEntityManager()
    {
      IbEm.EntityRelation.InitializeEntityRelations(Assembly.GetExecutingAssembly());
    }

    #endregion Constructors

    #region DefaultManager

    /// <summary>Gets the default manager. </summary>
    public new static DomainModelEntityManager DefaultManager
    {
      get { return GetDefaultEntityManager<DomainModelEntityManager>(); }
    }

    #endregion DefaultManager
  }

  #region EntityRelations

  /// <summary>
  /// A generated class that returns the relations between entities in this model.
  /// </summary>
  [IbCore.IdeaBladeGuid("xxxxxxxxxxxxxxxxxxxxxxx")]
  public partial class EntityRelations
  {

    /// Explicit static constructor ensures static fields are initialized.
    static EntityRelations() { }
  }

  #endregion EntityRelations
}




Print Page | Close Window