Visual Studio Mac 2022 Preview 17.4 Requires Adding System.IO Where Other Computers Don't
I have a project that other devs have been working on. They are using a variety of Windows and Mac computers with Visual Studio 2022.
This is a Xamarin Forms project.
When I try to build I get errors like Stream not being defined. When I click on the quick actions it has an option to add "using System.IO" to the top of the file. When I do this the errors go away.
This same exactly project builds just fine on all of the other computers without having to add that file. One of them is Windows running the latest release of Visual Studio 2022 for Windows and another one is a Mac running Visual Studio for Mac 2022 17.3 release version.
I am using Visual Studio 2022 for Mac preview 17.4. I can't image how this would make a difference, but that seems to be the only difference.
I supposed it could also be some version of some .NET library or SDK?
Does anyone know what is going on or where I should look next?
Hi @Tony Pitman , For further investigation, could you please share the detailed error message? And I'm confused as to which line of code throws the error. Does this error still exist when you run an empty template project？
Sign in to comment
The exact error is: "The type or namespace 'Stream' could not be found (are you missing a using directive of an assembly reference)?
I get the same error for Stream, File, Path, and many others.
Here is the thing: The question for me is not really why I am getting this error. The fact is that there ISN'T a "using System.IO;" in this file.
I can solve the error by adding: using System.IO; to the top of the file. I can also fix it by adding the same to a global using file.
The real question is why do NONE of the other developers and our build machine get this same error? I can fix the error. I want to understand what is going on between my computer and those other computers.