SharpDevelop Community

Get your problems solved!
Welcome to SharpDevelop Community Sign in | Join | Help
in Search

Using Sharpdevelop With 'Castle Project' - [www.castleproject.org] Projects

Last post 02-27-2007 5:45 PM by DanielGrunwald. 9 replies.
Page 1 of 1 (10 items)
Sort Posts: Previous Next
  • 09-05-2006 10:50 PM

    Using Sharpdevelop With 'Castle Project' - [www.castleproject.org] Projects

    Here are the errors I am getting when initially loading Castle Project 2.0 binaries:

     .NET Version        : 2.0.50727.42
    OS Version           : Microsoft Windows NT 5.1.2600 Service Pack 2
    Current culture      : English (United States) (en-US)
    Working Set Memory   : 56560kb
    SharpDevelop Version : 2.0.0.1710

    Error loading code-completion information for Castle.Facilities.ActiveRecordIntegration from C:\LocatorDataEntry_v2\KioskManagement\public\bin\Castle.Facilities.ActiveRecordIntegration.dll
    Exception thrown:
    System.TypeLoadException: Method 'get_Connection' in type 'Castle.Facilities.ActiveRecordIntegration.SafeSessionProxy' from assembly 'Castle.Facilities.ActiveRecordIntegration, Version=1.0.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc' does not have an implementation.
       at System.Reflection.Assembly.GetExportedTypes()
       at ICSharpCode.SharpDevelop.Dom.ReflectionProjectContent..ctor(Assembly assembly, String assemblyLocation)
       at ICSharpCode.SharpDevelop.Dom.ReflectionLoader.LoadProjectContent(String fileName, String include)
       at ICSharpCode.SharpDevelop.Dom.ReflectionLoader.LoadAndCreateDatabase(String fileName, String include)
       at ICSharpCode.SharpDevelop.Dom.ReflectionLoader.LoadAndCreateDatabase(String fileName, String include)
       at ICSharpCode.Core.ProjectContentRegistry.LoadProjectContent(String filename, String include)

     

    .NET Version        : 2.0.50727.42
    OS Version           : Microsoft Windows NT 5.1.2600 Service Pack 2
    Current culture      : English (United States) (en-US)
    Working Set Memory   : 58572kb
    SharpDevelop Version : 2.0.0.1710

    Error loading code-completion information for Castle.Facilities.NHibernateIntegration from C:\LocatorDataEntry_v2\KioskManagement\public\bin\Castle.Facilities.NHibernateIntegration.dll
    Exception thrown:
    System.TypeLoadException: Method 'get_Connection' in type 'Castle.Facilities.NHibernateIntegration.SessionDelegate' from assembly 'Castle.Facilities.NHibernateIntegration, Version=1.0.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc' does not have an implementation.
       at System.Reflection.Assembly.GetExportedTypes()
       at ICSharpCode.SharpDevelop.Dom.ReflectionProjectContent..ctor(Assembly assembly, String assemblyLocation)
       at ICSharpCode.SharpDevelop.Dom.ReflectionLoader.LoadProjectContent(String fileName, String include)
       at ICSharpCode.SharpDevelop.Dom.ReflectionLoader.LoadAndCreateDatabase(String fileName, String include)
       at ICSharpCode.SharpDevelop.Dom.ReflectionLoader.LoadAndCreateDatabase(String fileName, String include)
       at ICSharpCode.Core.ProjectContentRegistry.LoadProjectContent(String filename, String include)

     

     

  • 09-06-2006 3:19 PM In reply to

    Re: Using Sharpdevelop With 'Castle Project' - [www.castleproject.org] Projects

    This is a bug in the .NET Framework - or the assembly is indeed invalid.

    SharpDevelop 2.1 will use a custom assembly reader (Mono.Cecil) instead of System.Reflection and should work better.

    Daniel Grunwald
  • 09-06-2006 8:34 PM In reply to

    Re: Using Sharpdevelop With 'Castle Project' - [www.castleproject.org] Projects

    I had a quick look at this problem and can reproduce it in SharpDevelop 2.0. Adding a reference to the Castle.Facilities.NHibernateIntegration.dll assembly in SharpDevelop 2.1 gives a Cecil error:

    Error loading code-completion information for Castle.Facilities.NHibernateIntegration from Castle.Facilities.NHibernateIntegration.dll:
    Error loading assembly:
    System.IO.FileLoadException: The given assembly name or codebase was invalid. (Exception from HRESULT: 0x80131047)
       at System.Reflection.AssemblyName.nInit(Assembly& assembly, Boolean forIntrospection, Boolean raiseResolveEvent)
       at System.Reflection.AssemblyName.nInit()
       at System.Reflection.AssemblyName..ctor(String assemblyName)
       at CecilReader.LoadAssembly(String fileName, ProjectContentRegistry registry) in CecilReader.cs:line 29
       at ProjectContentRegistry.LoadProjectContent(String itemInclude, String itemFileName) in ProjectContentRegistry.cs:line 264
       at ProjectContentRegistry.GetProjectContentForReference(String itemInclude, String itemFileName) in ProjectContent\ProjectContentRegistry.cs:line 226

    Visual Studio Express works and you can see code completion for this assembly, including the SessionDelegate class. Reflector also seems to work with this assembly. Not sure what they are using to load the assembly to avoid this problem, unless they are just absorbing the error and carrying on.

  • 09-06-2006 8:47 PM In reply to

    Re: Using Sharpdevelop With 'Castle Project' - [www.castleproject.org] Projects

    Both Visual Studio and Reflector have their own assembly readers. Unfortunately we cannot ignore the error - using Reflection, it is impossible to get the list of types in the assembly if one type throws an exception.

    Apparently there really is something strange in the assembly. You should send it to Jb Evain (the Cecil developer), maybe he can fix Cecil to ignore that kind of error.

    Daniel Grunwald
  • 09-07-2006 1:40 AM In reply to

    Re: Using Sharpdevelop With 'Castle Project' - [www.castleproject.org] Projects

    Whilst writing and running a unit test for Mono.Cecil, I noticed that the Castle.Facilities.NHibernateIntegration.dll assembly is a bit odd, it has references to the .NET 1.1 and .NET 2.0 versions of mscorlib and System.Data. I have no idea how they managed to do that. It's not something you can do using MSBuild or Csc.exe directly. So the NHibernateIntegration assembly looks invalid to me.

     
    I suggest you use the .NET 1.1 Castle binaries instead, they can be loaded by SharpDevelop2 without any problems. The .NET 1.1 binaries should use the same version of the .NET framework as your main executable so they should work with just .NET 2.0 installed.

  • 09-07-2006 10:59 PM In reply to

    Re: Using Sharpdevelop With 'Castle Project' - [www.castleproject.org] Projects

    Hi,

    It looks like it's not a problem from Cecil (which can read both assemblies).

     Jb
     

     

  • 09-08-2006 12:07 AM In reply to

    Re: Using Sharpdevelop With 'Castle Project' - [www.castleproject.org] Projects

    Cecil is reading the assemblies correctly, yes. The problem is that the Castle.Facilities.NHibernateIntegration assembly has odd public keys for System.Data and mscorlib (versions 1.0.5). The public key is "00000000000000000400000000000000" which is what Cecil returns and Microsoft's ILDAsm returns. If you try to create the AssemblyName with this key you get the exception.
  • 10-15-2006 2:45 AM In reply to

    Re: Using Sharpdevelop With 'Castle Project' - [www.castleproject.org] Projects

    I have a similar problem just using the NHibernate dlls themselves.

    Error loading code-completion information for NHibernate from C:\Formsoft
    Projects\dotNET\Common\Libraries\nhibernate-1.0.2.0\bin\NHibernate.dll:
    Error loading assembly:
    System.IO.FileLoadException: The given assembly name or codebase was
    invalid. (Exception from HRESULT: 0x80131047)
    at System.Reflection.AssemblyName.nInit(Assembly& assembly, Boolean
    forIntrospection, Boolean raiseResolveEvent)
    at System.Reflection.AssemblyName.nInit()
    at System.Reflection.AssemblyName..ctor(String assemblyName)
    at ICSharpCode.SharpDevelop.Dom.CecilReader.LoadAssembly(String
    fileName, ProjectContentRegistry registry)
    at
    ICSharpCode.SharpDevelop.Dom.ProjectContentRegistry.LoadProjectContent(String
    itemInclude, String itemFileName)
    at
    ICSharpCode.SharpDevelop.Dom.ProjectContentRegistry.GetProjectContentForReference(String
    itemInclude, String itemFileName)

    You can grab the dll here:
    http://prdownloads.sourceforge.net/nhibernate/nhibernate-1.0.2.0.zip?download
  • 10-15-2006 2:20 PM In reply to

    Re: Using Sharpdevelop With 'Castle Project' - [www.castleproject.org] Projects

    This is the same problem, the public keys for the references to System, mscorlib, System.Data and System.Xml have an odd value of 00000000000000000400000000000000

    The only difference is that you can add a reference to NHibernate with SharpDevelop 2.0 and it seems to work. It does not work with SharpDevelop 2.1. 

  • 02-27-2007 5:45 PM In reply to

    Re: Using Sharpdevelop With 'Castle Project' - [www.castleproject.org] Projects

    The problem has been fixed in SharpDevelop 2.1.0.2408.
    Daniel Grunwald
Page 1 of 1 (10 items)
Powered by Community Server (Commercial Edition), by Telligent Systems
Don't contact us via this (fleischfalle@alphasierrapapa.com) email address.