Profile Picture

Plugin registration failure

Posted By phatcher 2 Years Ago
Message
Posted Saturday July 04 2015
I'm writing some plugins that integrate into an existing code base which uses log4net, NHibernate and Unity.
I can write unit tests that create the underlying classes and my services, but the services fail to appear in the New Services dialog.
I'm guessing that the initialisation in the service is failing for some reason, but I don't have any visibility of the error - I've tried trapping exceptions and writing them to the event log but I don't get anything.

Any suggestions as to how to debug this - do you log errors anywhere?
Posted Saturday July 04 2015
Ok, it turns out to be log4net - the main application is using 1.2.10 for .NET 2 whereas my code is using 1.2.13 for .NET 4.
The other thing to ensure is that you specify a full path to the logging directory e.g. use C:\Logs as you might not have write permission to the RightEdge folders

<?xml version="1.0" encoding="utf-8"?>
<configuration>
    <configSections>
        <sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
            <section name="RightEdge.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" />
        </sectionGroup>
        <sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
            <section name="RightEdge.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
        </sectionGroup>
    </configSections>
    <runtime>
        <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
         <probing privatePath="Plugins"/>
     <!-- http://stackoverflow.com/questions/3158928/referencing-2-differents-versions-of-log4net-in-the-same-solution -->
            <dependentAssembly>
                <assemblyIdentity name="log4net" publicKeyToken="1b44e1d426115821" />
                <codeBase version="1.2.10.0" href="log4net.dll" />
            </dependentAssembly>
            <dependentAssembly>
                <assemblyIdentity name="log4net" publicKeyToken="669e0ddf0bb1aa2a" />
                <codeBase version="1.2.13.0" href="Plugins\log4net.dll" />
            </dependentAssembly>
        </assemblyBinding>
    </runtime>
</configuration>

Edited: Saturday July 04 2015 by phatcher


Similar Topics


Reading This Topic


2005-2017 © RightEdge Systems