Code Monkey home page Code Monkey logo

fake-xrm-easy's Introduction

FakeXrmEasy: The Test Automation Framework for the Power Platform / Dataverse

This README is intended at contributors and provides info about building / contributing to the project. For general guidelines about the usage (how to use etc) there is a dedicated docs site here.

Table of Contents

Why should my company use FakeXrmEasy?

Packages

Installing

What's New in 2.x?

Building

Contributing

License & FAQ

Why should my company use FakeXrmEasy


FakeXrmEasy is trusted by giants and loved by developers. With more than 1.4M downloads of version 1, accounts for more than 20% of all the CRM SDK packages downloads, worlwide.

We conducted a pretty extensive research study over several months to measure the impact that FakeXrmEasy had on the development lifecycle of more than 30 different organisations.

The research showed:

  • Average of 191% increased ProDev efficiency due to the reduction of escaped defects
  • Average of 33% increased ProDev efficiency due to other time savings

You can find more details about the study here.

Packages


FakeXrmEasy version 2 or later is broken down into several repositories / packages below:

Repo/Package Build Quality Gate Coverage Security Maintainability Reliability
Abstractions BuildBuild Quality Gate Status Coverage Security Rating Maintainability Rating Reliability Rating
Core BuildBuild Quality Gate Status Coverage Security Rating Maintainability Rating Reliability Rating
Plugins BuildBuild Quality Gate Status Coverage Security Rating Maintainability Rating Reliability Rating
CodeActivities Build Quality Gate Status Coverage Security Rating Maintainability Rating Reliability Rating
Messages BuildBuild Quality Gate Status Coverage Security Rating Maintainability Rating Reliability Rating

Installing


Which package do I need to install?

One of the reasons to separate the original package in v1.x into smaller ones in v2.x was the single responsibility principle. For example, when developing azure functions, you don't need helpers or methods to execute plugins. When developing plugins, some users might prefer to just unit test the plugin logic, other might want to perform a more deep level of testing by using pipeline simulation (testing the interaction between several plugins).

The architecture in v2.x and v3.x is modular in that it makes easier adding extension packages to a now configurable middleware.

These are some general guidelines about the intended usage. This list will be updated over time to accomodate new packages.

Package Use examples
FakeXrmEasy.Plugins This package contains helpers to make it easy to unit test plugins (or the interactions between these plugins if you enable pipeline simulation in the middleware.)
FakeXrmEasy.CodeActivities This package contains helpers to make it easy to unit test code activities
FakeXrmEasy.Core This is the core package, and will be needed across pretty much all uses and automatically installed as a package dependency when you install any of the others. This package also contains basic CRUD operations.
FakeXrmEasy.Messages Package that contains further implementations for many other OrganizationRequests
FakeXrmEasy This is an include package, it references pretty much all the other packages and is meant to be used a tool to ease migration from v1.x.

What is new in version 2


  • Support for .net core 3.1. / Full .NET framework support with multi-targeting
  • Single original repo broken down into smaller, more extensible and easier to maintain repos
  • New semantinc versioning using prerelease suffixes SemVer 2.0.0
  • Original FAKE build script has been redeveloped in Powershell Core for building both locally (build-local-push.ps1) and form GitHub actions, cross platform.
  • Added SonarCloud quality gate
  • Now using GitHub Actions as opposed to AppVeyor previously in 1.x.
  • ** New Middleware!!! ** => effectivley rewritten the core implementation (based on aspnetcore middleware)
  • New GetProperty / SetProperty to allow to dynamically extend context properties
  • Pipeline Simulation has been redesigned to support any message, not just CRUD operations
  • Massive refactoring

Building

In order to build this project you will need .NET Core 3.1 and .NET 4.6.2 on Windows, and PowerShell 7.

Since FakeXrmEasy version 2 or later is spread across multiple repos, you'll need to setup a certain folder structure that the powershell scripts will use to make it easier building all dependencies locally.

