FileStream

I am trying to port some code from an older version 2.2.0.5000 to the latest SITcore 2.2.2.1000 and FileStream on the old code throws an error

|Error|CS0433|The type ‘FileStream’ exists in both ‘GHIElectronics.TinyCLR.IO, Version=2.2.2.1000, Culture=neutral, PublicKeyToken=null’ and 'mscorlib, Version=4.0.0.0

If I preceded the FileStream class with GHIElectronics.TinyCLR.IO I still get an error.

If I remove the #using GHIElectronics.TinyCLR.IO and include #using System.IO instead it still won’t build without errors.

The sample code shows the some FileStream class as I am trying to use. It worked before so what has changed?

The code is for reading and writing to the SD card.

I am actually getting a bunch of network code errors with similar “exists”

Somehow FileSystem from desktop version is added to your project.

Close VS, delete bin/obj/.vs folder, uninstall / reinstall all nuget.
Also open csproj file, make sure nothing new added.

Thanks Dat. Removing those directories and reloading the project worked.

1 Like