dbTalk Databases Forums  

USE LIBRARY and .net libraries

microsoft.public.sqlserver.olap microsoft.public.sqlserver.olap


Discuss USE LIBRARY and .net libraries in the microsoft.public.sqlserver.olap forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Kasper Birch Olsen
 
Posts: n/a

Default USE LIBRARY and .net libraries - 07-26-2005 , 08:42 AM






Hi NG

im trying to write a dll file to be used with an action. Say i want this C#
function to be exposed to mdx (really complicated business logic here...):

public int Add(int x, int y)
{
return (x+y);
}

Had this been an old fashion dll, written in VB6, i could register it with
regsvr32.exe and then use it straight away. But how do i do the same thing
with .net libraries? Ive tried to register with regasm.exe, after compiling
to a dll library, but no luck. While the registration works fine, the mdx
builder returns "unable to add library reference c:\libtest\test.dll. The
file contains no libraries"

what am i dooing wrong here?

btw this might be the wrong forum, but i thought that someone else might
have tried the same with analysis services and thus might have found a
solution

-Kasper



Reply With Quote
  #2  
Old   
Dave Wickert [MSFT]
 
Posts: n/a

Default Re: USE LIBRARY and .net libraries - 07-26-2005 , 11:43 AM






You are not doing anything wrong.
This is a known problem with .NET being called as a UDF. Until Yukon your
UDFs need to be written in Visual Studio 6 with native COM. We cannot use
COM interop directly from AS. This is being addressed in SQL Server 2005
where we support .NET everywhere.

A solution which has been proposed (but I haven't personally validated) is
to write a VB6 wrapper. Have AS call out to VB6 -- which then uses COM
interop to the real UDF. I don't know if that will work, but you might give
it a try. If you try this, please drop me a line. I'd love to see it works.
--
Dave Wickert [MSFT]
dwickert (AT) online (DOT) microsoft.com
Program Manager
BI SystemsTeam
SQL BI Product Unit (Analysis Services)
--
This posting is provided "AS IS" with no warranties, and confers no rights.


"Kasper Birch Olsen" <kasper (AT) nospam (DOT) com> wrote

Quote:
Hi NG

im trying to write a dll file to be used with an action. Say i want this
C# function to be exposed to mdx (really complicated business logic
here...):

public int Add(int x, int y)
{
return (x+y);
}

Had this been an old fashion dll, written in VB6, i could register it with
regsvr32.exe and then use it straight away. But how do i do the same thing
with .net libraries? Ive tried to register with regasm.exe, after
compiling to a dll library, but no luck. While the registration works
fine, the mdx builder returns "unable to add library reference
c:\libtest\test.dll. The file contains no libraries"

what am i dooing wrong here?

btw this might be the wrong forum, but i thought that someone else might
have tried the same with analysis services and thus might have found a
solution

-Kasper




Reply With Quote
  #3  
Old   
Kasper Birch Olsen
 
Posts: n/a

Default Re: USE LIBRARY and .net libraries - 07-28-2005 , 05:07 AM



thx for the quick reply.

I found myself an old version of vb6 and wrote the functions i needed. Ill
prolly be looking into wrappers some time soon, ill pop you a mail if I can
make it work

- Kasper

"Dave Wickert [MSFT]" <dwickert (AT) online (DOT) microsoft.com> wrote

Quote:
You are not doing anything wrong.
This is a known problem with .NET being called as a UDF. Until Yukon your
UDFs need to be written in Visual Studio 6 with native COM. We cannot use
COM interop directly from AS. This is being addressed in SQL Server 2005
where we support .NET everywhere.

A solution which has been proposed (but I haven't personally validated) is
to write a VB6 wrapper. Have AS call out to VB6 -- which then uses COM
interop to the real UDF. I don't know if that will work, but you might
give it a try. If you try this, please drop me a line. I'd love to see it
works.
--
Dave Wickert [MSFT]
dwickert (AT) online (DOT) microsoft.com
Program Manager
BI SystemsTeam
SQL BI Product Unit (Analysis Services)
--
This posting is provided "AS IS" with no warranties, and confers no
rights.


"Kasper Birch Olsen" <kasper (AT) nospam (DOT) com> wrote in message
news:uEuSzdekFHA.3580 (AT) TK2MSFTNGP09 (DOT) phx.gbl...
Hi NG

im trying to write a dll file to be used with an action. Say i want this
C# function to be exposed to mdx (really complicated business logic
here...):

public int Add(int x, int y)
{
return (x+y);
}

Had this been an old fashion dll, written in VB6, i could register it
with regsvr32.exe and then use it straight away. But how do i do the same
thing with .net libraries? Ive tried to register with regasm.exe, after
compiling to a dll library, but no luck. While the registration works
fine, the mdx builder returns "unable to add library reference
c:\libtest\test.dll. The file contains no libraries"

what am i dooing wrong here?

btw this might be the wrong forum, but i thought that someone else might
have tried the same with analysis services and thus might have found a
solution

-Kasper






Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.