Need simple example of checking if a FIle Exists on Windows in a PCL Analyzer VSIX
I think I need the code below
Dim f As IFolder = Await FileSystem.Current.LocalStorage.GetFolderAsync(IO.Path.GetDirectoryName(context.Document.FilePath), context.CancellationToken)
Dim r As ExistenceCheckResult = Await f.CheckExistsAsync(newFileName, context.CancellationToken)
If r = ExistenceCheckResult.FileExists Then
but when I run it in the debugger I get this message on the first line
"This functionality is not implemented in the portable version of this assembly. You should reference the PCLStorage NuGet package from your main application project in order to reference the platform-specific implementation."
What does this mean and how do I fix it? I don't need this in the VSIX project because it is not a PCL and the PCL project can't access the VSIX project.
PCL Storage uses the "bait and switch" pattern, so you do need to reference PCL storage from the VSIX even if you're not using it directly there.
Sorry I am being dense but I think you are saying to get this to work all I have to do is add the PCLStorage NuGet package to the VSIX project in addition to the PCL project. Then when I run the code above it will just work. If that is correct I will close the issue.
Yes, try referencing the PCLStorage NuGet package from the VSIX project and let me know if that works. If not, perhaps VSIX projects work a little differently and you might have to manually include the right DLL.
That did not work, the PCL project reference
...\packages\PCLStorage.1.0.2\lib\portable-net45+wp8+wpa81+win8+monoandroid+monotouch+Xamarin.iOS+Xamarin.Mac\PCLStorage.dll
The copy in the VSIX is different.
...\packages\PCLStorage.1.0.2\lib\net45\PCLStorage.dll

The references are supposed to be different. That's how bait and switch works.
-----Original Message----- From: "Paul M Cohen" [email protected] Sent: 12/20/2015 6:33 PM To: "dsplaisted/PCLStorage" [email protected] Cc: "Daniel Plaisted" [email protected] Subject: Re: [PCLStorage] Need simple example of checking if a FIle Exists onWindows in a PCL Analyzer VSIX (#29)
That did not work, the PCL project reference ...\packages\PCLStorage.1.0.2\lib\portable-net45+wp8+wpa81+win8+monoandroid+monotouch+Xamarin.iOS+Xamarin.Mac\PCLStorage.dll
The copy in the VSIX is different. ...\packages\PCLStorage.1.0.2\lib\net45\PCLStorage.dll
— Reply to this email directly or view it on GitHub.
But it doesn't work, no switching is going on.