Getting the following error:
The name 'File' does not exist in the current context[dnxcore50]
Tried to build it in-case it was to do with VSCode alone. It threw me same error.
I have installed the dependency using the following:
dnu install System.IO
Gave me the following message
c:\Users\user1\Dropbox\dev\csharp\vscode\ads\WeightedGraphs>dnu install System.IO GET https://www.nuget.org/api/v2/FindPackagesById()?Id='System.IO'. OK https://www.nuget.org/api/v2/FindPackagesById()?Id='System.IO' 679ms System.IO.4.0.10-beta-22816 was added to project.json. Restoring packages for c:\Users\user1\Dropbox\dev\csharp\vscode\ads\WeightedGraphs\project.json Writing lock file c:\Users\user1\Dropbox\dev\csharp\vscode\ads\WeightedGraphs\project.lock.json Restore complete, 302ms elapsed
project.json
{
"version": "1.0.0-*",
"dependencies": {
"System.IO": "4.0.10-beta-22816"
},
"commands": {
"run": "run"
},
"frameworks": {
"dnx451": {},
"dnxcore50": {
"dependencies": {
"System.Collections": "4.0.10-beta-22816",
"System.Linq": "4.0.0-beta-22816",
"System.Console": "4.0.0-beta-22816"
}
}
}
}
In.cs
using System.IO;
public class In{
public In(string s){
var filename = s;
var path = "";
if(File.Exists(path)){
//Code TO Be Added
}
}
}