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

Crash when trying to get runtime version #32

Closed
PavelBal opened this issue Feb 26, 2024 · 2 comments
Closed

Crash when trying to get runtime version #32

PavelBal opened this issue Feb 26, 2024 · 2 comments

Comments

@PavelBal
Copy link
Member

RStudio crashes when trying to do this:

rSharp/R/zzz.R

Line 37 in da57ab9

rNETenv$runtimeVersion <- .getClrVersionString()

Null pointer?

Here how to reproduce:

nativePkgName <- "RsharpMs"
nativeLibrary <- "D:/Work/OSPS/Repos/rSharp/inst/lib/RsharpMs.dll"
srcPkgLibPath <- "D:/Work/OSPS/Repos/rSharp/inst/lib"

# Load C++ library
dyn.load(nativeLibrary, DLLpath = srcPkgLibPath)
# Load .NET library through C++
invisible(.C("rSharp_create_domain", srcPkgLibPath, PACKAGE = nativePkgName))

# Try to create a pointer - fail
extPtr <- .External("r_call_static_method", "Rclr.ClrFacade", "GetFieldOrProperty", "System.Environment", "Version", PACKAGE = nativePkgName)
@rwmcintosh
Copy link
Member

rwmcintosh commented Feb 26, 2024

Rclr.ClrFacade is not the correct qualified class name. It should be ClrFacade.ClrFacade. Although, this is likely to change from #29

extPtr <- .External("r_call_static_method", "ClrFacade.ClrFacade", "GetFieldOrProperty", "System.Environment", "Version", PACKAGE = "rSharpMs")

@PavelBal
Copy link
Member Author

It is because ClrFacade is not found: #31

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

2 participants