2017-11-28 12 views
1

Visual Studio 2010を使用して作成されたVSTO Outlookアドインで作業しています。Nuget Package Managerがインストールされていません。私はOutlookのアドインを実行すると、私は例外を取得:ファイルまたはアセンブリを読み込めませんでした 'System.Net.Http、Version = 2.2.29.0'

Could not load file or assembly 'System.Net.Http, Version=2.2.29.0'

私は単純にGitHubのから元のプロジェクトをクローン化しました。 Visual Studioを使用してDebugで実行すると、正常に動作します。しかし、setup.exeを公開してインストールすると、上記の問題が発生します。 System.Net.Httpへの参照は既に追加されています。

Outlookバージョン2007のための私のapp.configファイルは次のとおりです。同じ溶液で

<?xml version="1.0"?> 
<configuration> 
    <configSections> 
    <sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" > 
     <section name="Outlook2007.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" /> 
    </sectionGroup> 
    </configSections> 
    <appSettings> 
    </appSettings> 
    <runtime> 
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> 
     <dependentAssembly> 
     <assemblyIdentity name="System.Net.Http" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/> 
     <bindingRedirect oldVersion="0.0.0.0-2.2.29.0" newVersion="2.2.29.0"/> 
     </dependentAssembly> 
    </assemblyBinding> 
    </runtime> 
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup><userSettings> 
    <PluginOutlook2007.Properties.Settings> 
     <setting name="TokenSettingNeed" serializeAs="String"> 
     <value>else imported dll settings don t work</value> 
     </setting> 
    </PluginOutlook2007.Properties.Settings> 
    </userSettings> 
</configuration> 

、そのために展望2010 app.comfigを対象に第二のプロジェクトは以下があります:

<?xml version="1.0"?> 
<configuration> 
    <configSections> 
    <sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" > 
     <section name="PluginOutlook2010.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" /> 
    </sectionGroup> 
    </configSections> 
    <appSettings> 
    </appSettings> 
    <runtime> 
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> 
     <dependentAssembly> 
     <assemblyIdentity name="System.Net.Http" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/> 
     <bindingRedirect oldVersion="0.0.0.0-2.2.29.0" newVersion="2.2.29.0"/> 
     </dependentAssembly> 
    </assemblyBinding> 
    </runtime> 
    <userSettings> 
    <PluginOutlook2010.Properties.Settings> 
     <setting name="testval" serializeAs="String"> 
     <value>34</value> 
     </setting> 
    </PluginOutlook2010.Properties.Settings> 
    </userSettings> 
</configuration> 

Thenb 3分の1があります(2007年と2010年のプロジェクトで共有されているビジネスロジックは、app.configです)System.Net.Httpという名前空間は、この第3のプロジェクトで実際に使用されています。

<?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="PluginOutlookCommon.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" /> 
     </sectionGroup> 
    </configSections> 
    <userSettings> 
     // some stuff here 
    </userSettings> 
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0" /></startup> 
    <runtime> 
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> 
     <dependentAssembly> 
     <assemblyIdentity name="System.Net.Http" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> 
     <bindingRedirect oldVersion="0.0.0.0-2.2.29.0" newVersion="2.2.29.0" /> 
     </dependentAssembly> 
    </assemblyBinding> 
    </runtime> 
</configuration> 

答えて

1

私はapp.configファイル内

<dependentAssembly> 
    <assemblyIdentity name="System.Net.Http" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> 
     <bindingRedirect oldVersion="0.0.0.0-2.2.29.0" newVersion="2.2.29.0" /> 
    </dependentAssembly> 
</assemblyBinding> 

一部をコメントアウトすることによって、これを解決するために管理。

関連する問題