Skip to content

Commit

Permalink
Merge pull request #8857 from MicrosoftDocs/jdaly-main-da-ga
Browse files Browse the repository at this point in the history
Remove preview from dependent assemblies feature docs
  • Loading branch information
JimDaly authored Nov 1, 2023
2 parents 94a543a + 0b595c7 commit a133409
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 24 deletions.
2 changes: 1 addition & 1 deletion powerapps-docs/developer/data-platform/TOC.yml
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
href: /troubleshoot/power-platform/power-apps/dataverse/dataverse-plug-ins-errors
- name: Access external web resources
href: access-web-services.md
- name: Dependent Assemblies (preview)
- name: Dependent Assemblies
href: dependent-assembly-plugins.md
- name: Write plug-ins for CreateMultiple and UpdateMultiple (Preview)
href: write-plugin-multiple-operation.md
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: Dependent Assembly plug-ins (preview)
title: Dependent Assembly plug-ins
description: Learn how to include more assemblies that your plug-in assembly can depend on.
ms.date: 10/25/2023
ms.date: 11/01/2023
ms.reviewer: jdaly
ms.topic: article
author: divkamath
Expand All @@ -13,22 +13,14 @@ contributors:
- PHecke
- JimDaly
---
# Dependent Assembly plug-ins (preview)

[!INCLUDE [cc-beta-prerelease-disclaimer](../../includes/cc-beta-prerelease-disclaimer.md)]
# Dependent Assembly plug-ins

It's frequently valuable to include another assembly or a resource file within a plug-in. For example, you may want to use Newtonsoft.Json.dll or another assembly. You may want to access a list of localized strings.

Without dependent assemblies, all plug-ins are registered as individual .NET Framework assemblies. The only way to include another assembly is to combine it into one using [ILMerge](https://github.com/dotnet/ILMerge). While ILMerge worked for many, Dataverse never supported it, and it didn't always work. ILMerge is no longer being maintained.

With dependent assemblies, rather than register an individual .NET assembly, you upload a NuGet Package that contains your plug-in assembly AND any dependent assemblies. This NuGet package file is stored in a new table called [PluginPackage](reference/entities/pluginpackage.md). The contents of the NuGet package is stored in file storage rather than SQL.

> [!IMPORTANT]
> - This is a preview feature.
> - Preview features aren't meant for production use and may have restricted functionality. These features are available before an official release so that customers can get early access and provide feedback.
>
> This document previously described a process to include additional files with the plug-in package that would be available in the assembly run-time. This capability will not be supported. We cannot guarantee that the runtime will allow access to these files.
When you upload your NuGet package, any assemblies that contain classes that implement the [IPlugin Interface](xref:Microsoft.Xrm.Sdk.IPlugin) are registered in [PluginAssembly](reference/entities/pluginassembly.md) table and associated with the `PluginPackage`. As you develop and maintain your project, you continue to update the `PluginPackage` and changes to the related plugin assemblies are managed on the server.

At runtime, Dataverse copies the contents of the NuGet package from the `PluginPackage` row and extracts it to the sandbox runtime. This way, any dependent assemblies needed for the plug-in are available.
Expand Down
23 changes: 11 additions & 12 deletions powerapps-docs/developer/data-platform/write-plug-in.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
---
title: "Write a plug-in (Microsoft Dataverse) | Microsoft Docs" # Intent and product brand in a unique string of 43-59 chars including spaces
description: "Learn how to write custom code to be executed in response to data processing events." # 115-145 characters including spaces. This abstract displays in the search result.
ms.date: 05/31/2023
ms.reviewer: "pehecke"
ms.topic: "article"
author: "divkamath" # GitHub ID
title: "Write a plug-in (Microsoft Dataverse) | Microsoft Docs"
description: "Learn how to write custom code to be executed in response to data processing events."
ms.date: 11/01/2023
ms.reviewer: pehecke
ms.topic: article
author: divkamath
ms.subservice: dataverse-developer
ms.author: "dikamath" # MSFT alias of Microsoft employees only
ms.author: dikamath
search.audienceType:
- developer
contributors:
- phecke
- JimDaly
---

# Write a plug-in
Expand Down Expand Up @@ -52,7 +53,7 @@ More information: [Services you can use in your code](#services-you-can-use-in-y
There are some exceptions to the statement about adding properties or methods in the note above. For example, you can have a property that represents a constant and you can have methods that are called from the `Execute` method. The important thing is that you never store any service instance or context data as a property in your class. These values change with every invocation and you don't want that data to be cached and applied to subsequent invocations.

More information: [Develop IPlugin implementations as stateless](/dynamics365/customer-engagement/guidance/server/develop-iplugin-implementations-stateless)
More information: [Develop IPlugin implementations as stateless](best-practices/business-logic/develop-iplugin-implementations-stateless.md)

### Pass configuration data to your plug-in

Expand Down Expand Up @@ -210,7 +211,7 @@ Plug-in and custom workflow activity assembly projects must target .NET Framewor

The assembly may include multiple plug-in classes (or types), but can be no larger than 16 MB in size. It's recommended to consolidate plug-ins and workflow assemblies into a single assembly as long as the size remains below 16 MB.

Best practice information: [Optimize assembly development](/dynamics365/customer-engagement/guidance/server/optimize-assembly-development)
Best practice information: [Optimize assembly development](best-practices/business-logic/optimize-assembly-development.md)

### Assemblies must be signed

Expand All @@ -228,14 +229,12 @@ Adding the `Microsoft.CrmSdk.CoreAssemblies` NuGet package to your project inclu

Because the [Microsoft.CrmSdk.CoreAssemblies NuGet package has a dependency on System.Text.Json](https://www.nuget.org/packages/Microsoft.CrmSdk.CoreAssemblies#dependencies-body-tab), you're able to refer to [System.Text.Json](xref:System.Text.Json) types at design time. However, the System.Text.Json.dll file in the sandbox run-time can't be guaranteed to be the same version that you reference in your project. If you need to use `System.Text.Json`, you should use the dependent assembly feature and explicitly include it in your NuGet package.
The dependent assembly capability, currently in a Preview release, can be used to include other .NET compiled assemblies with your plug-in assembly in a single package to upload.
You can use dependent assemblies to include other .NET compiled assemblies with your plug-in assembly in a single package to upload.

More information: [Dependent Assembly plug-ins](dependent-assembly-plugins.md).

> [!IMPORTANT]
> The dependent assembly capability is so important to plug-in development that you should consider using it from the start even if you do not have an immediate need to do so. Adding support for dependent assemblies to your plug-in project is much more difficult later on in the development cycle.
>
> Since this feature is a Preview release, do not use this feature for production work.

## Next steps

Expand Down

0 comments on commit a133409

Please sign in to comment.