Skip to content

Document Asp.Net Core 5.0 behavior on BinaryFormatter with Microsoft.PowerShell.SDK #6879

@fMichaleczek

Description

@fMichaleczek

Summary of the new document or enhancement

  • Link(s) to related issue(s) in the PowerShell/PowerShell repo: #14032

Description of what changed

Starting net5.0, if you use the PowerShell SDK in an Asp.Net Core application, PSRemoting is broken because of the BinaryFormatter long-term obsoletion plan.

To re-enable BinaryFormatter to let PSRemoting works, you have add a property EnableUnsafeBinaryFormatterSerialization set to true in your csproj :

<Project Sdk="Microsoft.NET.Sdk.Web">
	<PropertyGroup>
		<TargetFramework>net5.0</TargetFramework>
		<EnableUnsafeBinaryFormatterSerialization>true</EnableUnsafeBinaryFormatterSerialization>
	</PropertyGroup>
	<ItemGroup>
		<PackageReference Include="Microsoft.PowerShell.SDK" Version="X.X.X" />
	</ItemGroup>
</Project>

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions