Serving the Quantitative Finance Community

 
User avatar
manikm
Topic Author
Posts: 0
Joined: September 23rd, 2008, 12:19 pm

Releasing xll made using c# vs 2008

June 24th, 2010, 7:24 am

Hi AllI am having problems releasing excel addins made using c# and VS 2008.It works fine on my computer, but when given to a colleague to test it, the excel crashes.Can someone who has used XLW please tell me how to release an XLL built using C# and visual studio?Many thanksManik
 
User avatar
Hansi
Posts: 41
Joined: January 25th, 2010, 11:47 am

Releasing xll made using c# vs 2008

June 24th, 2010, 7:27 am

What version of .net is installed on your machine? What about theirs? Also which version of Windows and Excel? What libraries are you linking to in the XLL?
 
User avatar
manikm
Topic Author
Posts: 0
Joined: September 23rd, 2008, 12:19 pm

Releasing xll made using c# vs 2008

June 24th, 2010, 7:42 am

No Libraries.Depends.Exe lists MSVCR90 as dependency, I dont know whether it is there on the target machine.Dot net 3.0 .Target machine is Windows vista, Which has dot Net 3.0 by default I presume. Ps: I am using Alglib C#, but not as a library, it is used as source.
Last edited by manikm on June 23rd, 2010, 10:00 pm, edited 1 time in total.
 
User avatar
Hansi
Posts: 41
Joined: January 25th, 2010, 11:47 am

Releasing xll made using c# vs 2008

June 24th, 2010, 7:56 am

Vista should come with .NET 3.0 but not 3.0sp1 IIRC but I doubt that is the issue if you aren't using any .net libraries. Did you write your function with exception handling? Does Excel crash on install, launch or execution of the addin?
 
User avatar
manikm
Topic Author
Posts: 0
Joined: September 23rd, 2008, 12:19 pm

Releasing xll made using c# vs 2008

June 24th, 2010, 7:58 am

No exception handling used.It does crash on calling a function from the addin
 
User avatar
Hansi
Posts: 41
Joined: January 25th, 2010, 11:47 am

Releasing xll made using c# vs 2008

June 24th, 2010, 8:00 am

Maybe if you try quickly adding exception handling and re-throwing the error as generic output it might give an idea to what is causing the issue?
 
User avatar
manikm
Topic Author
Posts: 0
Joined: September 23rd, 2008, 12:19 pm

Releasing xll made using c# vs 2008

June 24th, 2010, 8:33 am

ok,here is what i did.I wrote a try catch block in helloworld() function CSharpFunctions.cs file, this file in with the example in XLW.Then threw the caught exception.Built it in release mode and tested it on the other machine.Apparently it never reaches the function execution stage as Excel simply crashes and does not report any exception.Regards,Manik
 
User avatar
AlexesDad
Posts: 11
Joined: May 29th, 2009, 4:10 pm

Releasing xll made using c# vs 2008

June 25th, 2010, 8:57 am

When building a C# XLL with XLW, there are some other DLL's that are also built and are placed in the same output directory as the XLL. You need to distribute these too. So you need to deliver to your friend the XLL and all the DLLs in the same directory. This is because the C# code you have compiled actualy lives in one of the DLL's, an assembley. The XLL is a C/C++ middleman which will call the C# functions you have written from the DLL. The crash occurs because it cannot find the C# function. Indeed a better error handling would be more appropriate.A's D