0

I am preparing Windows Store App with C# & xaml led by online examples. Many times when I try to use a keyword like: "File" in System.IO.File.WriteAllLines()
or
"Frame" in this.Frame.Navigate(typeof(MyPage));

I took care of adding appropriate "using required_assembly" I get error like:

The type or namespace name 'File' does not exist in the namespace 'System.IO' (are you missing an assembly reference?)

The steps I took to try resolving errors were:

  1. I did Rebuild & Clean Build after removing & then re-adding using statements.
  2. I Unload & then Reload the project from solution explorer.
  3. Browsed the Object-Browser & yes the assemblies were there.
  4. Checked the "References" in the Solution Explorer, now this is where the System.IO was not present & when I tried to manually add the reference it said that "All of the Framework assemblies are already referenced".

Why is Visual Studio producing these errors?

ryanyuyu
  • 6,366
  • 10
  • 48
  • 53
Htaank
  • 21
  • 3
  • Do you have a different example or is that the main one? Because so far as I'm aware, `System.IO.File` isn't available for Windows Store apps. – Damien_The_Unbeliever Mar 11 '15 at 15:27
  • Thanks a lot for pointing out this & yes you are completely right about the System.IO.File not present for Windows Store Apps. – Htaank Mar 11 '15 at 17:39
  • Also, you seem to have been lucky and someone edited your question - the right way to avoid downvotes is to *write a good question* - show what you've done (be *specific*), what solutions you've already rejected (include links, where possible). Vague things like "I've searched the entire internet and nothing helped" doesn't help *us* to know what solutions you've actually found and attempted. – Damien_The_Unbeliever Mar 11 '15 at 17:51

0 Answers0