When forking the repos, plase make sure to clone them so that they'll share the same parent folder, then add a brand new "local-packages" folder at the same level.

Sample folder layout:

 |---DynamicsValue\
          |
          |---------- local-packages\
          |---------- fake-xrm-easy-abstractions\
          |---------- fake-xrm-easy-core\
          |---------- fake-xrm-easy-messages\
          |---------- fake-xrm-easy-plugins\
          |---------- fake-xrm-easy-code-activities\
          |---------- fake-xrm-easy\

The scripts will build and push packages locally to the file system into the default "local-packages" folder. This is handy to test and build everything locally without having to wait for a GitHub Action to complete on every change made.

Building on Windows

Building on Linux

Note: Currently you can't build this project on linux with net7 installed, it must be uninstalled until this open issue is resovled: microsoft/vstest#4671 (comment)

There is a fundamental difference between 2.x and 3.x versions. 2.x are multi-target packages. However, in 3.x we dropped support for it and it has a single target: .net core 3.1. Even though the build scripts are pretty much identical, when building 2.x versions you'll need to pass in the -targetFrameworks all parameter.

Once installed, run the following commands:

Building

The following will just build the solution

2.x Versions

pwsh ./build.ps1 -targetFrameworks all

3.x Versions

pwsh ./build.ps1

This command will build AND push the output package into a predefined local folder (this will create a local-packages folder where FakeXrmEasy.Abstractions will be pushed)

2.x Versions

pwsh ./build-push-local.ps1 -targetFrameworks all

3.x Versions

pwsh ./build-push-local.ps1

Also keep in mind fake-xrm-easy-codeactivities is a Windows only package, as it depends on System.Activities which wasn't ported to .net core.

Build Dependencies

You'll need to build (and push locally at least) packages in the following order because of the dependencies:

  1. fake-xrm-easy-abstractions
  2. fake-xrm-easy-core
  3. fake-xrm-easy-messages
  4. fake-xrm-easy-plugins
  5. fake-xrm-easy-codeactivities
  6. fake-xrm-easy

Branching Strategy

The repos share a common branching strategy. There are the following long lived branches:

  • 2x-dev: The current dev branch for 2.x versions. The CI action will push packages into our GitHub packages so other repos could grab the outputs from the other builds.
  • 3x-dev: Similarly to 2.x: the current dev branch for 3x versions
  • main: The current production branch for 2.x versions. Packages in this branch will be automatically pushed into Nuget.
  • 3x: The current production branch for 3.x versions. Packages in this branch will be automatically pushed into Nuget.

The default branch for accepting PRs is 2x-dev. We'll be merging down to 3x-dev to keep functionality as close as possible across versions.

Contributing


This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit our CLA here.

When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

License


Please see LICENSE.txt.

License questions? Please see our License FAQ.

Git Credential Manager setup

In order to use MFA workflows it is best to use a git credential manager like git-credential-manager.

When using git on linux, it's best to rely on the .deb package install option as the dotnet tool requires at least .net 7 which doesn't work well along with Mono for building projects (see note about building on Linux on the Building on Linux section).

https://github.com/git-ecosystem/git-credential-manager/blob/release/docs/install.md

fake-xrm-easy's People

Contributors

benwalkercantata avatar github-actions[bot] avatar jordimontana82 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

fake-xrm-easy's Issues

Generate Release Notes from Changelog

Add release notes generation to all packages:

  • Abstractions
  • Core
  • Plugins
  • Messages
  • CodeActivities

And same for 3x branches:

  • Abstractions
  • Core
  • Plugins
  • Messages

Filter on link-entity fails if Context is initialized with EnableProxyTypes()

There is a filter on entityname='mycontact' in unittest ConditionOperatorTests.FetchXml_EntityName_Attribute_Alias_Execution(). If the context is initialized with _context.EnableProxyTypes(Assembly.GetExecutingAssembly());, this test will fail due to the fact that the attribute of the filter is believed to be on the root entity (account) instead of the link-entity (contact).

