<?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>Make your .Net application support scripting - a practical approach</title><link>http://weblogs.asp.net/rosherove/pages/DotNetScripting.aspx</link><description>Summary Adding scripting support to your application is one of the most valuable things you can do for your client, letting them add value to your software, and keep it current over time with little or no overhead from the developers. Your users will</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP1 (Build: 20510.895)</generator><item><title>re: Make your .Net application support scripting - a practical approach</title><link>http://weblogs.asp.net/rosherove/pages/DotNetScripting.aspx#2005431</link><pubDate>Mon, 12 Mar 2007 11:11:57 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:2005431</guid><dc:creator>Alistair</dc:creator><author>Alistair</author><description>&lt;p&gt;This is definately an interesting article. However, since the article was first published, other alternatives have been introduced. A good (and surprisingly easy) example is hosting IronPython within your application.&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=2005431" width="1" height="1"&gt;</description></item><item><title>re: Make your .Net application support scripting - a practical approach</title><link>http://weblogs.asp.net/rosherove/pages/DotNetScripting.aspx#1953114</link><pubDate>Wed, 07 Mar 2007 23:31:03 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:1953114</guid><dc:creator>Tom Henrich</dc:creator><author>Tom Henrich</author><description>&lt;p&gt;Great article - this is just what I was looking for. Was having an issue with the AddObject until I added this &amp;lt;ComVisible(True)&amp;gt; works fine now....&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=1953114" width="1" height="1"&gt;</description></item><item><title>re: Make your .Net application support scripting - a practical approach</title><link>http://weblogs.asp.net/rosherove/pages/DotNetScripting.aspx#1833405</link><pubDate>Wed, 28 Feb 2007 11:01:38 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:1833405</guid><dc:creator>Davman</dc:creator><author>Davman</author><description>&lt;p&gt;To make this work in VB2005, change your class definitions:&lt;/p&gt;
&lt;p&gt;&amp;lt;ComVisible(True)&amp;gt; Public Class ClassNameToAddToScriptControl&lt;/p&gt;
&lt;p&gt;to enable .AddObject for a class.&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=1833405" width="1" height="1"&gt;</description></item><item><title>re: Make your .Net application support scripting - a practical approach</title><link>http://weblogs.asp.net/rosherove/pages/DotNetScripting.aspx#1368082</link><pubDate>Fri, 05 Jan 2007 21:46:13 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:1368082</guid><dc:creator>Zerox Millienium</dc:creator><author>Zerox Millienium</author><description>&lt;p&gt;If I create a text file with the script commands in it, how should I best load and execute the script in that file.&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=1368082" width="1" height="1"&gt;</description></item><item><title>re: Make your .Net application support scripting - a practical approach</title><link>http://weblogs.asp.net/rosherove/pages/DotNetScripting.aspx#734627</link><pubDate>Fri, 27 Oct 2006 02:18:36 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:734627</guid><dc:creator>Morgan</dc:creator><author>Morgan</author><description>I got this to work.

In C# I had created a simple class called ScriptableObject as a test.  By default, a new class is created without an access modifier, making it internal.

If you change it to public, you can then add it using the script.AddObject call.

Good luck&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=734627" width="1" height="1"&gt;</description></item><item><title>re: Make your .Net application support scripting - a practical approach</title><link>http://weblogs.asp.net/rosherove/pages/DotNetScripting.aspx#699997</link><pubDate>Sat, 21 Oct 2006 06:49:31 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:699997</guid><dc:creator>kli</dc:creator><author>kli</author><description>got the same error. tries with the 'using' stamement and the attribute definition but it simply doesn't work!&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=699997" width="1" height="1"&gt;</description></item><item><title>re: Make your .Net application support scripting - a practical approach</title><link>http://weblogs.asp.net/rosherove/pages/DotNetScripting.aspx#536057</link><pubDate>Mon, 11 Sep 2006 20:19:12 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:536057</guid><dc:creator>Dan</dc:creator><author>Dan</author><description>Dana,

If you're using Visual Studio 2005, make sure in your AssemblyInfo.cs file you have this:

using System.Runtime.InteropServices;

and, lower down, this:

[assembly: ComVisible(true)]

It's probably set to false - set it to true.&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=536057" width="1" height="1"&gt;</description></item><item><title>re: Make your .Net application support scripting - a practical approach</title><link>http://weblogs.asp.net/rosherove/pages/DotNetScripting.aspx#526305</link><pubDate>Thu, 07 Sep 2006 16:45:53 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:526305</guid><dc:creator>Dana</dc:creator><author>Dana</author><description>Jimmy, 

I tried the adding "Imports System.runtime.InteropServices" statement to my class file and yet, I get the same "Invalid Cast Exception" when using AddObjectin MSScriptControl.  Could you please post some additional information in how you got MSScript Control to work with VS 2005.  

Thanks&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=526305" width="1" height="1"&gt;</description></item><item><title>re: Make your .Net application support scripting - a practical approach</title><link>http://weblogs.asp.net/rosherove/pages/DotNetScripting.aspx#524454</link><pubDate>Thu, 07 Sep 2006 01:38:00 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:524454</guid><dc:creator>Jimmy</dc:creator><author>Jimmy</author><description>I found the answer!
use:

Imports System.runtime.InteropServices
...
&lt;ComVisible(True)&gt; Public Class ClassNameToAddToScriptControl

Then it goes well with AddObject of ScriptControl&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=524454" width="1" height="1"&gt;</description></item><item><title>re: Make your .Net application support scripting - a practical approach</title><link>http://weblogs.asp.net/rosherove/pages/DotNetScripting.aspx#520467</link><pubDate>Tue, 05 Sep 2006 10:35:34 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:520467</guid><dc:creator>Jimmy</dc:creator><author>Jimmy</author><description>I'm running .net 2005
I have the same problem.
Is this article as spam?&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=520467" width="1" height="1"&gt;</description></item></channel></rss>