<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://weblogs.asp.net/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Consume a .NET Assembly from a classic ASP page.</title><link>http://weblogs.asp.net/dneimke/archive/2004/01/31/65330.aspx</link><description>Whenever I think that I'm getting to the bottom of .NET, there's, well: there's always something to remind me... http://users.cis.net/sammy/remindme.htm ( open in new window while you continue reading for the full effect ) I haven't really done a lot</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP1 (Build: 20510.895)</generator><item><title>re: Consume a .NET Assembly from a classic ASP page.</title><link>http://weblogs.asp.net/dneimke/archive/2004/01/31/65330.aspx#6936408</link><pubDate>Tue, 03 Mar 2009 17:14:09 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:6936408</guid><dc:creator>John Burns</dc:creator><author>John Burns</author><description>&lt;p&gt;To make it work:&lt;/p&gt;
&lt;p&gt;Solution properties &amp;gt; Compile and tick &amp;quot;Register for COM interop&amp;quot;&lt;/p&gt;
&lt;p&gt;Solution Properties &amp;gt; Assembly information &amp;gt; tick &amp;quot;Make assembly COM-visible&amp;quot;&lt;/p&gt;
&lt;p&gt;Ad make sure your code is importing:&lt;/p&gt;
&lt;p&gt;Imports System&lt;/p&gt;
&lt;p&gt;Imports System.Runtime.InteropServices&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6936408" width="1" height="1"&gt;</description></item><item><title>re: Consume a .NET Assembly from a classic ASP page.</title><link>http://weblogs.asp.net/dneimke/archive/2004/01/31/65330.aspx#6753870</link><pubDate>Tue, 25 Nov 2008 19:00:56 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:6753870</guid><dc:creator>Paulo</dc:creator><author>Paulo</author><description>&lt;p&gt;i get the same problem: &lt;/p&gt;
&lt;p&gt;Error Type:&lt;/p&gt;
&lt;p&gt;Server object, ASP 0177 (0x800401F3)&lt;/p&gt;
&lt;p&gt;Invalid class string &lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6753870" width="1" height="1"&gt;</description></item><item><title>re: Consume a .NET Assembly from a classic ASP page.</title><link>http://weblogs.asp.net/dneimke/archive/2004/01/31/65330.aspx#6697792</link><pubDate>Wed, 22 Oct 2008 12:48:17 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:6697792</guid><dc:creator>Jai Gupta</dc:creator><author>Jai Gupta</author><description>&lt;p&gt;i had a J++ dll converted to j# com dll (vs2005) &amp;nbsp;and want to consume it in ASP. But after creating the dll successfully which is working with VB etc. is not &amp;nbsp;found to be compatible with the ASP. &lt;/p&gt;
&lt;p&gt;1. At application level unable to set the application variable with j# com dll object. Though at session level it is possible to do so.&lt;/p&gt;
&lt;p&gt;2. The overloaded methodds of j# com &amp;nbsp;dll are not callable from ASP as they raise a error saying &amp;quot;Wrong/ invalid argument list&amp;quot;&lt;/p&gt;
&lt;p&gt;3. The properties of a class are not accessible from the ASP &lt;/p&gt;
&lt;p&gt;e.g &lt;/p&gt;
&lt;p&gt;Dim i, o&lt;/p&gt;
&lt;p&gt;Set o = CreateObject(&amp;quot;MydllClass&amp;quot;)&lt;/p&gt;
&lt;p&gt;i = o.getId()&lt;/p&gt;
&lt;p&gt;Error: Variable uses an Automation type not supported in VBScript&lt;/p&gt;
&lt;p&gt;please help.&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6697792" width="1" height="1"&gt;</description></item><item><title>re: Consume a .NET Assembly from a classic ASP page.</title><link>http://weblogs.asp.net/dneimke/archive/2004/01/31/65330.aspx#6248320</link><pubDate>Wed, 04 Jun 2008 20:51:12 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:6248320</guid><dc:creator>Deepa</dc:creator><author>Deepa</author><description>&lt;p&gt;I have written .NET2.0 DLL and i am not able to use the same in an ASP page&lt;/p&gt;
&lt;p&gt;I have set the assembly to Register for COM Interop.&lt;/p&gt;
&lt;p&gt;Used regasm /codebase to register the assmebly.&lt;/p&gt;
&lt;p&gt;Loaded the assembly in the GAc&lt;/p&gt;
&lt;p&gt;I am able to create the object and set its properties , but when i call any of the methods&lt;/p&gt;
&lt;p&gt;i get the following error:&lt;/p&gt;
&lt;p&gt;Error Type:&lt;/p&gt;
&lt;p&gt;(0x80004003)&lt;/p&gt;
&lt;p&gt;Object reference not set to an instance of an object.&lt;/p&gt;
&lt;p&gt;But when i try the same for a VBScript , the component works fine without errors.&lt;/p&gt;
&lt;p&gt;Any help will be appreciated&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6248320" width="1" height="1"&gt;</description></item><item><title>how to register net assembly</title><link>http://weblogs.asp.net/dneimke/archive/2004/01/31/65330.aspx#6245080</link><pubDate>Tue, 03 Jun 2008 14:47:28 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:6245080</guid><dc:creator>how to register net assembly</dc:creator><author>how to register net assembly</author><description>&lt;p&gt;Pingback from &amp;nbsp;how to register net assembly&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6245080" width="1" height="1"&gt;</description></item><item><title>re: Consume a .NET Assembly from a classic ASP page.</title><link>http://weblogs.asp.net/dneimke/archive/2004/01/31/65330.aspx#6192341</link><pubDate>Thu, 15 May 2008 13:09:24 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:6192341</guid><dc:creator>Ray</dc:creator><author>Ray</author><description>&lt;p&gt;Answer to Eric's question:&lt;/p&gt;
&lt;p&gt;I had the same problem, my public method was not visible to the ASP page and intellisense would not display the method.&lt;/p&gt;
&lt;p&gt;Try designing your application with an explicit public interface &amp;nbsp;that exposes public method(s) and create a class that implements the interface.&lt;/p&gt;
&lt;p&gt;Assign the following attribute on the COM Interface code:&lt;/p&gt;
&lt;p&gt; [Guid(&amp;quot;&amp;lt;GUID from Create GUID tool&amp;gt;&amp;quot;)]&lt;/p&gt;
&lt;p&gt; &amp;nbsp;[InterfaceType(ComInterfaceType.InterfaceIsDual)] &lt;/p&gt;
&lt;p&gt;This will create both early and late bound interfaces.&lt;/p&gt;
&lt;p&gt;The following code snipnet shows a simple class that displays the traditional &amp;quot;Hello World&amp;quot; as a .Net component with a COM interface.&lt;/p&gt;
&lt;p&gt;using System;&lt;/p&gt;
&lt;p&gt;using System.Runtime.InteropServices;&lt;/p&gt;
&lt;p&gt;namespace HelloCOM&lt;/p&gt;
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;[Guid(&amp;quot;DBE0E8C4-1C61-41f3-B6A4-4E2F353D3D05&amp;quot;)] &amp;nbsp; &amp;nbsp; &amp;nbsp;// Unique identifier required from 'Create GUID' tool&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;[InterfaceType(ComInterfaceType.InterfaceIsDual)] &amp;nbsp; // Dual interface provides both early and late binding&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;public interface IHelloCOM&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;string PrintGreeting(string userName);&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;[ComVisible(true)] &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;// Properties and methods of this class will be visible to COM&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;[Guid(&amp;quot;C6659361-1625-4746-931C-36014B146679&amp;quot;)] &amp;nbsp; &amp;nbsp; &amp;nbsp;// Unique identifier required from 'Create GUID' tool&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;[ProgId(&amp;quot;HelloCOM.HelloCOMImplementation&amp;quot;)] &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // Name used when invoking this component [e.g. CreateObject(&amp;quot;HelloCOM.HelloCOMImplementation&amp;quot;)]&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;[ClassInterface(ClassInterfaceType.None)] &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // 'ClassInterfaceType.None' is only way to expose functionality through interfaces implemented explicitly by the class&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;[ComSourceInterfaces(typeof(IHelloCOM))] &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;// Identifies the interface that will be exposed as COM event sources for the attributed class&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;public class HelloCOMImplementation : IHelloCOM&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;public HelloCOMImplementation() &amp;nbsp;{ &amp;nbsp;} &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // Default albeit empty constructor that is required for COM instantiation&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;string IHelloCOM.PrintGreeting(string userName) // Implementation of the PrintGreeting() method defined in the interface&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;string greeting = string.Empty;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;greeting = &amp;quot;Hello COM world from &amp;quot; + userName;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;return greeting;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;Hope this helps.&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6192341" width="1" height="1"&gt;</description></item><item><title>re: Consume a .NET Assembly from a classic ASP page.</title><link>http://weblogs.asp.net/dneimke/archive/2004/01/31/65330.aspx#6130028</link><pubDate>Fri, 25 Apr 2008 13:41:54 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:6130028</guid><dc:creator>Sri</dc:creator><author>Sri</author><description>&lt;p&gt;Jay&lt;/p&gt;
&lt;p&gt;I have managed find a way around the problem you have, I have used an array list in the example but u should be able to do the same with an Array &lt;/p&gt;
&lt;p&gt;example is here &lt;a rel="nofollow" target="_new" href="http://tsqldotnet.spaces.live.com"&gt;tsqldotnet.spaces.live.com&lt;/a&gt;&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6130028" width="1" height="1"&gt;</description></item><item><title>re: Consume a .NET Assembly from a classic ASP page.</title><link>http://weblogs.asp.net/dneimke/archive/2004/01/31/65330.aspx#6103198</link><pubDate>Wed, 16 Apr 2008 09:38:58 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:6103198</guid><dc:creator>LRN</dc:creator><author>LRN</author><description>&lt;p&gt;Great Article! very useful.I have problem &amp;nbsp;.NET assembly (Assembly1) &amp;nbsp;references .NET assembly (Assembly2) both i have registered as COM. &lt;/p&gt;
&lt;p&gt;I creted new method A() in Class1 in Assesmbly1 which calls method B() from Class2 in Assesmbly2.&lt;/p&gt;
&lt;p&gt;when i call method A() in asp i get &amp;quot;Invalid string error&amp;quot;&lt;/p&gt;
&lt;p&gt;Does anyone know what the issue is? Can we have refernces to the .NET dll? Is there any other way to acheive this?&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6103198" width="1" height="1"&gt;</description></item><item><title>re: Consume a .NET Assembly from a classic ASP page.</title><link>http://weblogs.asp.net/dneimke/archive/2004/01/31/65330.aspx#6085278</link><pubDate>Fri, 11 Apr 2008 03:02:41 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:6085278</guid><dc:creator>Jay</dc:creator><author>Jay</author><description>&lt;p&gt;I have a problem returning an array from the .net dll to an asp page. Does any one have the same issue? &lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6085278" width="1" height="1"&gt;</description></item><item><title>re: Consume a .NET Assembly from a classic ASP page.</title><link>http://weblogs.asp.net/dneimke/archive/2004/01/31/65330.aspx#6085277</link><pubDate>Fri, 11 Apr 2008 03:02:41 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:6085277</guid><dc:creator>Jay</dc:creator><author>Jay</author><description>&lt;p&gt;I have a problem returning an array from the .net dll to an asp page. Does any one have the same issue? &lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6085277" width="1" height="1"&gt;</description></item></channel></rss>