Originally posted by shill
View Post
Announcement
Collapse
No announcement yet.
Important if you are using the Newtonsoft DLL in your plugin!
Collapse
This is a sticky topic.
X
X
-
Originally posted by rjh View PostThe following changes need to be made in order for your plugin to function properly with the HS3 version 3.0.0.333 or later.
If you reference the Newtonsoft JSON DLL in your plugin, make sure you install that dll in your own folder. Lets assume your plugin is named "AcmePlugin", your install.txt should install the Newtonsoft dll to:
bin\AcmePlugin
You should then include a exe.config file with the bin path set like so:
Code:<probing privatePath="bin/AcmePlugin;bin" />
My original app.config file (probing just under <startup>)
Code:<?xml version="1.0"?> <configuration> <system.diagnostics> <sources> <!-- This section defines the logging configuration for My.Application.Log --> <source name="DefaultSource" switchName="DefaultSwitch"> <listeners> <add name="FileLog"/> <!-- Uncomment the below section to write to the Application Event Log --> <!--<add name="EventLog"/>--> </listeners> </source> </sources> <switches> <add name="DefaultSwitch" value="Information"/> </switches> <sharedListeners> <add name="FileLog" type="Microsoft.VisualBasic.Logging.FileLogTraceListener, Microsoft.VisualBasic, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" initializeData="FileLogWriter"/> <!-- Uncomment the below section and replace APPLICATION_NAME with the name of your application to write to the Application Event Log --> <!--<add name="EventLog" type="System.Diagnostics.EventLogTraceListener" initializeData="APPLICATION_NAME"/> --> </sharedListeners> </system.diagnostics> <startup> <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/> <runtime> <loadFromRemoteSources enabled="true" /> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <probing privatePath="bin/TankUtil" /> </assemblyBinding> </runtime> </startup> </configuration> [LEFT][COLOR=#000000][FONT=Helvetica][SIZE=14px][/SIZE][/FONT][/COLOR][/LEFT]
What he did to make it work and load the Newtonsoft DLL (relocated code in red)
Code:[LEFT][COLOR=#000000][FONT=Helvetica][SIZE=14px]<?xml version="1.0"?>[/SIZE][/FONT][/COLOR][/LEFT] [LEFT][COLOR=#000000][FONT=Helvetica][SIZE=14px]<configuration>[/SIZE][/FONT][/COLOR][/LEFT] [COLOR=#FF0000][LEFT] <runtime>[/LEFT] [LEFT] <loadFromRemoteSources enabled="true" />[/LEFT] [LEFT] <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">[/LEFT] [LEFT] <probing privatePath="bin/TankUtil" />[/LEFT] [LEFT] </assemblyBinding>[/LEFT] [LEFT] </runtime>[/LEFT][/COLOR] [LEFT][COLOR=#000000][FONT=Helvetica][SIZE=14px] <system.diagnostics>[/SIZE][/FONT][/COLOR][/LEFT] [LEFT][COLOR=#000000][FONT=Helvetica][SIZE=14px] <sources>[/SIZE][/FONT][/COLOR][/LEFT] [LEFT][COLOR=#000000][FONT=Helvetica][SIZE=14px] <!-- This section defines the logging configuration for My.Application.Log -->[/SIZE][/FONT][/COLOR][/LEFT] [LEFT][COLOR=#000000][FONT=Helvetica][SIZE=14px] <source name="DefaultSource" switchName="DefaultSwitch">[/SIZE][/FONT][/COLOR][/LEFT] [LEFT][COLOR=#000000][FONT=Helvetica][SIZE=14px] <listeners>[/SIZE][/FONT][/COLOR][/LEFT] [LEFT][COLOR=#000000][FONT=Helvetica][SIZE=14px] <add name="FileLog"/>[/SIZE][/FONT][/COLOR][/LEFT] [LEFT][COLOR=#000000][FONT=Helvetica][SIZE=14px] <!-- Uncomment the below section to write to the Application Event Log -->[/SIZE][/FONT][/COLOR][/LEFT] [LEFT][COLOR=#000000][FONT=Helvetica][SIZE=14px] <!--<add name="EventLog"/>-->[/SIZE][/FONT][/COLOR][/LEFT] [LEFT][COLOR=#000000][FONT=Helvetica][SIZE=14px] </listeners>[/SIZE][/FONT][/COLOR][/LEFT] [LEFT][COLOR=#000000][FONT=Helvetica][SIZE=14px] </source>[/SIZE][/FONT][/COLOR][/LEFT] [LEFT][COLOR=#000000][FONT=Helvetica][SIZE=14px] </sources>[/SIZE][/FONT][/COLOR][/LEFT] [LEFT][COLOR=#000000][FONT=Helvetica][SIZE=14px] <switches>[/SIZE][/FONT][/COLOR][/LEFT] [LEFT][COLOR=#000000][FONT=Helvetica][SIZE=14px] <add name="DefaultSwitch" value="Information"/>[/SIZE][/FONT][/COLOR][/LEFT] [LEFT][COLOR=#000000][FONT=Helvetica][SIZE=14px] </switches>[/SIZE][/FONT][/COLOR][/LEFT] [LEFT][COLOR=#000000][FONT=Helvetica][SIZE=14px] <sharedListeners>[/SIZE][/FONT][/COLOR][/LEFT] [LEFT][COLOR=#000000][FONT=Helvetica][SIZE=14px] <add name="FileLog" type="Microsoft.VisualBasic.Logging.FileLogTraceListener, Microsoft.VisualBasic, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" initializeData="FileLogWriter"/>[/SIZE][/FONT][/COLOR][/LEFT] [LEFT][COLOR=#000000][FONT=Helvetica][SIZE=14px] <!-- Uncomment the below section and replace APPLICATION_NAME with the name of your application to write to the Application Event Log -->[/SIZE][/FONT][/COLOR][/LEFT] [LEFT][COLOR=#000000][FONT=Helvetica][SIZE=14px] <!--<add name="EventLog" type="System.Diagnostics.EventLogTraceListener" initializeData="APPLICATION_NAME"/> -->[/SIZE][/FONT][/COLOR][/LEFT] [LEFT][COLOR=#000000][FONT=Helvetica][SIZE=14px] </sharedListeners>[/SIZE][/FONT][/COLOR][/LEFT] [LEFT][COLOR=#000000][FONT=Helvetica][SIZE=14px] </system.diagnostics>[/SIZE][/FONT][/COLOR][/LEFT] [LEFT][COLOR=#000000][FONT=Helvetica][SIZE=14px] <startup>[/SIZE][/FONT][/COLOR][/LEFT] [LEFT][COLOR=#000000][FONT=Helvetica][SIZE=14px] <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>[/SIZE][/FONT][/COLOR][/LEFT] [LEFT][COLOR=#000000][FONT=Helvetica][SIZE=14px] </startup>[/SIZE][/FONT][/COLOR][/LEFT] [LEFT][COLOR=#000000][FONT=Helvetica][SIZE=14px]</configuration>[/SIZE][/FONT][/COLOR][/LEFT] [LEFT][COLOR=#000000][FONT=Helvetica][SIZE=14px][/SIZE][/FONT][/COLOR][/LEFT]
Comment
-
Here is an example form one of my plugins, it goes under configuration/runtime:
<?xml version="1.0"?>
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<probing privatePath="bin/CpsTuya"/>
</assemblyBinding>
</runtime>
<startup useLegacyV2RuntimeActivationPolicy="true">
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
</startup>
</configuration>
- Likes 1
Comment
-
Thank you!
Originally posted by bsobel View PostHere is an example form one of my plugins, it goes under configuration/runtime:
<?xml version="1.0"?>
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<probing privatePath="bin/CpsTuya"/>
</assemblyBinding>
</runtime>
<startup useLegacyV2RuntimeActivationPolicy="true">
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
</startup>
</configuration>
- Likes 1
Comment
Comment