System.NullReferenceException
HResult=0x80004003
Message=Object reference not set to an instance of an object.
Source=FakeXrmEasy.Core
StackTrace:
FakeXrmEasy.Core.dll!FakeXrmEasy.XrmFakedContext.FindReflectedAttributeType(System.Type earlyBoundType, string sEntityName, string attributeName) Line 114
at C:\Projects\Stuff\fake-xrm-easy-core\src\FakeXrmEasy.Core\XrmFakedContext.Queries.cs(114)
FakeXrmEasy.Core.dll!FakeXrmEasy.Extensions.FetchXml.XmlExtensionsForFetchXml.GetConditionExpressionValueCast(string value, FakeXrmEasy.Abstractions.IXrmFakedContext ctx, string sEntityName, string sAttributeName, Microsoft.Xrm.Sdk.Query.ConditionOperator op) Line 959
at C:\Projects\Stuff\fake-xrm-easy-core\src\FakeXrmEasy.Core\Extensions\XmlExtensionsForFetchXml.cs(959)
FakeXrmEasy.Core.dll!FakeXrmEasy.Extensions.FetchXml.XmlExtensionsForFetchXml.ToConditionExpression(System.Xml.Linq.XElement elem, FakeXrmEasy.Abstractions.IXrmFakedContext ctx) Line 767
at C:\Projects\Stuff\fake-xrm-easy-core\src\FakeXrmEasy.Core\Extensions\XmlExtensionsForFetchXml.cs(767)

operator='not-in' value='' should not cause an exception

When you build a fetchXml query using the toolbox fetchXml builder which uses the in or not-in operator, it leaves a little bit of redundant fluff in the query:
image
When you run an early bound query with a condition like this, CRM does not complain and just ignores the value='' bit.
When you run it in fake-xrm-easy (v9 v2 and v3) you get this exception:
System.Exception: When trying to parse value for entity van_technician and attribute statuscode: Integer value expected

I know it's a simple one to avoid, but I think it's worth raising because it took me quite a while to work out that the problem wasn't with the real integer values in the value tag, but the unnecessary value='' attribute in the condition node, so this might trip other people up as well. I couldn't see what was wrong with the query because I was looking in the wrong place, but anyway, it's a valid query as far as CRM is concerned!
I'll also raise an issue in the FXB repo.

Group-By Attributes not returned in Aggregated Query

Here's a fetchXml query. It returns the count of 'work notification jobs', grouped by technician name, number and id.
image

When run against a real (d365 online) instance, the grouped by columns are returned in the query:
image
When run against FakeXrmEasy v1,2 or 3 the AttributeCollection returned by the query only contains the count, but not the group by columns:
image

I'm not sure if this a known issue from v1. I can provide a failing test if required, using OOB entities.

Error with Microsoft.PowerPlatform.Dataverse.Client version 0.6.1

I've upgraded Microsoft.PowerPlatform.Dataverse.Client to version 0.6.1 and my unit tests are breaking with the error below.

I honestly haven't spent any time looking into whether the issue is caused by anything my side, so will respond if I find that the issue is not related to the version upgrade.

Message: 
System.TypeInitializationException : The type initializer for 'FakeItEasy.ServiceLocator' threw an exception.
---- System.IO.FileNotFoundException : Could not load file or assembly 'Microsoft.Cds.Sdk.Proxy, Version=9.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. The system cannot find the file specified.

  Stack Trace: 
