Infralution Support Forum Index Infralution Support
Support groups for Infralution products
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Dynamically Loaded WPF UserControl Plugins`

 
Post new topic   Reply to topic    Infralution Support Forum Index -> Globalizer Support
View previous topic :: View next topic  
Author Message
bvillersjr



Joined: 04 Jan 2010
Posts: 15

PostPosted: Mon Nov 22, 2010 4:59 am    Post subject: Dynamically Loaded WPF UserControl Plugins` Reply with quote

Hello,

I have built a variety if WPF UserControl Plugins and an interface specification for my app.

In my usercontrol plugins I have some strange behavior. It seems that the globalization is not occuring at all, and in the invariant (English) some of my resources show properly, while others show #blahblahblah

The UserControls contain the UICUlture: <UserControl Language="{UICulture}". I thought this was all that would be necessary?

I tried adding the following to the new event (after initializecomponent) of the dynamically loaded usercontrol: Thread.CurrentThread.CurrentUICulture = CultureManager.UICulture

The plugins are usercontrols that implement my interface. This allows me to cast between them and deal with them as either type.

Below is the code that is loading the plugins. Any guidance you can offer is much appreciated! I've ran into the proverbial brick wall here.

Code:
       Public Function GetPlugins(ByVal filename As String, ByVal pluginType As WizardPluginInterface.WizardPluginType) As List(Of String)

            '#Region "Variables"
            Dim asm As Assembly
            Dim pluginList As New List(Of String)()
            '#End Region

            '#Region "Data Validation"

            ' Check to see if the file exist
            If Not File.Exists(filename) Then

                Return pluginList
            End If

            '#End Region

            Try

                asm = Assembly.LoadFile(filename)

                ' Loop through all of the type
                For Each type As Type In asm.GetTypes()
                    Dim interfaces As Type() = type.GetInterfaces()
                    For Each iface As Type In interfaces
                        If iface.Name = GetType(WizardPluginInterface.IWizardPlugin).Name Then
                                                  Dim attributes As Object() = type.GetCustomAttributes(GetType(WizardPluginInterface.PluginAttribute), True)
                            If attributes.Length <> 0 Then
                                ' An attribute was found
                                For Each pluginAttribute As WizardPluginInterface.PluginAttribute In attributes
                                    If pluginAttribute.Type = pluginType Then
                                        pluginList.Add(type.FullName)
                                    End If
                                Next
                            End If
                        End If
                    Next
                Next
            Catch ex As BadImageFormatException
                ' This one we can ignore (most likely the configuration file)

            Catch
                'TODO - Handle failed plugins
                'Throw
            End Try

            ' Cleanup
            asm = Nothing

            Return pluginList
        End Function


        Public Function GetPlugin(ByVal filename As String, ByVal className As String) As WizardPluginInterface.IWizardPlugin

            '#Region "Variables"

            '#End Region

            '#Region "Data Validation"

            ' Check to see if the file exist
            If Not File.Exists(filename) Then
                Return Nothing
            End If

            '#End Region

            Try
                Dim obj As System.Runtime.Remoting.ObjectHandle = Activator.CreateInstanceFrom(filename, className)
                Return DirectCast(obj.Unwrap(), IWizardPlugin)
            Catch ex As BadImageFormatException
                ' This one we can ignore (most likely the configuration file)
            Catch
                Throw
            End Try


            Return Nothing
        End Function


Once I have the plugin instance, I cast it as a usercontrol and add it as a child of a grid.
_________________
Regards,


Berney Villers Jr.
SimXperience.com
http://www.SimXperience.com
Back to top
View user's profile Send private message Visit poster's website
bvillersjr



Joined: 04 Jan 2010
Posts: 15

PostPosted: Mon Nov 22, 2010 8:57 am    Post subject: Reply with quote

IN addition to the above, I am getting some warnings when scanning regarding my plugins:

Here is an example:

** WARNING E123: The Target (SimCommandPluginInterface\Resources) Resource Name (SX.Resources) is used by multiple targets within the workspace. This may affect your ability to preview this Target. Ensure that the Resource Name to matches the fully qualified type name for the associated control.
** WARNING E123: The Target (SimXperienceStageIAndII\PluginUI) Resource Name (SX.WizardPlugin.PluginUI) is used by multiple targets within the workspace. This may affect your ability to preview this Target. Ensure that the Resource Name to matches the fully qualified type name for the associated control.
** WARNING E123: The Target (SimXperienceStageIAndII\Resources) Resource Name (SX.WizardPlugin.Resources) is used by multiple targets within the workspace. This may affect your ability to preview this Target. Ensure that the Resource Name to matches the fully qualified type name for the associated control.
** WARNING E123: The Target (SimXperienceStageIIIAndIV\PluginUI) Resource Name (SX.WizardPlugin.PluginUI) is used by multiple targets within the workspace. This may affect your ability to preview this Target. Ensure that the Resource Name to matches the fully qualified type name for the associated control.
** WARNING E123: The Target (SimXperienceStageIIIAndIV\Resources) Resource Name (SX.WizardPlugin.Resources) is used by multiple targets within the workspace. This may affect your ability to preview this Target. Ensure that the Resource Name to matches the fully qualified type name for the associated control.
** WARNING E123: The Target (WizardPluginInterface\Resources) Resource Name (SX.Resources) is used by multiple targets within the workspace. This may affect your ability to preview this Target. Ensure that the Resource Name to matches the fully qualified type name for the associated control.
_________________
Regards,


Berney Villers Jr.
SimXperience.com
http://www.SimXperience.com
Back to top
View user's profile Send private message Visit poster's website
Infralution



Joined: 28 Feb 2005
Posts: 5027

PostPosted: Tue Nov 23, 2010 12:25 am    Post subject: Reply with quote

What version of Globalizer.NET are you using? What is the version of Infralution.Localization.Wpf assembly that you are referencing?

From the warnings you are seeing it looks like your project has sub-folders which in turn contain the WPF pages. In Globalizer.NET version prior to 2.1.1 this was not supported and if two folders contained a WPF page with the same name then they would both have the same (incorrect) resource name.

With regard to dynamic loading of assemblies this should be achievable - however if you are seeing #blahblah it means that the Infralution.Localization.Wpf assembly was unable to locate the compiled resource that you are referencing in your XAML. This could be because the of the warnings you are getting (because the resource names are incorrect) or because the method used to locate the resource assembly is not coping with the dynamically loaded assembly.

If you can put togther a small self contained project that demonstrates the issue you are having then we could help ascertain the problem. Alternatively you can download the source code for the Infralution.Localization.Wpf assembly from Code Project. Then you could compile your application against this and debug the code that loads the compiled resources. This is in ResxExtension.FindResourceAssembly.
_________________
Infralution Support
Back to top
View user's profile Send private message Visit poster's website
bvillersjr



Joined: 04 Jan 2010
Posts: 15

PostPosted: Tue Nov 23, 2010 11:10 am    Post subject: Reply with quote

Thank You For the Reply.

I restored a backup copy of my solution as it was before every running Globalizer. I then got the latest version (2.3.7) and created an new Globalizer project. I added my solution and ran a scan with default options.

Below is the list of warnings. I will continue down your suggested troubleshooting path and as a worst case I will produce a sample solution with a couple of plugin projects included.

I will be sure to post back regardless of the outcome.

THANKS AGAIN FOR HAVING A LOOK AT THIS!


Scanning Targets
Scanning AddInPluginInterface\Resources, Invariant
Scanning ARCA\Resources, Invariant
Writing changes to C:\Shared\Commander\Commander2\Commander2.vbproj
Scanning Commander2\Resources, Invariant
Writing changes to C:\Shared\Commander\Commander2\SimCommandsBrowser.xaml
Writing changes to C:\Shared\Commander\Commander2\SimCommandsBrowser.resx
Scanning Commander2\SimCommandsBrowser, Invariant
Writing changes to C:\Shared\Commander\Commander2\ProfileEditorWindow.xaml
Writing changes to C:\Shared\Commander\Commander2\ProfileEditorWindow.resx
Scanning Commander2\ProfileEditorWindow, Invariant
Writing changes to C:\Shared\Commander\Commander2\PopupStatusWindow.xaml
Writing changes to C:\Shared\Commander\Commander2\PopupStatusWindow.resx
Scanning Commander2\PopupStatusWindow, Invariant
Writing changes to C:\Shared\Commander\Commander2\SettingsWindow.xaml
Writing changes to C:\Shared\Commander\Commander2\SettingsWindow.resx
Scanning Commander2\SettingsWindow, Invariant
Writing changes to C:\Shared\Commander\Commander2\ProfileSelectorWindow.xaml
Writing changes to C:\Shared\Commander\Commander2\ProfileSelectorWindow.resx
Scanning Commander2\ProfileSelectorWindow, Invariant
Writing changes to C:\Shared\Commander\Commander2\MainWindow.xaml
Writing changes to C:\Shared\Commander\Commander2\MainWindow.resx
Scanning Commander2\MainWindow, Invariant
Writing changes to C:\Shared\Commander\Commander2\PopupMessageWindow.xaml
Writing changes to C:\Shared\Commander\Commander2\PopupMessageWindow.resx
Scanning Commander2\PopupMessageWindow, Invariant
Writing changes to C:\Shared\Commander\Commander2\UserControls\GameControllerInputControl.xaml
Writing changes to C:\Shared\Commander\Commander2\UserControls\GameControllerInputControl.resx
Scanning Commander2\GameControllerInputControl, Invariant
Writing changes to C:\Shared\Commander\Commander2\UserControls\MotionTuner.xaml
Writing changes to C:\Shared\Commander\Commander2\UserControls\MotionTuner.resx
Scanning Commander2\MotionTuner, Invariant
Writing changes to C:\Shared\Commander\Commander2\UserControls\Diagnostics.xaml
Writing changes to C:\Shared\Commander\Commander2\UserControls\Diagnostics.resx
Scanning Commander2\Diagnostics, Invariant
Writing changes to C:\Shared\Commander\Commander2\UserControls\MathLinePercentageSlider.xaml
Writing changes to C:\Shared\Commander\Commander2\UserControls\MathLinePercentageSlider.resx
Scanning Commander2\MathLinePercentageSlider, Invariant
Writing changes to C:\Shared\Commander\Commander2\UserControls\Settings\GameControllers.xaml
Writing changes to C:\Shared\Commander\Commander2\UserControls\Settings\GameControllers.resx
Scanning Commander2\GameControllers, Invariant
Writing changes to C:\Shared\Commander\Commander2\UserControls\SimCommandPluginContainer.xaml
Writing changes to C:\Shared\Commander\Commander2\UserControls\SimCommandPluginContainer.resx
Scanning Commander2\SimCommandPluginContainer, Invariant
Writing changes to C:\Shared\Commander\Commander2\UserControls\SimNetworkSettings.xaml
Writing changes to C:\Shared\Commander\Commander2\UserControls\SimNetworkSettings.resx
Scanning Commander2\SimNetworkSettings, Invariant
Writing changes to C:\Shared\Commander\Commander2\UserControls\ProfilePicker.xaml
Writing changes to C:\Shared\Commander\Commander2\UserControls\ProfilePicker.resx
Scanning Commander2\ProfilePicker, Invariant
Writing changes to C:\Shared\Commander\Commander2\UserControls\ProfileBrowser.xaml
Writing changes to C:\Shared\Commander\Commander2\UserControls\ProfileBrowser.resx
Scanning Commander2\ProfileBrowser, Invariant
Writing changes to C:\Shared\Commander\Commander2\UserControls\Settings\AdvancedSettings.xaml
Writing changes to C:\Shared\Commander\Commander2\UserControls\Settings\AdvancedSettings.resx
Scanning Commander2\AdvancedSettings, Invariant
Writing changes to C:\Shared\Commander\Commander2\UserControls\Settings\XSimSettings.xaml
Writing changes to C:\Shared\Commander\Commander2\UserControls\Settings\XSimSettings.resx
Scanning Commander2\XSimSettings, Invariant
Writing changes to C:\Shared\Commander\Commander2\UserControls\VirtualMousePad.xaml
Writing changes to C:\Shared\Commander\Commander2\UserControls\VirtualMousePad.resx
Scanning Commander2\VirtualMousePad, Invariant
Writing changes to C:\Shared\Commander\Commander2\SetupWizard.xaml
Writing changes to C:\Shared\Commander\Commander2\SetupWizard.resx
Scanning Commander2\SetupWizard, Invariant
Writing changes to C:\Shared\Commander\Commander2\UserControls\GameSettings.xaml
Writing changes to C:\Shared\Commander\Commander2\UserControls\GameSettings.resx
Scanning Commander2\GameSettings, Invariant
Writing changes to C:\Shared\Commander\Commander2\UserControls\SimSetupButtonEditor.xaml
Writing changes to C:\Shared\Commander\Commander2\UserControls\SimSetupButtonEditor.resx
Scanning Commander2\SimSetupButtonEditor, Invariant
Writing changes to C:\Shared\Commander\Commander2\UserControls\SSBThemeSettings.xaml
Writing changes to C:\Shared\Commander\Commander2\UserControls\SSBThemeSettings.resx
Scanning Commander2\SSBThemeSettings, Invariant
Writing changes to C:\Shared\Commander\Commander2\UserControls\BottomControls.xaml
Writing changes to C:\Shared\Commander\Commander2\UserControls\BottomControls.resx
Scanning Commander2\BottomControls, Invariant
Scanning Dirt2\Resources, Invariant
Scanning Dirt2Steam\Resources, Invariant
Writing changes to C:\Shared\Commander\Wizard Plugins\DIY SCN5 2DOF Seat\SCN5WizardPlugin\DIYSCN52DOFSeat.vbproj
Writing changes to C:\Shared\Commander\Wizard Plugins\DIY SCN5 2DOF Seat\SCN5WizardPlugin\PluginUI.xaml
Writing changes to C:\Shared\Commander\Wizard Plugins\DIY SCN5 2DOF Seat\SCN5WizardPlugin\PluginUI.resx
Scanning DIYSCN52DOFSeat\PluginUI, Invariant
Scanning DIYSCN52DOFSeat\Resources, Invariant
Scanning F12010Steam\Resources, Invariant
Scanning GamePluginInterface\Resources, Invariant
Scanning Grid\Resources, Invariant
Scanning GridSteam\Resources, Invariant
Scanning GTLegends\Resources, Invariant
Scanning GTR2\Resources, Invariant
Scanning GTRE\Resources, Invariant
Scanning GTRESteam\Resources, Invariant
Scanning IL2\Resources, Invariant
Scanning InputSimulator2\Resources, Invariant
Writing changes to C:\Shared\Commander\iRacingLaunchWrapper\iRacingLauncher.vbproj
Writing changes to C:\Shared\Commander\iRacingLaunchWrapper\MainWindow.xaml
Writing changes to C:\Shared\Commander\iRacingLaunchWrapper\MainWindow.resx
Scanning iRacingLauncher\MainWindow, Invariant
Scanning iRacingLauncher\Resources, Invariant
Scanning iRacingViaLauncher\Resources, Invariant
Scanning LFS\Resources, Invariant
Scanning LockOn\Resources, Invariant
Scanning MessagingInterfaces\Resources, Invariant
Writing changes to C:\Shared\Commander\Wizard Plugins\MotionlessCockpit\MotionlessCockpit\MotionlessCockpit.vbproj
Writing changes to C:\Shared\Commander\Wizard Plugins\MotionlessCockpit\MotionlessCockpit\PluginUI.xaml
Writing changes to C:\Shared\Commander\Wizard Plugins\MotionlessCockpit\MotionlessCockpit\PluginUI.resx
Scanning MotionlessCockpit\PluginUI, Invariant
Scanning MotionlessCockpit\Resources, Invariant
Scanning NASCAR2003\Resources, Invariant
Scanning NASCAR2005\Resources, Invariant
Scanning None\Resources, Invariant
Writing changes to C:\Shared\Commander\WpfKb\OnScreenKeyboard.csproj
Scanning OnScreenKeyboard\Resources, Invariant
Writing changes to C:\Shared\Commander\WpfKb\Controls\FloatingTouchScreenKeyboard.xaml
Writing changes to C:\Shared\Commander\WpfKb\Controls\FloatingTouchScreenKeyboard.resx
Scanning OnScreenKeyboard\FloatingTouchScreenKeyboard, Invariant
Scanning Race07\Resources, Invariant
Scanning Race07Steam\Resources, Invariant
Writing changes to C:\Shared\Commander\SimActionPlugins\rFactorFOV\rFactorFOV.vbproj
Writing changes to C:\Shared\Commander\SimActionPlugins\rFactorFOV\PluginUI.xaml
Writing changes to C:\Shared\Commander\SimActionPlugins\rFactorFOV\PluginUI.resx
Scanning rFactorFOV\PluginUI, Invariant
Scanning rFactorFOV\Resources, Invariant
Scanning rFactorPlugin\Resources, Invariant
Writing changes to C:\Shared\Commander\SimActionPlugins\RunProgram\RunProgram.vbproj
Writing changes to C:\Shared\Commander\SimActionPlugins\RunProgram\PluginUI.xaml
Writing changes to C:\Shared\Commander\SimActionPlugins\RunProgram\PluginUI.resx
Scanning RunProgram\PluginUI, Invariant
Scanning RunProgram\Resources, Invariant
Scanning Settings\Resources, Invariant
Writing changes to C:\Shared\Commander\SimAgent\SimAgent.vbproj
Writing changes to C:\Shared\Commander\SimAgent\MainWindow.xaml
Writing changes to C:\Shared\Commander\SimAgent\MainWindow.resx
Scanning SimAgent\MainWindow, Invariant
Scanning SimAgent\Resources, Invariant
Scanning SimCommandPluginInterface\Resources, Invariant
Writing changes to C:\Shared\Commander\Wizard Plugins\SimXperienceStageIAndII\SCN5WizardPlugin\SimXperienceStageIAndII.vbproj
Writing changes to C:\Shared\Commander\Wizard Plugins\SimXperienceStageIAndII\SCN5WizardPlugin\PluginUI.xaml
Writing changes to C:\Shared\Commander\Wizard Plugins\SimXperienceStageIAndII\SCN5WizardPlugin\PluginUI.resx
Scanning SimXperienceStageIAndII\PluginUI, Invariant
Scanning SimXperienceStageIAndII\Resources, Invariant
Writing changes to C:\Shared\Commander\Wizard Plugins\SimXperienceStageIIIAndIV\SCN5WizardPlugin\SimXperienceStageIIIAndIV.vbproj
Writing changes to C:\Shared\Commander\Wizard Plugins\SimXperienceStageIIIAndIV\SCN5WizardPlugin\PluginUI.xaml
Writing changes to C:\Shared\Commander\Wizard Plugins\SimXperienceStageIIIAndIV\SCN5WizardPlugin\PluginUI.resx
Scanning SimXperienceStageIIIAndIV\PluginUI, Invariant
Scanning SimXperienceStageIIIAndIV\Resources, Invariant
Writing changes to C:\Shared\Commander\SLI\SLI.vbproj
Writing changes to C:\Shared\Commander\SLI\MainWindow.xaml
Writing changes to C:\Shared\Commander\SLI\MainWindow.resx
Scanning SLI\MainWindow, Invariant
Scanning SLI\Resources, Invariant
Scanning WizardPluginInterface\Resources, Invariant
Scanning XSimAPIVB\Resources, Invariant
** WARNING E123: The Target (Commander2\Resources) Resource Name (SX.Resources) is used by multiple targets within the workspace. This may affect your ability to preview this Target. Ensure that the Resource Name to matches the fully qualified type name for the associated control.
** WARNING E123: The Target (Dirt2\Resources) Resource Name (SX.GamePlugins.Resources) is used by multiple targets within the workspace. This may affect your ability to preview this Target. Ensure that the Resource Name to matches the fully qualified type name for the associated control.
** WARNING E123: The Target (Dirt2Steam\Resources) Resource Name (SX.GamePlugins.Resources) is used by multiple targets within the workspace. This may affect your ability to preview this Target. Ensure that the Resource Name to matches the fully qualified type name for the associated control.
** WARNING E123: The Target (F12010Steam\Resources) Resource Name (SX.GamePlugins.Resources) is used by multiple targets within the workspace. This may affect your ability to preview this Target. Ensure that the Resource Name to matches the fully qualified type name for the associated control.
** WARNING E123: The Target (GamePluginInterface\Resources) Resource Name (SX.Resources) is used by multiple targets within the workspace. This may affect your ability to preview this Target. Ensure that the Resource Name to matches the fully qualified type name for the associated control.
** WARNING E123: The Target (Grid\Resources) Resource Name (SX.GamePlugins.Resources) is used by multiple targets within the workspace. This may affect your ability to preview this Target. Ensure that the Resource Name to matches the fully qualified type name for the associated control.
** WARNING E123: The Target (GridSteam\Resources) Resource Name (SX.GamePlugins.Resources) is used by multiple targets within the workspace. This may affect your ability to preview this Target. Ensure that the Resource Name to matches the fully qualified type name for the associated control.
** WARNING E123: The Target (GTLegends\Resources) Resource Name (SX.GamePlugins.Resources) is used by multiple targets within the workspace. This may affect your ability to preview this Target. Ensure that the Resource Name to matches the fully qualified type name for the associated control.
** WARNING E123: The Target (GTR2\Resources) Resource Name (SX.GamePlugins.Resources) is used by multiple targets within the workspace. This may affect your ability to preview this Target. Ensure that the Resource Name to matches the fully qualified type name for the associated control.
** WARNING E123: The Target (GTRE\Resources) Resource Name (SX.GamePlugins.Resources) is used by multiple targets within the workspace. This may affect your ability to preview this Target. Ensure that the Resource Name to matches the fully qualified type name for the associated control.
** WARNING E123: The Target (GTRESteam\Resources) Resource Name (SX.GamePlugins.Resources) is used by multiple targets within the workspace. This may affect your ability to preview this Target. Ensure that the Resource Name to matches the fully qualified type name for the associated control.
** WARNING E123: The Target (IL2\Resources) Resource Name (SX.GamePlugins.Resources) is used by multiple targets within the workspace. This may affect your ability to preview this Target. Ensure that the Resource Name to matches the fully qualified type name for the associated control.
** WARNING E123: The Target (InputSimulator2\Resources) Resource Name (SX.Resources) is used by multiple targets within the workspace. This may affect your ability to preview this Target. Ensure that the Resource Name to matches the fully qualified type name for the associated control.
** WARNING E123: The Target (iRacingLauncher\MainWindow) Resource Name (SX.MainWindow) is used by multiple targets within the workspace. This may affect your ability to preview this Target. Ensure that the Resource Name to matches the fully qualified type name for the associated control.
** WARNING E123: The Target (iRacingLauncher\Resources) Resource Name (SX.Resources) is used by multiple targets within the workspace. This may affect your ability to preview this Target. Ensure that the Resource Name to matches the fully qualified type name for the associated control.
** WARNING E123: The Target (iRacingViaLauncher\Resources) Resource Name (SX.GamePlugins.Resources) is used by multiple targets within the workspace. This may affect your ability to preview this Target. Ensure that the Resource Name to matches the fully qualified type name for the associated control.
** WARNING E123: The Target (LFS\Resources) Resource Name (SX.GamePlugins.Resources) is used by multiple targets within the workspace. This may affect your ability to preview this Target. Ensure that the Resource Name to matches the fully qualified type name for the associated control.
** WARNING E123: The Target (LockOn\Resources) Resource Name (SX.GamePlugins.Resources) is used by multiple targets within the workspace. This may affect your ability to preview this Target. Ensure that the Resource Name to matches the fully qualified type name for the associated control.
** WARNING E123: The Target (MessagingInterfaces\Resources) Resource Name (SX.Resources) is used by multiple targets within the workspace. This may affect your ability to preview this Target. Ensure that the Resource Name to matches the fully qualified type name for the associated control.
** WARNING E123: The Target (MotionlessCockpit\PluginUI) Resource Name (SX.WizardPlugin.PluginUI) is used by multiple targets within the workspace. This may affect your ability to preview this Target. Ensure that the Resource Name to matches the fully qualified type name for the associated control.
** WARNING E123: The Target (MotionlessCockpit\Resources) Resource Name (SX.WizardPlugin.Resources) is used by multiple targets within the workspace. This may affect your ability to preview this Target. Ensure that the Resource Name to matches the fully qualified type name for the associated control.
** WARNING E123: The Target (NASCAR2003\Resources) Resource Name (SX.GamePlugins.Resources) is used by multiple targets within the workspace. This may affect your ability to preview this Target. Ensure that the Resource Name to matches the fully qualified type name for the associated control.
** WARNING E123: The Target (NASCAR2005\Resources) Resource Name (SX.GamePlugins.Resources) is used by multiple targets within the workspace. This may affect your ability to preview this Target. Ensure that the Resource Name to matches the fully qualified type name for the associated control.
** WARNING E123: The Target (None\Resources) Resource Name (SX.GamePlugins.Resources) is used by multiple targets within the workspace. This may affect your ability to preview this Target. Ensure that the Resource Name to matches the fully qualified type name for the associated control.
** WARNING E123: The Target (Race07\Resources) Resource Name (SX.GamePlugins.Resources) is used by multiple targets within the workspace. This may affect your ability to preview this Target. Ensure that the Resource Name to matches the fully qualified type name for the associated control.
** WARNING E123: The Target (Race07Steam\Resources) Resource Name (SX.GamePlugins.Resources) is used by multiple targets within the workspace. This may affect your ability to preview this Target. Ensure that the Resource Name to matches the fully qualified type name for the associated control.
** WARNING E123: The Target (rFactorPlugin\Resources) Resource Name (SX.GamePlugins.Resources) is used by multiple targets within the workspace. This may affect your ability to preview this Target. Ensure that the Resource Name to matches the fully qualified type name for the associated control.
** WARNING E123: The Target (RunProgram\PluginUI) Resource Name (SX.SimCommandPlugin.PluginUI) is used by multiple targets within the workspace. This may affect your ability to preview this Target. Ensure that the Resource Name to matches the fully qualified type name for the associated control.
** WARNING E123: The Target (RunProgram\Resources) Resource Name (SX.SimCommandPlugin.Resources) is used by multiple targets within the workspace. This may affect your ability to preview this Target. Ensure that the Resource Name to matches the fully qualified type name for the associated control.
** WARNING E123: The Target (Settings\Resources) Resource Name (SX.Resources) is used by multiple targets within the workspace. This may affect your ability to preview this Target. Ensure that the Resource Name to matches the fully qualified type name for the associated control.
** WARNING E123: The Target (SimAgent\MainWindow) Resource Name (SX.MainWindow) is used by multiple targets within the workspace. This may affect your ability to preview this Target. Ensure that the Resource Name to matches the fully qualified type name for the associated control.
** WARNING E123: The Target (SimAgent\Resources) Resource Name (SX.Resources) is used by multiple targets within the workspace. This may affect your ability to preview this Target. Ensure that the Resource Name to matches the fully qualified type name for the associated control.
** WARNING E123: The Target (SimCommandPluginInterface\Resources) Resource Name (SX.Resources) is used by multiple targets within the workspace. This may affect your ability to preview this Target. Ensure that the Resource Name to matches the fully qualified type name for the associated control.
** WARNING E123: The Target (SimXperienceStageIAndII\PluginUI) Resource Name (SX.WizardPlugin.PluginUI) is used by multiple targets within the workspace. This may affect your ability to preview this Target. Ensure that the Resource Name to matches the fully qualified type name for the associated control.
** WARNING E123: The Target (SimXperienceStageIAndII\Resources) Resource Name (SX.WizardPlugin.Resources) is used by multiple targets within the workspace. This may affect your ability to preview this Target. Ensure that the Resource Name to matches the fully qualified type name for the associated control.
** WARNING E123: The Target (SimXperienceStageIIIAndIV\PluginUI) Resource Name (SX.WizardPlugin.PluginUI) is used by multiple targets within the workspace. This may affect your ability to preview this Target. Ensure that the Resource Name to matches the fully qualified type name for the associated control.
** WARNING E123: The Target (SimXperienceStageIIIAndIV\Resources) Resource Name (SX.WizardPlugin.Resources) is used by multiple targets within the workspace. This may affect your ability to preview this Target. Ensure that the Resource Name to matches the fully qualified type name for the associated control.
** WARNING E123: The Target (WizardPluginInterface\Resources) Resource Name (SX.Resources) is used by multiple targets within the workspace. This may affect your ability to preview this Target. Ensure that the Resource Name to matches the fully qualified type name for the associated control.
Scan complete -- 0 errors, 38 warnings
_________________
Regards,


