# System.Memory.dll issue

**URL:** <https://discourse.mcneel.com/t/system-memory-dll-issue/152242>\
**Category:** Rhino Developer\
**Tags:** windows\
**Created:** [December 17, 2022, 2:43pm UTC](https://discourse.mcneel.com/t/system-memory-dll-issue/152242 "2022-12-17T14:43:23Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![kitjmv](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/kitjmv/32/769169_2.png) [@kitjmv](https://discourse.mcneel.com/u/kitjmv)\
**Post date:** [December 17, 2022, 2:43pm UTC](https://discourse.mcneel.com/t/system-memory-dll-issue/152242/1 "2022-12-17T14:43:23Z")

</div>

Hello,

A few months ago a problem appeared in MSBuild which broke several projects based on `System.Memory.dll, 4.5.4`.

> <https://github.com/dotnet/msbuild/issues/7873#issuecomment-1227332842>
>
> \### Issue Description
> Using a roslyn CodeAnalysis project running on net48 atte…mpting to load a project also targetting net48 will fail to load dependencies caused by a missing method \`\`Method not found: 'System.ReadOnlySpan\`1\<Char\> Microsoft.IO.Path.GetFileName(System.ReadOnlySpan\`1\<Char\>)'\`\` if the target project has already been compiled and has bin/obj directories present.
> 
> \### Steps to Reproduce
> \[CodeAnalysisApp2.zip\](https://github.com/dotnet/msbuild/files/9304337/CodeAnalysisApp2.zip)
> Repro is attached. To use 
> 1) unzip and open the \`CodeAnalysisApp2.sln\` file then run it. It should load the console app solution and correctly run through to the console readline without displaying any problems.
> 2) open the \`ConsoleApp2.sln\` and compile or run it
> 3) reopen the \`CodeAnalysisApp2.sln\` and run it again, you should get an error:
> \`\`\`
> Using MSBuild at 'C:\\Program Files\\Microsoft Visual Studio\\2022\\Professional\\MSBuild\\Current\\Bin' to load projects.
> Loading solution '..\\..\\..\\..\\ConsoleApp2.sln'
> Evaluate 0:00.2464048 ConsoleApp2.csproj
> Msbuild failed when processing the file 'D:\\Programming\\csharp10\\CodeAnalysisApp2\\ConsoleApp2\\ConsoleApp2.csproj' with message: Method not found: 'System.ReadOnlySpan\`1\<Char\> Microsoft.IO.Path.GetFileName(System.ReadOnlySpan\`1\<Char\>)'.
> Finished loading solution '..\\..\\..\\..\\ConsoleApp2.sln'
> \`\`\`
> 
> \### Versions & Configurations
> Latest VS 17.3 update, this worked on 17.2.
> MSBuild version 17.3.0+f67e3d35e for .NET Framework 17.3.0.37102

Today I noticed that I can’t update my Rhino plugins.  
I have tried many methods to force link to library `System.Memory.dll, 4.5.5` in my directory.  
It didn’t work despite an updated MSBuild.

Following the indications of Rainersigwald (the maintainer of MSBuild) and before sending this message to confirm this problem,  
I temporarily replaced `C:\Program Files\Rhino 7\System\System.Memory.dll` with the newer version.  
My plugins worked fine.

The compilation can therefore be broken if our program or a referenced library uses the recent version of `System.Memory.dll`

Do you think it would be possible in a future update to upgrade to “System.Memory” version 4.5.5?

jmv.

---

<div class="post-metadata">

**Author:** ![dale](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/dale/32/772741_2.png) [@dale](https://discourse.mcneel.com/u/dale)\
**Post date:** [December 22, 2022, 7:36pm UTC](https://discourse.mcneel.com/t/system-memory-dll-issue/152242/2 "2022-12-22T19:36:31Z")

</div>

@stevebaer, can you chime in here?

---

<div class="post-metadata">

**Author:** ![stevebaer](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/stevebaer/32/473567_2.png) [@stevebaer](https://discourse.mcneel.com/u/stevebaer)\
**Post date:** [December 22, 2022, 7:51pm UTC](https://discourse.mcneel.com/t/system-memory-dll-issue/152242/3 "2022-12-22T19:51:06Z")

</div>

We’ll need to figure out where this is used in Rhino first and then we can make a decision to see what can be done.

---

<div class="post-metadata">

**Author:** ![kitjmv](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/kitjmv/32/769169_2.png) [@kitjmv](https://discourse.mcneel.com/u/kitjmv)\
**Post date:** [December 22, 2022, 8:38pm UTC](https://discourse.mcneel.com/t/system-memory-dll-issue/152242/4 "2022-12-22T20:38:46Z")

</div>

Hello,

I asked myself the same question to know if I could leave the recent version in ‘C:\Program Files’.  
But I didn’t really have confidence.  
I opened everything ILSpy could open from the `C:\Program Files\Rhino 7\System` directory.  
I couldn’t find any direct reference to the library other than `System.Resources.Extensions.dll`, also in Rhino’s directory.  
The only indirect references I’ve found are from `netstandard` referenced by Eto’s libraries.

I didn’t search that referred to `System.Resources.Extensions.dll`.  
I also haven’t looked in `C:\Program Files\Rhino 7\Plug-ins` and Grasshopper.

jmv

---

<div class="post-metadata">

**Author:** ![stevebaer](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/stevebaer/32/473567_2.png) [@stevebaer](https://discourse.mcneel.com/u/stevebaer)\
**Post date:** [January 20, 2023, 8:08pm UTC](https://discourse.mcneel.com/t/system-memory-dll-issue/152242/5 "2023-01-20T20:08:49Z")

</div>

@curtisw is this something we can update?
