Nuget package client receiving error: 'Could not load file or assembly 'System.Net.Http, Version=4.1.1… or...












0















I have created a nuget package to be used internally within my organisation. Let's call it the Doodle Package. The Doodle Package is dependent on Google AdWords packages. The Google Adwords packages seem to have pulled in a nuget package for System.Net.Http.



I finish building the Doodle Package, push it up to our server and then include it in my project. Everything builds fine, but when I go to run the application an exception is thrown once the Doodle package starts to be used.



 Could not load file or assembly 'System.Net.Http, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.


From Googling around I found that removing this entry from my app.config file resolves the issue:



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


But this hack is far from ideal. The line seems to be recreated (seemingly at random) which breaks the application all over again. On top of that it seems like this is something which should be fixed at the Doodle Package level, rather than relying on the package's client to fix on their end.



To that end I've tried a bunch of stuff in the Doodle package with no change in behaviour:




  • I dropped System.Net.Http package version down to 4.1.1

  • Then 4.0.0

  • Eventually deleted System.Net.Http altogether and removed references to it.


I've also tried removing the System.Net.Http package at the client level or installing different versions there too. The only thing that works (and only temporarily) is removing the dependentAssembly entry in App.Config.



I'm aware that you can turn off automatic binding redirects (https://docs.microsoft.com/en-us/dotnet/framework/configure-apps/how-to-enable-and-disable-automatic-binding-redirection). But this feels a bit nuclear and again relies on the client rather than the Doodle Package author.



One other thing to mention is that the code which now forms the Doodle package was previously part of the same solution as my current project. Before migrating this code into it's own nuget package everything worked fine and dandy.



I'm pretty new to nuget package creation and I'm totally stumped. Using .Net 4.5.2 and currently unable to upgrade. Does anyone have any ideas?










share|improve this question





























    0















    I have created a nuget package to be used internally within my organisation. Let's call it the Doodle Package. The Doodle Package is dependent on Google AdWords packages. The Google Adwords packages seem to have pulled in a nuget package for System.Net.Http.



    I finish building the Doodle Package, push it up to our server and then include it in my project. Everything builds fine, but when I go to run the application an exception is thrown once the Doodle package starts to be used.



     Could not load file or assembly 'System.Net.Http, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.


    From Googling around I found that removing this entry from my app.config file resolves the issue:



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


    But this hack is far from ideal. The line seems to be recreated (seemingly at random) which breaks the application all over again. On top of that it seems like this is something which should be fixed at the Doodle Package level, rather than relying on the package's client to fix on their end.



    To that end I've tried a bunch of stuff in the Doodle package with no change in behaviour:




    • I dropped System.Net.Http package version down to 4.1.1

    • Then 4.0.0

    • Eventually deleted System.Net.Http altogether and removed references to it.


    I've also tried removing the System.Net.Http package at the client level or installing different versions there too. The only thing that works (and only temporarily) is removing the dependentAssembly entry in App.Config.



    I'm aware that you can turn off automatic binding redirects (https://docs.microsoft.com/en-us/dotnet/framework/configure-apps/how-to-enable-and-disable-automatic-binding-redirection). But this feels a bit nuclear and again relies on the client rather than the Doodle Package author.



    One other thing to mention is that the code which now forms the Doodle package was previously part of the same solution as my current project. Before migrating this code into it's own nuget package everything worked fine and dandy.



    I'm pretty new to nuget package creation and I'm totally stumped. Using .Net 4.5.2 and currently unable to upgrade. Does anyone have any ideas?










    share|improve this question



























      0












      0








      0








      I have created a nuget package to be used internally within my organisation. Let's call it the Doodle Package. The Doodle Package is dependent on Google AdWords packages. The Google Adwords packages seem to have pulled in a nuget package for System.Net.Http.



      I finish building the Doodle Package, push it up to our server and then include it in my project. Everything builds fine, but when I go to run the application an exception is thrown once the Doodle package starts to be used.



       Could not load file or assembly 'System.Net.Http, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.


      From Googling around I found that removing this entry from my app.config file resolves the issue:



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


      But this hack is far from ideal. The line seems to be recreated (seemingly at random) which breaks the application all over again. On top of that it seems like this is something which should be fixed at the Doodle Package level, rather than relying on the package's client to fix on their end.



      To that end I've tried a bunch of stuff in the Doodle package with no change in behaviour:




      • I dropped System.Net.Http package version down to 4.1.1

      • Then 4.0.0

      • Eventually deleted System.Net.Http altogether and removed references to it.


      I've also tried removing the System.Net.Http package at the client level or installing different versions there too. The only thing that works (and only temporarily) is removing the dependentAssembly entry in App.Config.



      I'm aware that you can turn off automatic binding redirects (https://docs.microsoft.com/en-us/dotnet/framework/configure-apps/how-to-enable-and-disable-automatic-binding-redirection). But this feels a bit nuclear and again relies on the client rather than the Doodle Package author.



      One other thing to mention is that the code which now forms the Doodle package was previously part of the same solution as my current project. Before migrating this code into it's own nuget package everything worked fine and dandy.



      I'm pretty new to nuget package creation and I'm totally stumped. Using .Net 4.5.2 and currently unable to upgrade. Does anyone have any ideas?










      share|improve this question
















      I have created a nuget package to be used internally within my organisation. Let's call it the Doodle Package. The Doodle Package is dependent on Google AdWords packages. The Google Adwords packages seem to have pulled in a nuget package for System.Net.Http.



      I finish building the Doodle Package, push it up to our server and then include it in my project. Everything builds fine, but when I go to run the application an exception is thrown once the Doodle package starts to be used.



       Could not load file or assembly 'System.Net.Http, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.


      From Googling around I found that removing this entry from my app.config file resolves the issue:



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


      But this hack is far from ideal. The line seems to be recreated (seemingly at random) which breaks the application all over again. On top of that it seems like this is something which should be fixed at the Doodle Package level, rather than relying on the package's client to fix on their end.



      To that end I've tried a bunch of stuff in the Doodle package with no change in behaviour:




      • I dropped System.Net.Http package version down to 4.1.1

      • Then 4.0.0

      • Eventually deleted System.Net.Http altogether and removed references to it.


      I've also tried removing the System.Net.Http package at the client level or installing different versions there too. The only thing that works (and only temporarily) is removing the dependentAssembly entry in App.Config.



      I'm aware that you can turn off automatic binding redirects (https://docs.microsoft.com/en-us/dotnet/framework/configure-apps/how-to-enable-and-disable-automatic-binding-redirection). But this feels a bit nuclear and again relies on the client rather than the Doodle Package author.



      One other thing to mention is that the code which now forms the Doodle package was previously part of the same solution as my current project. Before migrating this code into it's own nuget package everything worked fine and dandy.



      I'm pretty new to nuget package creation and I'm totally stumped. Using .Net 4.5.2 and currently unable to upgrade. Does anyone have any ideas?







      c# nuget






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 21 '18 at 13:20







      EmmaO91

















      asked Nov 21 '18 at 11:50









      EmmaO91EmmaO91

      83111




      83111
























          0






          active

          oldest

          votes











          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53411439%2fnuget-package-client-receiving-error-could-not-load-file-or-assembly-system-n%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes
















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53411439%2fnuget-package-client-receiving-error-could-not-load-file-or-assembly-system-n%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          這個網誌中的熱門文章

          Tangent Lines Diagram Along Smooth Curve

          Yusuf al-Mu'taman ibn Hud

          Zucchini