ServiceLocator.Resolve[T]()
A.get_FakeAndDummyManager()
A.Fake[T]()
XrmFakedContext.ctor(IMiddlewareBuilder middlewareBuilder)
MiddlewareBuilder.ctor()
MiddlewareBuilder.New()
DynamicsContext.ctor() line 22
AccountServiceTests.CreateAgentReadOnly() line 308
<>c.<ThrowAsync>b__128_0(Object state)
----- Inner Stack Trace -----
RuntimeAssembly.GetExportedTypes()
<>c.<FindBootstrapper>b__0_2(Assembly assembly)
SelectManySingleSelectorIterator`2.MoveNext()
WhereEnumerableIterator`1.MoveNext()
Enumerable.TryGetFirst[TSource](IEnumerable`1 source, Boolean& found)
Enumerable.FirstOrDefault[TSource](IEnumerable`1 source)
BootstrapperLocator.FindBootstrapper()
RootModule.RegisterDependencies(IServiceRegistrar registrar)
ServiceLocator.cctor()

Github version not clear in LINQpad

Hi @jordimontana82,
a weird cosmetic issue in LINQPad. Don't really know if it's a LINQpad issue or a FXE issue.

With the v1 Nuget packages, it's possible in the LINQPad NuGet package manager to see which version of CRM the package references:
image
but with the v2/3 packages, it's no longer possible to distinguish them - they all look the same, so it's much harder to chose the right version - you have to select each version in turn in order to be able to see the ID value:
image

This isn't true in Visual Studio:
image

Was there some additional info in the NuGet manifest which LINQPad was previously using which is no longer there in v2/3?

Let me know if you need more info or if I can help testing this.

Thanks,
Ben

Error when querying Money attribute using Integer value

When querying a Money attribute, this query is valid against a real CRM instance:

image

Against FXE (v2/v9) it gives this error:
The binary operator Equal is not defined for the types 'System.Decimal' and 'System.Int32'.

image

Easy to fix in code by changing to
query.Criteria.AddCondition("priceperunit", ConditionOperator.Equal, 1.0m);
but just pointing out difference between 'real' behaviour and FXE behaviour.
Sorry if its already reported.

FakeXrmEasy breaks when using FakeItEasy 7

Hi,
just wanted to make you aware that the Middleware setup fails with the following exception when using FakeItEasy 7.

