Your explanation for the SysModule error sounds right -- if you use Assembly.LoadFile instead, you'll probably avoid that exception. What settings are you using in fuslogvw?<br><br><div class="gmail_quote">2009/3/17 Matt Channer <span dir="ltr"><<a href="mailto:mchanner@gmail.com">mchanner@gmail.com</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Hi,<br><br>The machine is pretty clean and has no dlr / ipy assemblies in the gac.<br><br>fuslogvw is not showing anything for me at the moment so I need to investigate that a bit more.<br>
<br>I think the error in the SysModule constructor is because I used AppDomain.CurrentDomain.Load(byte[]) to try and work around the original issue (this was done in an AssemblyResolve event handler). <br>
<br>Thanks,<br><br>Matt<br><br><br><div class="gmail_quote">2009/3/17 Curt Hagenlocher <span dir="ltr"><<a href="mailto:curt@hagenlocher.org" target="_blank">curt@hagenlocher.org</a>></span><div><div></div><div class="h5">
<br><blockquote class="gmail_quote" style="border-left:1px solid rgb(204, 204, 204);margin:0pt 0pt 0pt 0.8ex;padding-left:1ex">
I don't know why there would be a difference between 32-bit and 64-bit, but do you possibly have a copy of any of the IronPython bits in your GAC? As to the "invalid path" error, you're probably getting it from the line<br>
<div><br></div><div>prefix = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);</div><div><br></div><div>which is consistent with some kind of assembly-loading weirdness. Odd that nothing shows in fuslogvw. </div>
<div><br><div class="gmail_quote">2009/3/17 Matt Channer <span dir="ltr"><<a href="mailto:mchanner@gmail.com" target="_blank">mchanner@gmail.com</a>></span><br><blockquote class="gmail_quote" style="border-left:1px solid rgb(204, 204, 204);margin:0pt 0pt 0pt 0.8ex;padding-left:1ex">
<div><div></div><div>
Hi!<br><br>I am using IronPython 2.0.1 in a hosted environment (c# application running on 64 bit Vista). This works well when the application is compiled as a 32bit process, but I am getting the following error when running as an x64 process:<br>
<br><b>Could not load file or assembly 'Microsoft.Scripting, Version=0.9.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The specified module could not be found.</b><br><br>Fuslogvw is not helping at the moment (nothing is reported there). All ipy \ DLR assemblies are in a sub directory which is included in the assemblyBinding section of the apps config file (the error remains if they are in the exe directory as well).<br>
<br>I tried a workaround (read: hack) by handling the AssemblyResolve event on the app domain and loading the files from a known directory. The problem I then encountered is an exception in the IronPython.Runtime.SysModule constructor (line 46) as it sets the prefix variable to the directory containing the assembly, which fails as the Location is empty.<br>
<br>Below is the full exception:<br><br><b>Microsoft.Scripting.InvalidImplementationException: Type 'IronPython.Runtime.PythonContext' doesn't provide a suitable public constructor or its implementation is faulty: The type initializer for 'IronPython.Runtime.SysModule' threw an exception. ---> System.TypeInitializationException: The type initializer for 'IronPython.Runtime.SysModule' threw an exception. ---> System.ArgumentException: The path is not of a legal form.<br>
at System.IO.Path.NormalizePathFast(String path, Boolean fullCheck)<br> at System.IO.Path.GetDirectoryName(String path)<br> at IronPython.Runtime.SysModule..cctor()<br> --- End of inner exception stack trace ---<br>
at IronPython.Runtime.SysModule.PerformModuleReload(PythonContext context, IAttributesCollection dict)<br> at IronPython.Runtime.PythonContext..ctor(ScriptDomainManager manager, IDictionary`2 options)<br> --- End of inner exception stack trace ---<br>
at Microsoft.Scripting.Utils.ReflectionUtils.CreateInstance[T](Type actualType, Object[] args)<br> at Microsoft.Scripting.Runtime.LanguageConfiguration.LoadLanguageContext(ScriptDomainManager domainManager, Boolean& alreadyLoaded)<br>
at Microsoft.Scripting.Runtime.DlrConfiguration.LoadLanguageContext(ScriptDomainManager manager, LanguageConfiguration config)<br> at Microsoft.Scripting.Runtime.DlrConfiguration.TryLoadLanguage(ScriptDomainManager manager, AssemblyQualifiedTypeName providerName, LanguageContext& language)<br>
at Microsoft.Scripting.Runtime.ScriptDomainManager.GetLanguageByTypeName(String providerAssemblyQualifiedTypeName)<br> at Microsoft.Scripting.Hosting.ScriptRuntime.GetEngineByTypeName(String assemblyQualifiedTypeName)<br>
at IronPython.Hosting.Python.GetEngine(ScriptRuntime runtime)<br> at Idbs.ActivityBase.DataImport.Scripting.ScriptingHosts.PythonScriptingHost.CreateEngine(String configurationFile) in C:\svn\xe\branches\anaconda\Shared\ImportProviders\PythonScriptingProvider\ScriptingHosts\PythonScriptingHost.cs:line 148<br>
at Idbs.ActivityBase.DataImport.Scripting.ScriptingHosts.PythonScriptingHost.ScriptCanMapByIdentifiers(String configurationFile) in C:\svn\xe\branches\anaconda\Shared\ImportProviders\PythonScriptingProvider\ScriptingHosts\PythonScriptingHost.cs:line 52</b><br>
<br>So my first question: how come the assemblies are not being found? Secondly, is the exception in SysModule something that I should log?<br><br>Kind Regards,<br><font color="#888888"><br>Matt<br>
</font><br></div></div>_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.ironpython.com" target="_blank">Users@lists.ironpython.com</a><br>
<a href="http://lists.ironpython.com/listinfo.cgi/users-ironpython.com" target="_blank">http://lists.ironpython.com/listinfo.cgi/users-ironpython.com</a><br>
<br></blockquote></div><br></div>
<br>_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.ironpython.com" target="_blank">Users@lists.ironpython.com</a><br>
<a href="http://lists.ironpython.com/listinfo.cgi/users-ironpython.com" target="_blank">http://lists.ironpython.com/listinfo.cgi/users-ironpython.com</a><br>
<br></blockquote></div></div></div><br>
<br>_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.ironpython.com">Users@lists.ironpython.com</a><br>
<a href="http://lists.ironpython.com/listinfo.cgi/users-ironpython.com" target="_blank">http://lists.ironpython.com/listinfo.cgi/users-ironpython.com</a><br>
<br></blockquote></div><br>