Berney Villers Jr.
SimXperience.com
http://www.SimXperience.com
Back to top
View user's profile Send private message Visit poster's website
bvillersjr



Joined: 04 Jan 2010
Posts: 15

PostPosted: Tue Nov 23, 2010 12:47 pm    Post subject: Reply with quote

Pre and post Globalizer sample projects with plugin architecture have been emailed.

THANKS!
_________________
Regards,


Berney Villers Jr.
SimXperience.com
http://www.SimXperience.com
Back to top
View user's profile Send private message Visit poster's website
Infralution



Joined: 28 Feb 2005
Posts: 5027

PostPosted: Tue Nov 23, 2010 11:15 pm    Post subject: Reply with quote

Thanks for sending the sample project - that makes it much easier to see what you are trying to do. There are a couple of different issues:

1. You are using the same root namespace for each of your PlugIn projects, which means that the types names of your WPF windows are the same. This is allowed by .NET because they are defined in different DLLs - however it is a really bad idea to have aliased type names like this within a single application. If you have errors then it will be difficult to ascertain what the issue is and it may screw up any code that relies on reflection. This is what is causing the Globalizer.NET warnings you are seeing. I can see that your plugin mechanism currently relies on the plugin entry point actually having the same type name - I would definitely change this so that each plugin uses its own namespace.

2. The second problem is that the satellite assemblies (eg de\RunProgram.resources.dll) are not being copied into the directory where you are putting your PlugIn assemblies. I see you have changed the output directory for the plugin projects to compiled straight to the plugin directory. The satellite assemblies are being generated (under obj\x86\Debug) however for for some reason they aren't being copied to your output directory.

3. The third issue is that if you do put the satellite assemblies in the Plugins\SimCommands\de directory they aren't found by the .NET resource loader. If you put them under the main exectable directory they are found - but you really want them under the directory containing the plugin assemblies. To fix this you need to add a config file for your application which specifies a "probing" path that includes the Plugins\SimCommands directory. The .NET resource loader will then be able to find the satellite assemblies.

I have hacked the sample project you sent to work around issue 1 (I changed the plugin projects to have different root namespaces and hacked the loading code to load them). I then manually copied the german satellite assemblies into the Plugins\SimCommands directory and added a config file with a probing path. It all then works. I will email you back the modified sample project.
_________________
Infralution Support
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Infralution Support Forum Index -> Globalizer Support All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group