I know this Question has been asked before but not in this Context!

I have an WPF-Application(third party) that gives me the possibility to add an XAML ResourceDictionary, so I´ve created a ClassLibrary with a Class that Implements the ICommand Interface and calls a WebService in the Execute-Method.

Now I want to attach this Command to a Control in the Application!

This is my ResourceDictionary:

        <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                        xmlns:iet="clr-namespace:iETSolutions.Enterprise.WorkCenter.Controls;assembly=iETSolutions.Enterprise.WorkCenter.Controls"
                        xmlns:custom="clr-namespace:Custom.Test;assembly=Custom.Test">
                 <Style TargetType="{x:Type Button}">
                    <Style.Triggers>
                        <DataTrigger Binding="{Binding RelativeSource={RelativeSource Self}, Path=Name}" Value="SearchButton">
                            <Setter Property="Template">
                                <Setter.Value>
                                    <ControlTemplate TargetType="{x:Type Button}">
                                        <Grid>
                                            <Button Command="{StaticResource cmd}" CommandParameter="{Binding ElementName=SearchTextBox, Path=Text}">
                                                <Image Source="pack://application:,,,/iETSolutions.Enterprise.WorkCenter;component/Images/PNG/iET_search.png" />
                                            </Button>
                                        </Grid>
                                    </ControlTemplate>
                                </Setter.Value>
                            </Setter>
                        </DataTrigger>
                    </Style.Triggers>
                 </Style>
</ResourceDictionary>

So this works like charm, if I add my Custom.Test.dll to the GAC but if I try to reference the DLL from the app.config the CommandCall fails...

Here is what I tried in the App.config to reference the Assembly:

<runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">    
      <dependentAssembly>
        <assemblyIdentity name="Custom.Test" publicKeyToken="314daa73fc3fb7cf" culture="neutral"/>
        <codeBase version="1.0.0.0" href="http://localhost/Custom/Custom.Test.dll" />
      </dependentAssembly>
    </assemblyBinding>
  </runtime>

Is there any possibility I can get this to Work without the need of putting my Custom DLL in the GAC?

For the RollingOut of the Application it would be much easier to have the refernce in the App.config...

有帮助吗?

解决方案

Did you try putting Custom.Test.DLL in the same directory where application executable lives?

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top