<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments on: Creating COM Components using Visual C#.NET</title>
	<atom:link href="http://blog.stevedoria.net/20051008/creating-com-components-using-visual-csharp-dot-net/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.stevedoria.net/20051008/creating-com-components-using-visual-csharp-dot-net</link>
	<description>Real-World Computing Experience Distilled</description>
	<pubDate>Tue, 06 Jan 2009 09:23:40 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.2</generator>
		<item>
		<title>By: taKing</title>
		<link>http://blog.stevedoria.net/20051008/creating-com-components-using-visual-csharp-dot-net#comment-7316</link>
		<dc:creator>taKing</dc:creator>
		<pubDate>Thu, 09 Oct 2008 22:40:33 +0000</pubDate>
		<guid isPermaLink="false">http://blog.stevedoria.net/?p=27#comment-7316</guid>
		<description>This was really helpful.  Reading everything I could find on the subject in MSDN twisted my brain into odd shapes.  Walking through this helped to define a path for further exploration.  Thanks!

I did have difficulty using the object with Javascript in an HTML page.  I'd get the error "Automation server can't create object".  The VBscript ran fine, though.  Turned out, needed to change a setting in Internet Explorer (7) - Tools, Internet Options, Security, Custom Level.  Under the ActiveX Controls and plug-ins section, once I changed "Initialize and script ActiveX controls not marked as safe for scripting"  to Enable, it worked.  Probably not such a nifty setting to keep, though.</description>
		<content:encoded><![CDATA[<p>This was really helpful.  Reading everything I could find on the subject in MSDN twisted my brain into odd shapes.  Walking through this helped to define a path for further exploration.  Thanks!</p>
<p>I did have difficulty using the object with Javascript in an HTML page.  I&#8217;d get the error &#8220;Automation server can&#8217;t create object&#8221;.  The VBscript ran fine, though.  Turned out, needed to change a setting in Internet Explorer (7) - Tools, Internet Options, Security, Custom Level.  Under the ActiveX Controls and plug-ins section, once I changed &#8220;Initialize and script ActiveX controls not marked as safe for scripting&#8221;  to Enable, it worked.  Probably not such a nifty setting to keep, though.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Vid</title>
		<link>http://blog.stevedoria.net/20051008/creating-com-components-using-visual-csharp-dot-net#comment-7282</link>
		<dc:creator>Vid</dc:creator>
		<pubDate>Fri, 01 Aug 2008 10:36:58 +0000</pubDate>
		<guid isPermaLink="false">http://blog.stevedoria.net/?p=27#comment-7282</guid>
		<description>I followed exactly the same steps u have given.</description>
		<content:encoded><![CDATA[<p>I followed exactly the same steps u have given.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Vid</title>
		<link>http://blog.stevedoria.net/20051008/creating-com-components-using-visual-csharp-dot-net#comment-7281</link>
		<dc:creator>Vid</dc:creator>
		<pubDate>Fri, 01 Aug 2008 10:36:13 +0000</pubDate>
		<guid isPermaLink="false">http://blog.stevedoria.net/?p=27#comment-7281</guid>
		<description>Hi..i am getting an error "Activex cannot create Com object" when i run the vbscript file.Can u please help me..</description>
		<content:encoded><![CDATA[<p>Hi..i am getting an error &#8220;Activex cannot create Com object&#8221; when i run the vbscript file.Can u please help me..</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: DotNet</title>
		<link>http://blog.stevedoria.net/20051008/creating-com-components-using-visual-csharp-dot-net#comment-7277</link>
		<dc:creator>DotNet</dc:creator>
		<pubDate>Thu, 10 Jul 2008 08:34:12 +0000</pubDate>
		<guid isPermaLink="false">http://blog.stevedoria.net/?p=27#comment-7277</guid>
		<description>well done to both the author and Scriptor.  But I need to point out that in Scriptor's step list, instead of copying the GUID from AssemblyInfo.cs, we should use guidgen.exe to generate a new GUID as described in the step7 in the author's list.  Otherwise, you get the following error when execute regasm /tlb:COMTest.tlb in the CP:

RegAsm : error RA0000 : Type library exporter encountered an error while processing 'COMTest.COMobj, COMTest'. Error: Element not found.</description>
		<content:encoded><![CDATA[<p>well done to both the author and Scriptor.  But I need to point out that in Scriptor&#8217;s step list, instead of copying the GUID from AssemblyInfo.cs, we should use guidgen.exe to generate a new GUID as described in the step7 in the author&#8217;s list.  Otherwise, you get the following error when execute regasm /tlb:COMTest.tlb in the CP:</p>
<p>RegAsm : error RA0000 : Type library exporter encountered an error while processing &#8216;COMTest.COMobj, COMTest&#8217;. Error: Element not found.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Scriptor</title>
		<link>http://blog.stevedoria.net/20051008/creating-com-components-using-visual-csharp-dot-net#comment-7269</link>
		<dc:creator>Scriptor</dc:creator>
		<pubDate>Thu, 19 Jun 2008 18:19:56 +0000</pubDate>
		<guid isPermaLink="false">http://blog.stevedoria.net/?p=27#comment-7269</guid>
		<description>Ok, I figured it out. With my version of visual studio 2005, 
1.) Create a new Project Class Library
2.) Create a key pair 
3.) A Properties folder with an AssemblyInfo.cs file was created right click on the folder and open properties. The default should be 'Class Library'
4.) Goto the signing tab and check Sign the assembly, browse and point it to the 'key.snk' file.
5.) open the AssemblyInfo.cs , add [assembly: AssemblyKeyFileAttribute(@"..\..\key.snk")]
6.) in the AssemblyInfo.cs set [assembly: ComVisible(true)], now copy the assembly GUID that was auto created with the file.
7.) put [System.Runtime.InteropServices.GuidAttribute("paste guid here")] in your main class file in between the Namespace and Class.

..continue with step 10 above...

When building and regasm you get warnings but it works perfect in classic ASP VB Script.</description>
		<content:encoded><![CDATA[<p>Ok, I figured it out. With my version of visual studio 2005,<br />
1.) Create a new Project Class Library<br />
2.) Create a key pair<br />
3.) A Properties folder with an AssemblyInfo.cs file was created right click on the folder and open properties. The default should be &#8216;Class Library&#8217;<br />
4.) Goto the signing tab and check Sign the assembly, browse and point it to the &#8216;key.snk&#8217; file.<br />
5.) open the AssemblyInfo.cs , add [assembly: AssemblyKeyFileAttribute(@"..\..\key.snk")]<br />
6.) in the AssemblyInfo.cs set [assembly: ComVisible(true)], now copy the assembly GUID that was auto created with the file.<br />
7.) put [System.Runtime.InteropServices.GuidAttribute("paste guid here")] in your main class file in between the Namespace and Class.</p>
<p>..continue with step 10 above&#8230;</p>
<p>When building and regasm you get warnings but it works perfect in classic ASP VB Script.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Scriptor</title>
		<link>http://blog.stevedoria.net/20051008/creating-com-components-using-visual-csharp-dot-net#comment-7268</link>
		<dc:creator>Scriptor</dc:creator>
		<pubDate>Thu, 19 Jun 2008 17:27:05 +0000</pubDate>
		<guid isPermaLink="false">http://blog.stevedoria.net/?p=27#comment-7268</guid>
		<description>I did get it to work, but then I tried to make a change and rebuilt the dll and now I only get "Server object error 'ASP 0177 : 800401f3".  I am going through the steps again. This is the most comprehensive article I can find out there, great job...</description>
		<content:encoded><![CDATA[<p>I did get it to work, but then I tried to make a change and rebuilt the dll and now I only get &#8220;Server object error &#8216;ASP 0177 : 800401f3&#8243;.  I am going through the steps again. This is the most comprehensive article I can find out there, great job&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steve</title>
		<link>http://blog.stevedoria.net/20051008/creating-com-components-using-visual-csharp-dot-net#comment-7267</link>
		<dc:creator>Steve</dc:creator>
		<pubDate>Thu, 19 Jun 2008 03:07:18 +0000</pubDate>
		<guid isPermaLink="false">http://blog.stevedoria.net/?p=27#comment-7267</guid>
		<description>I believe I wrote this up on a previous version of Visual Studio .NET, but I hope you were able to accomplish what you needed. Thanks for the feedback.</description>
		<content:encoded><![CDATA[<p>I believe I wrote this up on a previous version of Visual Studio .NET, but I hope you were able to accomplish what you needed. Thanks for the feedback.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Scriptor</title>
		<link>http://blog.stevedoria.net/20051008/creating-com-components-using-visual-csharp-dot-net#comment-7266</link>
		<dc:creator>Scriptor</dc:creator>
		<pubDate>Wed, 18 Jun 2008 21:55:29 +0000</pubDate>
		<guid isPermaLink="false">http://blog.stevedoria.net/?p=27#comment-7266</guid>
		<description>I had a lot of problems getting this to work, because step 1.) says create and Empty project.  But you should choose Create a Class Library. 

Also step 6. is easier to handle when you have the properties folder in your project (via Create Class Library), right click to open and go to signing and set the key.snk there.

Also be sure that you are using the Visual Studio Command Prompt, not the regular Windows Command prompt, otherwise it won't recognize the build commands.</description>
		<content:encoded><![CDATA[<p>I had a lot of problems getting this to work, because step 1.) says create and Empty project.  But you should choose Create a Class Library. </p>
<p>Also step 6. is easier to handle when you have the properties folder in your project (via Create Class Library), right click to open and go to signing and set the key.snk there.</p>
<p>Also be sure that you are using the Visual Studio Command Prompt, not the regular Windows Command prompt, otherwise it won&#8217;t recognize the build commands.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Danny</title>
		<link>http://blog.stevedoria.net/20051008/creating-com-components-using-visual-csharp-dot-net#comment-7256</link>
		<dc:creator>Danny</dc:creator>
		<pubDate>Mon, 12 May 2008 05:46:49 +0000</pubDate>
		<guid isPermaLink="false">http://blog.stevedoria.net/?p=27#comment-7256</guid>
		<description>Hi Steve and mates, i am not sure if this is the roght place to put ina question... but kindly help me...
i have a situation, i have a classlibrary/dll created in c# .net, with few methods. I need to make this as a activex or a ocx to make it available as a natural COM component and not a .net assemby. So that i can use it in one of my delphi application. 
any idea would be highly appreciated and helpful...
also, is there any way to write c# code and compile it other than
using .net..
thanks and regards,
Danny</description>
		<content:encoded><![CDATA[<p>Hi Steve and mates, i am not sure if this is the roght place to put ina question&#8230; but kindly help me&#8230;<br />
i have a situation, i have a classlibrary/dll created in c# .net, with few methods. I need to make this as a activex or a ocx to make it available as a natural COM component and not a .net assemby. So that i can use it in one of my delphi application.<br />
any idea would be highly appreciated and helpful&#8230;<br />
also, is there any way to write c# code and compile it other than<br />
using .net..<br />
thanks and regards,<br />
Danny</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Stif</title>
		<link>http://blog.stevedoria.net/20051008/creating-com-components-using-visual-csharp-dot-net#comment-7251</link>
		<dc:creator>Stif</dc:creator>
		<pubDate>Tue, 29 Apr 2008 10:26:52 +0000</pubDate>
		<guid isPermaLink="false">http://blog.stevedoria.net/?p=27#comment-7251</guid>
		<description>Hi

I'm experiencing problems calling a third party dll from within my COM component. Short (as short as possible) scenario: I've made a Business and DataLayer using NHibernate and Castle.Windsor (both layers are NOT comvisible). To call these layers from a vbscript or ASP I've made a COM object wrapping the methods offered by the business layer (BL). First I experienced problems with configuration. The contructor for the main BL class instantiates a WindsorContainer (for Dependency injection) which looks in the configuration file for a custom configuration section. Because wscript.exe is the actual application calling the COM dll .NET started looking for Wscript.exe.config. I've managed to override this setting, with this line &lt;i&gt;AppDomain.CurrentDomain.SetData("APP_CONFIG_FILE", "ZebraZone.Toolset.Service.dll.config");&lt;/i&gt;. But now, when I try to create the third party objects (like the WindsorContainer) .NET cannot find the correct dll (though it resides in the same dir as the COM dll). Putting the third party dll in c:\WINDOWS\System32\ (same dir as wscript.exe) solves this problem. But that is not a workable solution. I want to tell .NET to go looking for referenced dll in a folder of my choice, how do I do that? I've already tried stuff like this: &lt;i&gt;AppDomain.CurrentDomain.SetData("APPBASE", "c:\\Visual Studio Projects\\ZebraZone\\COMTest\\COMTest\\bin\\Debug\\");&lt;/i&gt; or replacing APPBASE by RELPATH, PRIVATE_BINPATH, CACHE_BASE, DYNAMIC_BASE, SHADOW_COPY_DIRS. Nothing helps, I'm getting desperate...
Grtz
Stif</description>
		<content:encoded><![CDATA[<p>Hi</p>
<p>I&#8217;m experiencing problems calling a third party dll from within my COM component. Short (as short as possible) scenario: I&#8217;ve made a Business and DataLayer using NHibernate and Castle.Windsor (both layers are NOT comvisible). To call these layers from a vbscript or ASP I&#8217;ve made a COM object wrapping the methods offered by the business layer (BL). First I experienced problems with configuration. The contructor for the main BL class instantiates a WindsorContainer (for Dependency injection) which looks in the configuration file for a custom configuration section. Because wscript.exe is the actual application calling the COM dll .NET started looking for Wscript.exe.config. I&#8217;ve managed to override this setting, with this line <i>AppDomain.CurrentDomain.SetData(&#8221;APP_CONFIG_FILE&#8221;, &#8220;ZebraZone.Toolset.Service.dll.config&#8221;);</i>. But now, when I try to create the third party objects (like the WindsorContainer) .NET cannot find the correct dll (though it resides in the same dir as the COM dll). Putting the third party dll in c:\WINDOWS\System32\ (same dir as wscript.exe) solves this problem. But that is not a workable solution. I want to tell .NET to go looking for referenced dll in a folder of my choice, how do I do that? I&#8217;ve already tried stuff like this: <i>AppDomain.CurrentDomain.SetData(&#8221;APPBASE&#8221;, &#8220;c:\\Visual Studio Projects\\ZebraZone\\COMTest\\COMTest\\bin\\Debug\\&#8221;);</i> or replacing APPBASE by RELPATH, PRIVATE_BINPATH, CACHE_BASE, DYNAMIC_BASE, SHADOW_COPY_DIRS. Nothing helps, I&#8217;m getting desperate&#8230;<br />
Grtz<br />
Stif</p>
]]></content:encoded>
	</item>
</channel>
</rss>
