Quantcast
Channel: R.NET
Viewing all 1634 articles
Browse latest View live

Commented Unassigned: C# App crashes while getting row from dataframe [150]

$
0
0
Hi,
Can anyone help me on this.
I am facing this weird issue, when I try to fetch some rows(row by row) from my dataset(dataframe in R). First few rows are fetched without any error but after say 4-5 rows I get some exception on a line which executed perfectly for first few rows.
I am executing following statement:

SomeRDotNetObject.Evaluate("Dataset1[rowindex , ]" ); // Dataset1 is the name of the dataset

for say rowindex= 1 to 4 this works but fails on rowindex=5. And C# application crashes with following exception:-

_System.Windows.Threading.DispatcherUnhandledExceptionEventHandler -METHOD :Invoke() -LINE :0
System.InvalidOperationException: Dispatcher processing has been suspended, but messages are still being processed.
at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)_


Thanks
adabral
Comments: Didn't mean to post that. I really hate codeplex.

Commented Unassigned: C# App crashes while getting row from dataframe [150]

$
0
0
Hi,
Can anyone help me on this.
I am facing this weird issue, when I try to fetch some rows(row by row) from my dataset(dataframe in R). First few rows are fetched without any error but after say 4-5 rows I get some exception on a line which executed perfectly for first few rows.
I am executing following statement:

SomeRDotNetObject.Evaluate("Dataset1[rowindex , ]" ); // Dataset1 is the name of the dataset

for say rowindex= 1 to 4 this works but fails on rowindex=5. And C# application crashes with following exception:-

_System.Windows.Threading.DispatcherUnhandledExceptionEventHandler -METHOD :Invoke() -LINE :0
System.InvalidOperationException: Dispatcher processing has been suspended, but messages are still being processed.
at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)_


Thanks
adabral
Comments: The scrolling issue is a WPF issue and its a fairly standard cross-thread problem, the reason it is difficult to figure out is because it appears that R itself is trying to do something with the the Windows message queue, but since R is a mingw port, we don't get debug symbols in our Microsoft debugger. You can build R under Windows with MinGW from source and attach the debugger to the process, but that is an extremely challenging thing to do if you don't have a background in those tools. When you see a problem like this, you usually you just wrap the method in a "CurrentDispatcher.BeginInvoke()" call and that'll let GUI operations happen on the appropriate thread with the dispatcher enabled. In this case, since its an indexer access that is databound to the grid, its difficult to shove everything into the BeginInvoke() call without causing some issues. Here's an example: object IList.this[int index] { get { if (_indexDictionary.ContainsKey(index)) return _indexDictionary[index]; Dispatcher.CurrentDispatcher.BeginInvoke((Action) (() => { var rowdata = GetRowData(index); object generetedObject = new MyDataframeRow { Col1 = rowdata[0], Col2 = rowdata[1], Col3 = rowdata[2] }; if (!_indexDictionary.ContainsKey(index)) { _indexDictionary.Add(index, generetedObject); } RaiseListChanged(new ListChangedEventArgs(ListChangedType.ItemAdded, index, index)); })); return new object(); } set {} } Unfortunately, what the above code says to me is that you need to re-think your caching and databinding strategy. My suspicion is that the issue has something to do with the console device trying to write a message, but that's just a guess. R is a complex beast and treating it like a clean datasource is probably not the easiest path to had down. If it were me, I would favor marshaling large blocks of data between C# and R over executing lots of little access calls due the the complexity of interacting with R. For the 'AccessViolation' issue, I was unable to reproduce it, even with 40,000 items. I do believe that there is something internal happening with R as every time you see that. It is unlikely that it is due to a bug in the R.Net source and again, I think it may have something to do with the console device. Every time I've had that issue it has been the fault of my device causing a C# exception that propagates into R's unmanaged DLLs and I was able to fix the exception by correcting my code. Again, deciphering that issue is difficult, and in one case required using a combination of static source analysis of the R tree and the MinGW debugger.

Commented Unassigned: C# App crashes while getting row from dataframe [150]

$
0
0
Hi,
Can anyone help me on this.
I am facing this weird issue, when I try to fetch some rows(row by row) from my dataset(dataframe in R). First few rows are fetched without any error but after say 4-5 rows I get some exception on a line which executed perfectly for first few rows.
I am executing following statement:

