web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Supply chain | Supply Chain Management, Commerce
Suggested answer

System.IO.Stream not found in assembly System.Runtime

(0) ShareShare
ReportReport
Posted on by 184

Hello All,

I have a requirement for file based integration is D365 F&O

I have download Renci.SshNet 

Created C# library class for upload the file to an SFTP server.

Added the dll as reference in my D365 project.

Created a service class for passing the required parameters to C# class for uploading the file.

in my D365 project , in service class on method signature I am getting the following error:

"Type 'System.IO.Stream' not found in assembly 'System.Runtime, version=4.0.0.0, Culture= neutral, PublicKeyToken=b03f5f7f11d50a3a'

Please run a full compilation of the model corresponding to the assembly 'System.Runtime, Version=4.0.0.0, Culture= neutral, PublicKeyToken=b03f5f7f11d50a3a'

Also I have changed the version number to 4.2.2.0 under web.config file as I was getting version error initially and after changing this that error has gone but now I am getting the above error. Could someone please suggest some answers here to overcome the issue?

I have the same question (0)
  • D365_Wibes Profile Picture
    184 on at
    RE: D365 System.IO.Stream not found in assembly

    Hello All,

    Can some one help on this please?

  • Suggested answer
    Martin Dráb Profile Picture
    236,570 Most Valuable Professional on at
    RE: D365 System.IO.Stream not found in assembly

    It seems that you have a library for .NET Core, not for .NET Framework.

    .NET Framework contains System.Runtime in mscorlib.dll, not in System.Runtime.dll.

  • D365_Wibes Profile Picture
    184 on at
    RE: System.IO.Stream not found in assembly System.Runtime

    Thanks for your repsonse Martin.

    DO I need to download library for .Net Framework

  • Martin Dráb Profile Picture
    236,570 Most Valuable Professional on at
    RE: System.IO.Stream not found in assembly System.Runtime

    Yes, you need a library for .NET Framework if you want to use it in a .NET Framework application, such as F&O.

    You can see that it doesn't work otherwise.

  • D365_Wibes Profile Picture
    184 on at
    RE: System.IO.Stream not found in assembly System.Runtime

    Thanks Martin, could u please let me know the library name that I need to download?

    Also after downloading , I need to add it as a reference in my d365 project right ?

    Please help

  • Martin Dráb Profile Picture
    236,570 Most Valuable Professional on at
    RE: System.IO.Stream not found in assembly System.Runtime

    There are several forks and it should be you who knows what you want. I would try the core one: SSH.NET. If you want to use the DLL directly, download the package, rename it to *.zip, unzip it and take the file from lib\net40.

    Yes, you need to reference libraries that you add and want to use. Don't forget to delete the old reference from AOT.

  • D365_Wibes Profile Picture
    184 on at
    RE: System.IO.Stream not found in assembly System.Runtime

    Hi Martin,

    I have downloaded the file Ssh.Net as you have instructed and added it as reference in my D365 project.

    now I am getting error on my service operation method signature as

    "A reference to 'System.Runtime, Version=4.2.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' is required to compile this moule.

    Please suggest some answers on this

  • Martin Dráb Profile Picture
    236,570 Most Valuable Professional on at
    RE: System.IO.Stream not found in assembly System.Runtime

    It seems that you still have the old, wrong reference somewhere. Pay attention to both the project and the References node in AOT.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > Supply chain | Supply Chain Management, Commerce

#1
CA Neeraj Kumar Profile Picture

CA Neeraj Kumar 403

#2
Sagar Suman Profile Picture

Sagar Suman 194 Super User 2025 Season 2

#3
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 179 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans