Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IntelliSense is broken in VS #44

Closed
sergey-tihon opened this issue Oct 4, 2013 · 10 comments
Closed

IntelliSense is broken in VS #44

sergey-tihon opened this issue Oct 4, 2013 · 10 comments

Comments

@sergey-tihon
Copy link
Contributor

I see the following error when I try to script using RProvider (VS2012 Update 3).
All required assemblies are located in the same folder with RProvider.dll.

error FS3053: The type provider 'RProvider.RProvider' reported an error: The type provider constructor has thrown an exception: Could not load file or assembly 'RDotNet.NativeLibrary, Version=1.0.0.0, Culture=neutral, PublicKeyToken=5f72f6e23c6920d4' or one of its dependencies. The system cannot find the file specified.

The script is following

// Do not work in VS and FSI
//#r @"D:\Research&Development\PRroviderApps\packages\RProvider.1.0.3\lib\RProvider.dll"

// Do not work in VS but work in FSI
#I @"D:\Research&Development\PRroviderApps\packages\RProvider.1.0.3\lib\"
#r "RProvider.dll"

open RProvider

image

@hmansell
Copy link
Contributor

hmansell commented Oct 4, 2013

Did this work for you before?

If so, has anything changed since it last worked?

@sergey-tihon
Copy link
Contributor Author

The last time it worked a long time ago.
It was before NuGet publishing with R v2.15.

@sergey-tihon
Copy link
Contributor Author

As I already know, I have had problems with registry keys and R installation path detection.
I have tried to debug IntelliSence, but when I attach from one VS to another I see another error

Error   2   The type provider 'RProvider.RProvider' reported an error: The type provider constructor has thrown an exception: Method not found: 'Microsoft.FSharp.Core.FSharpOption`1<RDotNet.IntegerVector> RDotNet.ActivePatterns.|IntegerVector|_|(RDotNet.SymbolicExpression)'. D:\Personal\GitHub\FSharpRProvider\example.fsx  2   1   RProvider

image

@hmansell
Copy link
Contributor

hmansell commented Oct 5, 2013

Can you check if RDotNet.Fsharp.dll is present in the Rprovider directory.
And try referencing it.

Howard

On Oct 4, 2013, at 7:31 PM, Sergey Tihon notifications@github.com wrote:

As I already know, I have had problems with registry keys and R
installation path detection.
I have tried to debug IntelliSence, but when I attach from one VS to
another I see another error

Error 2 The type provider 'RProvider.RProvider' reported an error:
The type provider constructor has thrown an exception: Method not
found: 'Microsoft.FSharp.Core.FSharpOption`1<RDotNet.IntegerVector>
RDotNet.ActivePatterns.|IntegerVector|_|(RDotNet.SymbolicExpression)'.
D:\Personal\GitHub\FSharpRProvider\example.fsx 2 1 RProvider

[image: image]https://f.cloud.github.com/assets/1197905/1273576/0477b43e-2d4d-11e3-8ea0-9a55565449c4.png


Reply to this email directly or view it on
GitHubhttps://github.com//issues/44#issuecomment-25736934
.

@sergey-tihon
Copy link
Contributor Author

All assemblies in place.
After adding reference to RDotNet.Fsharp.dll nothing have changed, but when I changed script in following way

#I @"bin/Debug/"
#r @"RDotNet.NativeLibrary.dll"
#r @"RDotNet.dll"
#r @"RDotNet.FSharp.dll"
#r @"RProvider.dll"
...

I was able to catch following exception

The type initializer for 'RProvider.RInteropInternal' threw an exception.   
   at RProvider.RInteropInternal.eval(String expr)
   at RProvider.RInterop.getPackages() in D:\Personal\GitHub\FSharpRProvider\RInterop.fs:line 283

InnerException:
The type initializer for '<StartupCode$RProvider>.$RInterop' threw an exception.
   at RProvider.RInteropInternal..cctor() in D:\Personal\GitHub\FSharpRProvider\RInterop.fs:line 0

InnerException:
Could not load file or assembly 'RDotNet.NativeLibrary, Version=1.0.0.0, Culture=neutral, PublicKeyToken=5f72f6e23c6920d4' or one of its dependencies. The system cannot find the file specified.
   at <StartupCode$RProvider>.$RInterop..cctor()

So now I see the same behavior in VS debugger and new console app with RProvider form NuGet.

@sergey-tihon
Copy link
Contributor Author

Finally, I have found the source of the issue. RProvider does not work with installed and enabled .NET Reflector Visual Studio Extension. I turned off this addon and now everything is OK.

This is a message from Fusion log:

LOG: Post-policy reference: RDotNet.NativeLibrary, Version=1.0.0.0, Culture=neutral, PublicKeyToken=5f72f6e23c6920d4
LOG: Did not find assembly in DEVOVERRIDE path C:\ProgramData\Red Gate\.NET Reflector\DevPath

The full log you can find in the gist.

@ChrisMorter
Copy link

It sounds like you need to reset the devpath in the .NET Reflector Visual Studio extension. You can do this by clicking 'Reset the DEVPATH' under the .NET Reflector menu in Visual Studio.

At the moment Visual Studio is looking in the folder specified by the devpath for the RProvider dll, rather than the directory you actually put it. Reflector sets the devpath if it has previously had to regenerate an assembly in order to change the assembly GUIDs to match those specified in the corresponding PDB generated by Reflector.

@sergey-tihon
Copy link
Contributor Author

'Reset the DEVPATH' is unavailable
image

@ChrisMorter
Copy link

Hmm, that's strange.. If you look at the environment variables directly, is the DEVPATH environment variable set? If so, you can delete it manually, this should have the same affect as resetting the devpath in the VS extension.

@sergey-tihon
Copy link
Contributor Author

Hmm... I do not have DEVPATH environment variable. =(
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants