SharpDevelop Community

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

How to reference CSharpBinding.dll (Debug build)

Last post 11-15-2015 5:05 PM by pianoboy. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 11-13-2015 8:16 PM

    How to reference CSharpBinding.dll (Debug build)

    Hello,

    I am trying to write an addin that references the CSharpBinding.Dll.

    I have included the following Import tag in my addin

    <Import assembly="$ICSharpCode.CSharpBinding/CSharpBinding.dll" />

    However, unless I place a copy of the dll in my own addin's folder  SD is unable to find the dll.

    Is the above import tag the correct way to reference the CSharpBinding.dll?

    I have also tried adding an App.config redirect but it just seems to be ignored.

    Looking forrward to any assistance you can provide.

    Regards

    pianoboy

    Upon further investigation I have discovered that this is only a problem when using a debug build of sharpdevelop 4.4. If using a release build there is no problem and in fact no import tag is required. In fact looking further into the debug build even though it displays the "Cannot Load" error for the csharpbinding, if you click on OK the addin is loaded and works as normal and can in fact is referencing the csharpbinding.dll.

    pianoboy


  • 11-14-2015 10:04 PM In reply to

    Re: How to reference CSharpBinding.dll (Debug build)

    You probably also need to define a dependency on the CSharpBinding addin to ensure it loads before your addin does.

    <Manifest>

    <Identity name = "YourAddin"/>

    <Dependency addin = "ICSharpCode.CSharpBinding" />

  • 11-15-2015 6:26 AM In reply to

    Re: How to reference CSharpBinding.dll (Debug build)

    Hello Matt,

    Thanks for your reply.

    I gave it a try but it still complains with the file not found error if I use a debug build of sharp develop. If I locate CSharpBinding.dll in the my addin folder or in the main sharpdevelop bin there is no problem. To reiterate, if I use a release build there is also no problem.

     

    Regards

    pianoboy

     

     

     

     

  • 11-15-2015 10:54 AM In reply to

    Re: How to reference CSharpBinding.dll (Debug build)

    The difference with a debug build is that SharpDevelop will call GetExportedTypes() on the assembly. That may trigger a type load exception if a type is not available.

    The F# addin depends on the C# addin and the only extra thing it has is a requirePreload attribute set to true for its CSharpBinding dependency. That will force the CSharpBinding assemblies to be loaded.

     

    <Manifest>

    <Identity name = "ICSharpCode.FSharpBinding"/>

    <Dependency addin = "ICSharpCode.CSharpBinding" requirePreload = "true"/>

    </Manifest>

    <Runtime>

    <Import assembly = "FSharpBinding.dll"/>

    <Import assembly = ":ICSharpCode.SharpDevelop"/>

    <Import assembly = "$ICSharpCode.CSharpBinding/CSharpBinding.dll"/>

    </Runtime>

     

  • 11-15-2015 5:05 PM In reply to

    Re: How to reference CSharpBinding.dll (Debug build)

    Thanks Matt,

    The requirePreload attribute did the trick.

    Regards

    pianoboy

     

     

     

Page 1 of 1 (5 items)
Powered by Community Server (Commercial Edition), by Telligent Systems
Don't contact us via this (fleischfalle@alphasierrapapa.com) email address.