With the RC1 of .NET Core I went to investigate the most burning question in the back of my mind!
Can I open a damn FileStream to a file on the disk with .NET Core?
(And by that I mean anywhere, like "C:\temp\a.txt" and not just in $user\AppData !!!)
So I opened visual studio 2015, clicked new project > web > Console Application package (yes "web" is where the native app is!!)
then I typed "new FileStream" and looked at the helpful intellisense advice.
And it's where I got confused....
"new FileStream(....)" is:
- available for "DNX 4.5.1"
- NOT available for "DNX Core 5.0"
When I tried to compile
using (var s = new FileStream(@"c:\temp\a.txt", FileMode.Create))
using (var sw = new StreamWriter(s))
sw.WriteLine("it worked!");
I got
Program.cs(13,32,13,42): DNX Core 5.0 error CS0246: The type or namespace name 'FileStream' could not be found (are you missing a using directive or an assembly reference?)
Program.cs(13,61,13,69): DNX Core 5.0 error CS0103: The name 'FileMode' does not exist in the current context
And
YES I am
using System.IO;
it's an "issue" with ".NET Core"....
what does that means?!
What I have tried:
created a new .NET Core web app and looked at intellisense information