[IronPython] IronPython 2.0 Alpha 2

Michael Foord fuzzyman at voidspace.org.uk
Sun Jul 1 21:00:41 CEST 2007


Hello all,

I've been playing with a simple C# script illustrating embedding 
IronPython 2.0.

The following code works fine for 2.0 Alpha 1:

using System;
using Microsoft.Scripting;

namespace IronPythonScriptHost
{
    class Program
    {
        static void Main(string[] args)
        {
            string code = "print \"Hello\" + Name";
            Script.SetVariable("Name", "Nick");
            Script.Execute("py", code);
            Console.Read(); 
        }
    }
}


When run with 2.0 Alpha 2, it produces the following error (saying that 
the version of the Python language provider is incorrect):

Unhandled Exception: Microsoft.Scripting.MissingTypeException: Type 
'IronPython, Version=2.0.0.100, Culture=neutral, 
PublicKeyToken=31bf3856ad364e35, 
IronPython.Hosting.PythonLanguageProvider' is missing or cannot be 
loaded. ---> System.IO.FileLoadException: Could not load file or 
assembly 'IronPython, Version=2.0.0.100, Culture=neutral, 
PublicKeyToken=31bf3856ad364e35' or one of its dependencies.
 The located assembly's manifest definition does not match the assembly 
reference. (Exception from HRESULT: 0x80131040)
File name: 'IronPython, Version=2.0.0.100, Culture=neutral, 
PublicKeyToken=31bf3856ad364e35'   at 
System.Reflection.Assembly.nLoad(AssemblyName fileName, String codeBase, 
Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& 
stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection)
   at System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, 
Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean 
forIntrospection)
   at System.Reflection.Assembly.InternalLoad(String assemblyString, 
Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean 
forIntrospection)
   at System.Reflection.Assembly.Load(String assemblyString)
   at 
Microsoft.Scripting.Hosting.PlatformAdaptationLayer.LoadAssembly(String 
name)
   at 
Microsoft.Scripting.ScriptDomainManager.LanguageProviderDesc.LoadProvider(ScriptDomainManager 
manager)


As far as I can see from the docs, this part of the API should still 
work, and I am referencing the DLLs provided in the Alpha 2 release. Any 
clues?

Michael Foord
http://www.voidspace.org.uk/ironpython/index.shtml




More information about the Ironpython-users mailing list