SomeRDotNetObject.Evaluate("Dataset1[rowindex , ]" ); // Dataset1 is the name of the dataset

for say rowindex= 1 to 4 this works but fails on rowindex=5. And C# application crashes with following exception:-

_System.Windows.Threading.DispatcherUnhandledExceptionEventHandler -METHOD :Invoke() -LINE :0
System.InvalidOperationException: Dispatcher processing has been suspended, but messages are still being processed.
at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)_


Thanks
adabral
Comments: Hi Skyguy94, Thanks for looking into this issue. I will try some of the things you have suggested. Lets see where it goes. Regards,

Commented Unassigned: C# App crashes while getting row from dataframe [150]

$
0
0
Hi,
Can anyone help me on this.
I am facing this weird issue, when I try to fetch some rows(row by row) from my dataset(dataframe in R). First few rows are fetched without any error but after say 4-5 rows I get some exception on a line which executed perfectly for first few rows.
I am executing following statement:

SomeRDotNetObject.Evaluate("Dataset1[rowindex , ]" ); // Dataset1 is the name of the dataset

for say rowindex= 1 to 4 this works but fails on rowindex=5. And C# application crashes with following exception:-

_System.Windows.Threading.DispatcherUnhandledExceptionEventHandler -METHOD :Invoke() -LINE :0
System.InvalidOperationException: Dispatcher processing has been suspended, but messages are still being processed.
at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)_


Thanks
adabral
Comments: Ok, please let me know if you run into any further roadblocks.

New Post: R.NET failing on library(RODBC) call (and other external libraries)

$
0
0
Hi skyguy94 and J-M

Again, thanks for applying yourselves to our problem - it's much appreciated. Yes, we had suspected early on that access rights may be an issue but unfortunately this isnt the case. We are using the default app pool but have granted permissions to the relevant folders. the .libPaths() check is also something we looked at quite early on.

To be sure though, we wrote a test project which is a template MVC5 project kicking off just the RODBC load call. Its a VS2013 project and if you have the time or inclination you can access it here:

https://dl.dropboxusercontent.com/u/2469451/TestR.7z

Thanks again
N

New Post: R.NET failing on library(RODBC) call (and other external libraries)

$
0
0
You have a very common problem with R running under IIS. If you add 'C:\Program Files\R\R-3.1.2\bin\i386' (or x64 if you are doing 64 bit) to your system path and restart Visual Studio or IIS then the RODBC package will load correctly. This is only for running under IIS and has to do with the DLL search paths under IIS while trying to find R's subordinate DLLs.

Commented Unassigned: C# App crashes while getting row from dataframe [150]

$
0
0
Hi,
Can anyone help me on this.
I am facing this weird issue, when I try to fetch some rows(row by row) from my dataset(dataframe in R). First few rows are fetched without any error but after say 4-5 rows I get some exception on a line which executed perfectly for first few rows.
I am executing following statement:

SomeRDotNetObject.Evaluate("Dataset1[rowindex , ]" ); // Dataset1 is the name of the dataset

for say rowindex= 1 to 4 this works but fails on rowindex=5. And C# application crashes with following exception:-

_System.Windows.Threading.DispatcherUnhandledExceptionEventHandler -METHOD :Invoke() -LINE :0
System.InvalidOperationException: Dispatcher processing has been suspended, but messages are still being processed.
at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)_


