February 2009 Entries
ScriptSharp and 'not using an unsupported feature'

image Well, I was working on killing a bug in JavaScript and I needed Sys.Debug.trace() to help.  I used Script#, and the compiler yelped this error at me:

Check that your C# source compiles and that you are not using an unsupported feature.

Whoops.  Didn't find much around and on good ole' Google, so I didn't have much of an option.  Turns out, I was using namespace-qualified types like so:

   Sys.Debug.Trace( "foo" );

Just change your code to:

    Debug.Trace( "foo" );

And the compiler should be happy again.

Script# is a great tool to add to your tool belt along with MS AJAX and jQuery.  The Script# suite isn't exactly full-feature-tested compiler yet, but it's getting there!  Thanks again Nikhil Kothari!

Hope that helps!

Brian Chavez

Add Comment Filed Under [ Errors ]
NAnt 0.86, script task with RegEx and RegularExpressions

image Muah.  While updating to NAnt 0.86, I was stuck with the following error while trying to execute a <script> task:

The name 'Regex' does not exist in the current context

I was using a <script> task to do some RegEx some files apart of the build process.  Well, turns out that NAnt 0.86-beta2 has a breaking changeSystem.Text.RegularExpressions is now removed by default from the imported assemblies of <script> tasks.  Oh well...

The following should get you back on track:

  641     <script language="C#">

  642           <code>

  643 <![CDATA[

  644         //C# code goes here...

  645   ]]>

  646           </code>

  647         <imports>

  648             <import namespace="System.Text.RegularExpressions"/>

  649         </imports>

  650         <references>

  651             <include name="System.dll"/>

  652         </references>

  653     </script>

Just add the <imports> and <references> section to the <script> task and all should be well again! :)

Brian Chavez

One Comment Filed Under [ Errors ]