I'm currently in the process of writing analysis code for my job. I have to "map" the code from FxCop to our own private framework. This is a bit of an issue, but not my main concern. I can't access the FileInfo class, my ultimate preview 2015 VS asked me if I wanted to generated it. So, basically, I'm asking what's the equivalent of the FileInfo class while doing code analysis? I've looked into the FileVersionInfo class, but I'm not quite sure if that's the way to go ?
EDITS
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;
namespace SomeNamespace
{
public class SomeFileValidationClass
{
public FileInfo FileInfo { get; private set; }
public SomeFileValidationClass(FileInfo fileInfo)
{
this.FileInfo = fileInfo;
_failedResults = new List<SomeRuleResult>();
}
//Code missing, but the point still remains that FileInfo can't be accessed.
}
According to the documentation FileInfo
is located in the System.IO
namespace of mscorlib
, so it should be present without needing any other references.
My only suggestion is that you are compiling against some odd version of mscorlib
that doesn't have it for some reason, maybe its a bug in VS2015, or perhaps you have downloaded and built corefx?