Thanks
adabral
Comments: Loading data to a grid dynamically is a common use case (think of loading data from a large SQL table or a large file). This is commonly done by implementing IBindingList. When you implement IBindingList, you have to write functions for some of the methods namely object IList.this[int index] , which fetches the next row from R dynamically. This is where things break down when we are fetching the next row of the dataset in R. Infact it crashes very quickly. Within the first 10 rows that are fetched into the virtual grid. This happens when using the .net Grid class, I reviewed that code sample in the thread submitted by adabral and that is pretty complex. The problem can be created simply setting the itemsource of a grid to a class that implements iBindinglist and fetch the row from R in the IList.this[int index] method.In this thread there is a mention that this could be occurring as R is writing to the console device, I have created a sample where I get the row using getsymbol instead of evaluating dataset{rowindex,], problem still occurs. The point I want to make is virtual grids and just in time loading are pretty popular in C# apps. In fact, I was hoping to move from statconn (www.statconn.com) to R dot net this weekend, this is the only issue that is preventing me from moving to R dot net. Everything else works like a charm. I was using the DCOM version of statconn and can send you some code to demonstrate that statconn works. Could this mean that this is not an R problem? I have not tried statconn.net yet. But would prefer to work with r dot net because of the licensing. Hoping you can address this. I tried a separate Rengine for fetching each row of the dataset, it did not work, infact it crashed at the same point. Also tried to reproduce with older version of R Dot Net, could not find the binaries. Can you point me to them? Feel that compatibility with iBindinglist should be a popular capability that many developers should be able to take advantage off. Also thread about Dispatcher.CurrentDispatcher.BeginInvoke. This makes sense if I am loading the entire dataset asynchronously. This is not what I am intending. I want users to scroll through the dataset on demand. In my application (with statconn dcom) this works fine. Datasets are sometimes 500MB-1GB. I have modified the code attached that demonstrates the problem quite clearly. The example now has following options: 1) First radio button will create data in C# and the will be assigned to the ItemSource property of the DataGrid. Obviously this case does not fail. There are no calls made to R.net. 2) Second radio button will fetch rows from R, using R.net and create a collection, which is finally assigned to the ItemSource property of the DataGrid. This also works but, is far from ideal, as we are moving entire dataset from R to C# and not loading data dyanamically from R. 3) Third radio button: Here we are loading data from R dynamically into C#.It will assign object of the MyData class that implements IBindingList and IEnumerator, and the DataGrid itself uses indexer from MyData, to fetch rows, dynamically. Here you will see the failure occur when fetching first 12 rows. 4) I created the fourth option, just to isolate, whether the problem occurs only with iterating dataset. So instead of making call like "Dataset1[index,]", I am evaluating a hard coded R command as c('111', '222', '333'). And the problem occurs here also. Basically,this option is same as the third one, except it does not fetch rows from Dataset1, instead it fetches c('111', '222', '333') from R, using R.net

Commented Unassigned: C# App crashes while getting row from dataframe [150]

$
0
0
Hi,
Can anyone help me on this.
I am facing this weird issue, when I try to fetch some rows(row by row) from my dataset(dataframe in R). First few rows are fetched without any error but after say 4-5 rows I get some exception on a line which executed perfectly for first few rows.
I am executing following statement:

SomeRDotNetObject.Evaluate("Dataset1[rowindex , ]" ); // Dataset1 is the name of the dataset

for say rowindex= 1 to 4 this works but fails on rowindex=5. And C# application crashes with following exception:-

_System.Windows.Threading.DispatcherUnhandledExceptionEventHandler -METHOD :Invoke() -LINE :0
System.InvalidOperationException: Dispatcher processing has been suspended, but messages are still being processed.
at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)_


Thanks
adabral
Comments: missed attachment.

Commented Unassigned: C# App crashes while getting row from dataframe [150]

$
0
0
Hi,
Can anyone help me on this.
I am facing this weird issue, when I try to fetch some rows(row by row) from my dataset(dataframe in R). First few rows are fetched without any error but after say 4-5 rows I get some exception on a line which executed perfectly for first few rows.
I am executing following statement:

SomeRDotNetObject.Evaluate("Dataset1[rowindex , ]" ); // Dataset1 is the name of the dataset

for say rowindex= 1 to 4 this works but fails on rowindex=5. And C# application crashes with following exception:-

_System.Windows.Threading.DispatcherUnhandledExceptionEventHandler -METHOD :Invoke() -LINE :0
System.InvalidOperationException: Dispatcher processing has been suspended, but messages are still being processed.
at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)_


Thanks
adabral
Comments: I don't see attachment in thread. Trying again

New Post: R.NET failing on library(RODBC) call (and other external libraries)

$
0
0
skyguy94 you are a LEGEND!!!
That did it.

Thanks so much - much appreciated!
N

Commented Unassigned: C# App crashes while getting row from dataframe [150]

$
0
0
Hi,
Can anyone help me on this.
I am facing this weird issue, when I try to fetch some rows(row by row) from my dataset(dataframe in R). First few rows are fetched without any error but after say 4-5 rows I get some exception on a line which executed perfectly for first few rows.
I am executing following statement:

