Azure / Azure/hpcpack

BinaryFormatter Exception in .NET 9.0 Upgrade

Open
#60 3 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
PowerShell
Stars
34
Forks
19
Avg merge
41m
Merged PRs (30d)
4

Description

# Bug Report: BinaryFormatter Exception in .NET 9.0 Upgrade

## Problem Description
When upgrading our project to **.NET 9.0**, we encounter the following error:

```
13:44:52 TraceHelper. [ERR] - :
EventListener: Exception at connect "System.PlatformNotSupportedException:
BinaryFormatter serialization and deserialization have been removed. See https://aka.ms/binaryformatter for more information.
at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Serialize(Stream serializationStream, Object graph)
at Microsoft.Hpc.Scheduler.Store.EventListener.ConnectToServer()" in method at :
```

This issue is caused by the **removal of `BinaryFormatter` from .NET 9.0**, as outlined in the .NET announcements:
🔗 [BinaryFormatter Removal - .NET 9.0](https://github.com/dotnet/announcements/issues/293)

---

## Steps to Reproduce
1. Upgrade the project to **.NET 9.0**
2. Run the application
3. Observe the exception when `Microsoft.Hpc.Scheduler.Store.EventListener.ConnectToServer()` is called

---

## Expected Behavior
The application should function without throwing a `System.PlatformNotSupportedException`.

---

## Environment
- **.NET Version**: .NET 9.0
- **Affected Component**: `Microsoft.Hpc.Scheduler.Store.EventListener`
- **OS**: _(Provide OS details if relevant)_
- **Any Additional Dependencies**: _(List if applicable)_

---

## Possible Solution / Workaround
Would it be possible to update `Microsoft.Hpc.Scheduler.Store.EventListener` to avoid using `BinaryFormatter` and switch to a supported serialization mechanism?

Is there an alternative approach to handle this in .NET 9.0?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.