System.EntryPointNotFoundException
Entry point was not found.
   at FakeItEasy.Configuration.ICallbackConfiguration`1.Invokes(Action`1 action)
   at FakeItEasy.CallbackConfigurationExtensions.Invokes[TInterface,T1](ICallbackConfiguration`1 configuration, Action`1 actionToInvoke) in C:\projects\fakeiteasy\src\FakeItEasy\CallbackConfigurationExtensions.StronglyTyped.cs:line 31
   at FakeXrmEasy.Middleware.Crud.MiddlewareBuilderCrudExtensions.AddFakeUpdate(IXrmFakedContext context, IOrganizationService service)
   at FakeXrmEasy.Middleware.Crud.MiddlewareBuilderCrudExtensions.<>c.<AddCrud>b__1_0(IXrmFakedContext context)
   at FakeXrmEasy.Middleware.MiddlewareBuilder.Add(Action`1 addToContextAction)
   at FakeXrmEasy.Middleware.Crud.MiddlewareBuilderCrudExtensions.AddCrud(IMiddlewareBuilder builder)

In the dependencies of your package the range is listed as FakeItEasy β‰₯ 6.0.0 which basically allows FakeItEasy 7. Maybe you should update this range to prevent people from having the same troubles as myself.

Let me know if you need any more details. Thanks in advance!

Make dependencies less specific

The FakeXrmEasy.Plugins.v365 should allow for Microsoft.CrmSdk.CoreAssemblies Versions [8.2.0, 9)
currently it is fixed to 8.2.0.1
image

PluginStepValidator: Raise exception when registering invalid images for plugin steps (i.e. preimage in preoperation create)

For example, the only possible image to register for Create message is a Post-Image in the Post Operation step...

This has been already implemented when finding out if images are available in pipeline execution but is not implemented when registering images (PreImageTests and PostImageTests).

By throwing exceptions during the registration step we're bringing those issues earlier to the moment when they should be addressed.

Refactor current In-Memory data structures to support future parallelization and concurrency work

The current implementation relies on Dictionary data structures as the internal implementation of entity records and entity metadata records. Such data structure is not thread safe.

Therefore, we need to replace current In-Memory instances of Dictionary by a different implementation like ConcurrentDictionary and rewrite current code accessing the In-Memory state in a way that is also thread-safe.

This is prior work need to support features like #51 #38 among others.

  • Mark current Data dictionary as internal and use a new set of InMemory data structures
  • Move internal references to EntityMetadata to the new InMemory data structure
  • Review other In-Memory data structures that would affect thread-safety (GlobalOptionSets, AccessRightsRepository and other repositories), and moved them accordingly
  • Review Clone functionality to be applied at the public interface entry points only for consistency(GetEntityById, CreateEntity, UpdateEntity, DeleteEntity, and possibly CreateQuery methods), and do not use Clone internally for performance, unless necessary.

Build Issues: Assets file 'C:\DynamicsValue\fake-xrm-easy\src\FakeXrmEasy\obj\project.assets.json' doesn't have a target for 'net452'.

I'm trying to build the project(s) using the instructions in Readme.md.
I have cloned all of the 2x-dev repos to a folder structure like this:
image
I have all of the prerequisites installed.
When I run any of the build scripts (eg ./build.ps1 -targetFrameworks all) I get a slew of errors, but the first is this:
C:\Program Files\dotnet\sdk\6.0.101\Sdks\Microsoft.NET.Sdk\targets\Microsoft.PackageDependencyResolution.targets(267,5): error NETSDK1005: Assets file 'C:\DynamicsValue\fake-xrm-easy\src\FakeXrmEasy\obj\project.assets.json' doesn't have a target for 'net452'. Ensure that restore has run and that you have included 'net452' in the TargetFrameworks for your project. [C:\DynamicsValue\fake-xrm-easy\src\FakeXrmEasy\FakeXrmEasy.csproj]

Not sure if I'm doing something wrong?

Query containing condition on link-entity within main entity filter fails

If you have a query with a filter which contains conditions affecting both the main query entity and a link entity it fails.
In SQL this would be something like this:

SELECT c.firstname, a.name 
FROM contact c
    , account a
where c.accountid = a.accountid
and (c.firstname like 'A%' or a.name like 'A%')

This can be written in fetchXML like this:

<fetch top='50'>
  <entity name='contact'>
    <attribute name='firstname' />
    <filter type='or'>
      <condition attribute='firstname' operator='begins-with' value='A' />
      <condition entityname='account' attribute='name' operator='begins-with' value='A' />
    </filter>
    <link-entity name='account' from='accountid' to='parentcustomerid' link-type='inner' alias='account'>
      <attribute name='name' />
    </link-entity>
  </entity>
</fetch>

This is a valid query and returns a resultset, as seen here:
image

Using FakeXrmEasy (v2) gives an 'Object reference not set to an instance of an object.' error.
This is true with either an and or an or filter.

Comment out this line:
<condition entityname='account' attribute='name' operator='begins-with' value='A' />
and the query runs OK, so it seems to be something to do with the aliased link-entity in the filter.

I will upload a failing test once I've submitted the issue.

Change default TargetFrameworks on PowerShell scripts

Hello @jordimontana82 ,
I have been "struggling" a little with building all the packages, and I think I found the issue πŸ˜„ basically the powershell scripts need to have "all" as a default value for $targetFrameworks so that it produces all the packages with all the necessary frameworks when building it locally.

[string]$targetFrameworks = "netcoreapp3.1",

[string]$targetFrameworks = "netcoreapp3.1"

[string]$targetFrameworks = "netcoreapp3.1",

[string]$targetFrameworks = "netcoreapp3.1"

[string]$targetFramework = "netcoreapp3.1"

Complex sub-query on link-entity fails

This might be a duplicate of this old issue from v1: jordimontana82/fake-xrm-easy#584

Testing a query which would be written like this in SQL:

select * from salesOrder s,
salesorderdetail d
where d.quantity is not null
AND
((d.productname = "A" AND d.description = "B")
OR
(d.productname = "C" AND d.productnumber = "D"))

In other words it has a nested sub query against the link-entity, where 2 conditions must both be true OR 2 different conditions must both be true.

Here's how it would look in fetchXMLBuilder and it returns results for both of the OR conditions:
image

Here's the query:

QueryExpression query = new QueryExpression("salesorder");	
// link to salesorderdetail
LinkEntity query_salesorderdetail = query.AddLink("salesorderdetail", "salesorderid", "salesorderid");

// Quantity not null
query_salesorderdetail.LinkCriteria.AddCondition("quantity", ConditionOperator.NotNull);
	
// Add an 'Or' filter
FilterExpression OrFilter = new FilterExpression();
query_salesorderdetail.LinkCriteria.AddFilter(OrFilter);
OrFilter.FilterOperator = LogicalOperator.Or;
	
// Filter with two Ands - A and B
FilterExpression aAndBFilter = new FilterExpression();
aAndBFilter.AddCondition("productname", ConditionOperator.Equal, "A");
aAndBFilter.AddCondition("description", ConditionOperator.Equal, "B");
	
// Filter with two Ands - C and D
FilterExpression cAndDFilter = new FilterExpression();
cAndDFilter.AddCondition("productname", ConditionOperator.Equal, "C");
cAndDFilter.AddCondition("description", ConditionOperator.Equal, "D");

// Add the two and filters to the Or Filter
OrFilter.AddFilter(aAndBFilter);
OrFilter.AddFilter(cAndDFilter);

EntityCollection installers = service.RetrieveMultiple(query);

and here's my initialisation:

SalesOrder order = new SalesOrder() { Id = Guid.NewGuid() };

SalesOrderDetail detail1 = new SalesOrderDetail() { Id = Guid.NewGuid(), SalesOrderId = order.ToEntityReference()
	, Quantity = 1, ProductName = "A", Description = "B" };
SalesOrderDetail detail2 = new SalesOrderDetail() { Id = Guid.NewGuid(), SalesOrderId = order.ToEntityReference()
	, Quantity = 1, ProductName = "C", Description = "D" };

	_context.Initialize(new Entity[] { order, detail1, detail2 });

The query should return two records, but it returns none.

I can provide a Unit Test, but want to check if this is already a known issue before I do.

Improve build-all.ps1 script

In order to making the cloning and building of all the different repos and packages a bit more seamless, the build script could be improved to:

  • Show a warning if you're not in a DynamicsValue parent folder: to highlight the fact repos should have the same parent folder
  • Prompt any warnings if some of the target frameworks or SDKs are missing
  • Check if the local-packages folder exist, otherwise create it, via confirm
  • Check if a folder for each repo exists, otherwise git clone it, via confirm
  • Run git-pull.ps1 on all repos after they've been downloaded
  • Build & publish everything into local-packages

Pipeline simulation fails to call registered steps if Target is null (e.g. on custom API messages)

Scenario is a custom API plugin, and a further plugin registered PostOperation Async on the same message.

I've been able to test the API plugin by setting up a FakeMessageExecutor on the relevant message in which I set up a plugin context and call the plugin. When I run the calling code to send this message, the APIU plugin gets executed correctly.

If I set up Plugin Registration for the postop plugin though, I can still test the main plugin by this method but the later registration is not called.

I think the issue is at https://github.com/DynamicsValue/fake-xrm-easy-plugins/blob/08b7a3f36d9fd10bd941b52224f96bb9f2a6e865/src/FakeXrmEasy.Plugins/IXrmFakedContextPipelineExtensions.cs#L191-L198 where the downstream plugin is only called if target is an Entity or EntityReference.

Even if I were to fakeup a Target in my FakeMessageExecutor, the UsePipelineSimulation code always calls IXrmFakedContextPipelineExtensions.GetTargetForRequest(request), and that method (for obvious reasons I guess) only handles built-in messages.

When I have thought it through a bit more will be happy to offer a PR, if you think this is the right track.

Plugin-Images (Pre, Post & Both) // Filtering Attributes // Calling PreValidation-Plugin in Pipeline

  • Registering Plugin-Images for Pipeline (PreImage, PostImage & Both)
  • Filtering Attributes
  • Execution for PreValidation in Pipeline
  • PreImage and PostImage execution and tests
  • Should NOT retrieve plugin steps via RetrieveMultiple as it causes unrealistic pipeline calls (RetrieveMultiple)
  • Should NOT retrieve plugin images via RetrieveMultiple as it causes unrealistic pipeline calls (RetrieveMultiple)
  • Should not order images within plugin steps by Rank since that property doesn't exist in images, only in plugin steps
  • Audit: PluginStepExecution auditing
  • Review Upsert behavior: (it seems Upsert is only allow for a subset of OOB entities: appnotification and searchtelemetry. Trying to register for another entity throws the error "Invalid PrimaryEntity Name specified. Please re-enter the PrimaryEntityName")

Raise exception for not supported messages in pipeline: Some messages don't support registering plugin steps against them, the platform throws an exception in PRT when trying to do so.

  • Error when trying to use a message name that doesn't exists: "Invalid Message Name specified, Please re-enter the message name"
  • Error when trying to register plugins against specific existing messages as per below:

When we try to regiser a step with the "AssociateEntities" message against a custom plugin, he exception is thrown.

There are probably loads of them (i..e another example is AddAppComponents message against appmodule).

Unhandled Exception: System.ServiceModel.FaultException1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=9.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]: Custom SdkMessageProcessingStep is not allowed on the specified message. Detail: <OrganizationServiceFault xmlns="http://schemas.microsoft.com/xrm/2011/Contracts" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"> <ActivityId>6faddc9b-2257-458e-8452-904ffec799b1</ActivityId> <ErrorCode>-2147204729</ErrorCode> <ErrorDetails xmlns:a="http://schemas.datacontract.org/2004/07/System.Collections.Generic"> <KeyValuePairOfstringanyType> <a:key>ApiExceptionSourceKey</a:key> <a:value i:type="b:string" xmlns:b="http://www.w3.org/2001/XMLSchema">Plugin/Microsoft.Crm.ObjectModel.SdkMessageProcessingStepService</a:value> </KeyValuePairOfstringanyType> <KeyValuePairOfstringanyType> <a:key>ApiSourceActivityKey</a:key> <a:value i:type="b:string" xmlns:b="http://www.w3.org/2001/XMLSchema" /> </KeyValuePairOfstringanyType> <KeyValuePairOfstringanyType> <a:key>ApiExceptionOwnerKey</a:key> <a:value i:type="b:string" xmlns:b="http://www.w3.org/2001/XMLSchema">OwnershipNotFoundInExceptionOwnerSettings</a:value> </KeyValuePairOfstringanyType> <KeyValuePairOfstringanyType> <a:key>ApiOriginalExceptionKey</a:key> <a:value i:type="b:string" xmlns:b="http://www.w3.org/2001/XMLSchema">Microsoft.Crm.CrmException: Custom SdkMessageProcessingStep is not allowed on the specified message. ---&gt; Microsoft.Crm.CrmException: Custom SdkMessageProcessingStep is not allowed on the specified message. at Microsoft.Crm.ObjectModel.SdkMessageProcessingStepServiceInternal1.VerifyIsCustomAllowedOnFilter(IBusinessEntity entity, ExecutionContext context)
at Microsoft.Crm.ObjectModel.SdkMessageProcessingStepServiceInternal1.VerifyData(IBusinessEntity entity, IBusinessEntity inputEntity, ExecutionContext context) at Microsoft.Crm.ObjectModel.SdkMessageProcessingStepServiceInternal1.CreateInternal(IBusinessEntity entity, ExecutionContext context, Boolean validateData, Boolean verifySku, Boolean checkInternalStage)
at Microsoft.Crm.ObjectModel.SdkMessageProcessingStepServiceInternal`1.CreateInternal(IBusinessEntity entity, ExecutionContext context, Boolean verifySku)
--- End of inner exception stack trace ---
at Microsoft.Crm.Extensibility.VersionedPluginProxyStepBase.Execute(PipelineExecutionContext context)
at Microsoft.Crm.Extensibility.PipelineInstrumentationHelper.Execute(Boolean instrumentationEnabled, String stopwatchName, ExecuteWithInstrumentation action, PipelineExecutionContext context)
at Microsoft.Crm.Extensibility.Pipeline.<>c__DisplayClass3_0.<RunStep>b__0()</a:value>


<a:key>ApiStepKey</a:key>
<a:value i:type="b:guid" xmlns:b="http://schemas.microsoft.com/2003/10/Serialization/">54cabb1b-ea3e-db11-86a7-000a3a5473e8</a:value>


<a:key>ApiDepthKey</a:key>
<a:value i:type="b:int" xmlns:b="http://www.w3.org/2001/XMLSchema">1</a:value>


<a:key>ApiActivityIdKey</a:key>
<a:value i:type="b:guid" xmlns:b="http://schemas.microsoft.com/2003/10/Serialization/">6faddc9b-2257-458e-8452-904ffec799b1</a:value>


<a:key>ApiPluginSolutionNameKey</a:key>
<a:value i:type="b:string" xmlns:b="http://www.w3.org/2001/XMLSchema">System</a:value>


<a:key>ApiStepSolutionNameKey</a:key>
<a:value i:type="b:string" xmlns:b="http://www.w3.org/2001/XMLSchema">System</a:value>


<a:key>ApiExceptionCategory</a:key>
<a:value i:type="b:string" xmlns:b="http://www.w3.org/2001/XMLSchema">ClientError</a:value>


<a:key>ApiExceptionMessageName</a:key>
<a:value i:type="b:string" xmlns:b="http://www.w3.org/2001/XMLSchema">SdkCustomProcessingStepIsNotAllowed</a:value>


<a:key>ApiExceptionHttpStatusCode</a:key>
<a:value i:type="b:int" xmlns:b="http://www.w3.org/2001/XMLSchema">400</a:value>


http://go.microsoft.com/fwlink/?LinkID=398563&amp;error=Microsoft.Crm.CrmException%3a80044187&amp;client=platform
Custom SdkMessageProcessingStep is not allowed on the specified message.
2022-04-04T07:56:32.0107585Z
false


6faddc9b-2257-458e-8452-904ffec799b1
-2147204729


Custom SdkMessageProcessingStep is not allowed on the specified message.
2022-04-04T07:56:32.0107585Z
false







Server stack trace:
at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc& rpc)
at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)

Exception rethrown at [0]:
at Microsoft.Crm.Tools.Libraries.RegistrationHelper.RegisterStep(CrmOrganization org, CrmPluginStep step)
at Microsoft.Crm.Tools.PluginRegistration.StepRegistrationViewModel.RegisterStep(Object sender, EventArgs e)

AuthType is invalid. Please see Microsoft.PowerPlatform.Dataverse.Client.AuthenticationType for supported authentication types. (Parameter 'AuthType')'

Using the latest DataverseClient to connect using AuthType works however XrmRealContext fails with the same connection string.

Sample code

var fakedContext = new XrmRealContext("XrmDebug");
var whoAmIRequest = new WhoAmIRequest();

var response = fakedContext.GetOrganizationService().Execute(whoAmIRequest) as WhoAmIResponse;

Using the same connection string with::

var service = new Microsoft.PowerPlatform.Dataverse.Client.ServiceClient(connstring);

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.