SomeRDotNetObject.Evaluate("Dataset1[rowindex , ]" ); // Dataset1 is the name of the dataset

for say rowindex= 1 to 4 this works but fails on rowindex=5. And C# application crashes with following exception:-

_System.Windows.Threading.DispatcherUnhandledExceptionEventHandler -METHOD :Invoke() -LINE :0
System.InvalidOperationException: Dispatcher processing has been suspended, but messages are still being processed.
at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)_


Thanks
adabral
Comments: I'm not certain why you would be using an IBindingList with WPF or even a BindingList<T> if you were trying to make it somewhat less hard on yourself and I think using ICollectionView or IPagedCollectionView is probably the strongest choice for having experience with xaml that has crossover appeal to win phone, window store apps, and even silverlight. That being said, I haven't written a WPF app since 2011 (silverlight, win phone, app store, sure, but not WPF), so take that advice with the appropriate grain of salt. Since we can't control how R works, and you've decided not to decouple things through MVVM, we have to ensure that the index lookups happen at a point when

Commented Unassigned: C# App crashes while getting row from dataframe [150]

$
0
0
Hi,
Can anyone help me on this.
I am facing this weird issue, when I try to fetch some rows(row by row) from my dataset(dataframe in R). First few rows are fetched without any error but after say 4-5 rows I get some exception on a line which executed perfectly for first few rows.
I am executing following statement:

SomeRDotNetObject.Evaluate("Dataset1[rowindex , ]" ); // Dataset1 is the name of the dataset

for say rowindex= 1 to 4 this works but fails on rowindex=5. And C# application crashes with following exception:-

_System.Windows.Threading.DispatcherUnhandledExceptionEventHandler -METHOD :Invoke() -LINE :0
System.InvalidOperationException: Dispatcher processing has been suspended, but messages are still being processed.
at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)_


Thanks
adabral
Comments: the dispatcher thread is running and then fire off a property changed event so the databinding engine can refresh based off the new item. I don't think any of that precludes you from implementing a paging scheme in the background so that your requests from R are larger than just a single item. FWIW, here's some untested example code for fetching per item in the vein of what was suggested for the OP of this issue, but adjusted for your restrictions. public class MyData : BindingList<Customer> { private readonly REngine _rServer; public MyData(REngine rserver) { if (rserver == null) throw new ArgumentNullException("rserver"); _rServer = rserver; } public new Customer this[int index] { get { if (index >= Count) { Dispatcher.CurrentDispatcher.BeginInvoke((Action)(() => { var command = string.Format("rowd <- Dataset1[{0},]", index + 1); _rServer.Evaluate(command); var sexp = _rServer.GetSymbol("rowd"); var rowdata = sexp.AsCharacter().ToArray(); var customer = new Customer(rowdata[0], rowdata[1]); SetItem(index, customer); })); return new Customer("temp", "temp"); } return base[index]; } set {} } }

Reviewed: R.NET 1.5.16 (NuGet) (Dec 04, 2014)

$
0
0
Rated 5 Stars (out of 5) - I found this project being a very experienced C# developer, but a total newbie in terms of R. I have found it very easy to tie together my C# code with existing R code. Very nice job!

Released: R.NET 1.5.19 (NuGet) (Dec 05, 2014)

$
0
0
R.NET 1.5.19 is a beta release towards R.NET 1.6. You are encouraged to use it now and give feedback.

This update is only available via nuget.org at R.NET Community and R.NET FSharp Utility. You are strongly encouraged to use nuget to manage the dependency of your work on R.NET.

See the documentation for setup and usage instructions.

Main changes:
Bug fixes; stack imbalance possible in some circumetances. Refactor to make a separate library for P/Invoke capabilities. Refactor to increase the role of R.NET for the packagerClr under development. Include improvements and fixes from contributors, notably change the behavior so that R_HOME takes precedence over

Created Release: R.NET 1.5.19 (NuGet) (Dec 05, 2014)

$
0
0
R.NET 1.5.19 is a beta release towards R.NET 1.6. You are encouraged to use it now and give feedback.

