3.5. Licensing Exception

Why do I get this exception?

FakeXrmEasy 1.x versions are licensed under an MIT license, but from version 2 onwards we are licensing FakeXrmEasy under a new triple licensed model, including the OSS, OSI-approved, Reciprocal Public License 1.5.

This exception is thrown because you need to choose a license when building an IXrmFakedContext. You can choose to use FakeXrmEasy under the following licenses:

  • the OSI-approved Reciprocal Public License 1.5
  • or a Modified Polyform NonCommercial License 1.0.0
  • or a Commercial License.

If you want to know more about why we had to make this decision, please check the Why? section.

Also please check the overall licensing model on the LICENSE section.

You might want to also checkout our licensing FAQ.

How do I get rid of this exception?

The license of choice needs to be setup only once as part of the middleware initialization by calling .SetLicense(). Place it before the last .Build() step in your middleware setup.

Here’s an example:

public class FakeXrmEasyTestsBase
{
    protected readonly IXrmFakedContext _context;
    protected readonly IOrganizationServiceAsync2 _service;

    public FakeXrmEasyTestsBase() 
    {
        _context = MiddlewareBuilder
                        .New()
                        .AddCrud()
                        
                        .UseCrud()
                        .SetLicense(FakeXrmEasyLicense.RPL_1_5)
                        .Build();

        _service = _context.GetAsyncOrganizationService2();
    }
}