Issue
Below error occurs after trying to deploy plugin project using Visual Studio 2022 and Power Platform Tools for VS 2022.
"PluginPackage cannot contain assemblies included in the Microsoft.CrmSdk.CoreAssemblies or Microsoft.CrmSdk.Workflow nuget packages. Found assembly Microsoft.Crm.Sdk.Proxy, Version=9.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35 in the package. (mscorlib)"
How can I ensure Microsoft.Crm.Sdk.Proxy is not included in the generated Nuget package?
I have tried setting attribute PrivateAssets="All" on all PackageReference in the project file as per this forum post Solved: Dependent Assembly - PluginPackage can not contain... - Power Platform Community (microsoft.com)
Steps to Recreate.
Create new Solution using Power Platform Solution Template.
Include a Plugin Project.
Right click on a table and create a plugin step and plugin.
Build plugin project
Deploy plugin project. -> Above Error Occurs
Register New Package using Plugin Registration Tool -> Above Error Occurs