This update is only available via nuget.org at R.NET Community and R.NET FSharp Utility. You are strongly encouraged to use nuget to manage the dependency of your work on R.NET.

See the documentation for setup and usage instructions.

Main changes:
Bug fixes; stack imbalance possible in some circumetances. Refactor to make a separate library for P/Invoke capabilities. Refactor to increase the role of R.NET for the package rClr under development. Include improvements and fixes from contributors, notably change the behavior so that R_HOME takes precedence over

Created Unassigned: Parameters in graphics do not apply [151]

$
0
0
Hi all,

When I try to plot an image with parameters such as main="..." or xlab="..." none of the set values show up in the image later on. The call is nested and looks in the end like: Engine.Evaluate("plot(hist(dataGroup, main=\"Title\" xlab=\"x-axis title\" ))"); I'm using a device in order to write an image of the chart to disk.
Maybe an error, or only something wrong in my call?
Best regards,

P_u_S

Commented Unassigned: Parameters in graphics do not apply [151]

$
0
0
Hi all,

When I try to plot an image with parameters such as main="..." or xlab="..." none of the set values show up in the image later on. The call is nested and looks in the end like: Engine.Evaluate("plot(hist(dataGroup, main=\"Title\" xlab=\"x-axis title\" ))"); I'm using a device in order to write an image of the chart to disk.
Maybe an error, or only something wrong in my call?
Best regards,

P_u_S
Comments: You'll need to give some more details as I can get your example to work for me. Here's the output of my R.Net application showing the titles and labels. I did have to add a comma between the main and xlab arguments. I assume that was a local typo. ![Test Output](http://skyguy94.github.io/test.png)

New Post: R.NET does not initialize at server

$
0
0
Hi R.NET expects,

I have a problem with R in my C# .NET web application project. R.NET works perfectly in my test machine, but when I move my application to server, R is not loading libraries or more likely just not initializing.

Server OS: Windows Server 2008 R2
R version: R-3.1.2
R.NET version: 1.5.16
framework: .NET Framework 4.5
web server: IIS7
test machine OS: Windows 7
Visual Studio 2012

I configure my web application for any CPU (32bit or 64bit). I added "C:\Program Files\R\R-3.1.2\bin\x64;C:\Program Files\R\R-3.1.2\bin\i386" to system variable PATH, as suggested in other posts.

Here is my Global.asax file, where I want the R.NET to be initialized.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.SessionState;
using RDotNet;
using RDotNet.NativeLibrary;

namespace WebSite
{
    public class Global : System.Web.HttpApplication
    {
        public static REngine engine;

        protected void Application_Start(object sender, EventArgs e)
        {
            // Code that runs on application startup

            // set up enviromental path for R.dll      
            REngine.SetEnvironmentVariables();

            engine = REngine.GetInstance();

            // Initializes settings
            engine.Initialize();

            engine.Evaluate("library(Cairo);");
        }

        protected void Session_Start(object sender, EventArgs e)
        {
        }

        protected void Application_BeginRequest(object sender, EventArgs e)
        {
        }

        protected void Application_AuthenticateRequest(object sender, EventArgs e)
        {
        }

        protected void Application_Error(object sender, EventArgs e)
        {
        }

        protected void Session_End(object sender, EventArgs e)
        {
        }

        protected void Application_End(object sender, EventArgs e)
        {
            //  Code that runs on application shutdown
            engine.Close();
            engine.Dispose();
        }
    }
}
When I start my application in IIS my website gives error as: "Error in library(Cairo): there is no package names Cairo". But I installed the package and are able to call the library function from R studio in my server. When I restart my website in IIS, it just do not respond anymore.

Could anyone be so kind to tell me why?? It works perfectly for local test! Anything I miss to do? Many thanks!

New Post: R.NET can not get instance at server

$
0
0
It seems that debugging the process might be useful here. I can't really guess as to why it is hanging like that.

New Post: R.NET can not get instance at server

$
0
0
I debugged the R.NET code locally at my server under visual studio and it gives no error at all. R.NET works without any problem. As soon as I use IIS to publish my website, the problem occurs. I suspect it is because the group IIS_IUSER is missing some permissions to access the R folder, but I could not figure how to solve it. Give the IIS_IUSER group read/load permissions on the R folder tree did not work.
Viewing all 1634 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>