You need to download the version of IronPython which is built for .NET 4.0: 
http://ironpython.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=28125

That'll just work and it'll support interop w/ C# 4.0.

From: users-boun...@lists.ironpython.com 
[mailto:users-boun...@lists.ironpython.com] On Behalf Of Neelima Potti
Sent: Monday, January 25, 2010 1:48 PM
To: users@lists.ironpython.com
Subject: [IronPython] to invoke ironpython from runtime in .NET framework 4.0

Hi,
I am new to IronPython..
I have downloaded IronPython from the website
http://www.codeplex.com/IronPython lastweek.
When I open IronPython Console, it shows
IronPython 2.6 (2.6.10920.0) on .NET 2.0.50727.3053

I am trying to invoke the Python engine at run time
By calling in c# source(.NET 4.0 framework)

_runtime = ScriptRuntime.CreateFromConfiguration()

When I add Microsoft.Scripting as a Reference to this project, it shows the 
version as 2.6.911.0

And my app.config has

<?xml version="1.0"?>
<configuration>
  <configSections>
    <section name="microsoft.scripting" 
type="Microsoft.Scripting.Hosting.Configuration.Section, Microsoft.Scripting, 
Version=2.6.911.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" 
requirePermission="false"/>
  </configSections>
  <microsoft.scripting>
    <languages>
      <language names="IronPython,Python,py" extensions=".py" 
displayName="IronPython 2.0 Beta" 
type="IronPython.Runtime.PythonContext,IronPython, Version=2.0.0.0000, 
Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
    </languages>
  </microsoft.scripting>
<startup><supportedRuntime version="v4.0" 
sku=".NETFramework,Version=v4.0"/></startup></configuration>


During runtime, I get the error:
An error occurred creating the configuration section handler for 
microsoft.scripting: Could not load file or assembly 'Microsoft.Scripting, 
Version=2.6.911.0, 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

What am I missing here? Is my version wrong or publicKeyToken wrong or??

Any help would be greatly appreciated

Thank you
NPotti
_______________________________________________
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com

Reply via email to