Could not load file or assembly 'Microsoft.AspNet.Web.Optimization.WebForms' or one of its dependencies. The...












0















I can't find anything to resolve this and have tried multiple things.



Task: I am trying to add bundles to an old existing web project. I have added everything I need I believe as I have done the same in a new project and it works.



<webopt:BundleReference runat="server" Path="~/bundles/masterstyle" />


This seems to be where the issue has started with this line above. I installed via nuget the web optimization webforms package which fixed the squiggly line under webopt. However, now, I am getting 2 issues.




  1. BundleReference has a squiggly line saying "Element
    'BundleReference' is not a known element/ This can occur if there is
    a complication error in the Web site, or the web.config file is
    missing".


  2. It also can't seem to find the package I have just installed which
    is "Could not load file or assembly
    'Microsoft.AspNet.Web.Optimization.WebForms' or one of its
    dependencies. The system cannot find the file specified".



If anyone can help resolve this, it would be greatly appreciated. Been stuck on it for 4 hours now.



Here is the likely relevant stuff in my web.config file:



<pages>
<namespaces>
<add namespace="System.Web.Optimization"/>
</namespaces>
<tagMapping>
<add tagType="System.Web.UI.HtmlControls.HtmlForm" mappedTagType="we3.Site.Form" />
</tagMapping>
<controls>
<add assembly="Microsoft.AspNet.Web.Optimization.WebForms" namespace="Microsoft.AspNet.Web.Optimization.WebForms" tagPrefix="webopt"/>
</controls>
</pages>
<compilation debug="true" strict="false" explicit="true" targetFramework="4.0" />









share|improve this question



























    0















    I can't find anything to resolve this and have tried multiple things.



    Task: I am trying to add bundles to an old existing web project. I have added everything I need I believe as I have done the same in a new project and it works.



    <webopt:BundleReference runat="server" Path="~/bundles/masterstyle" />


    This seems to be where the issue has started with this line above. I installed via nuget the web optimization webforms package which fixed the squiggly line under webopt. However, now, I am getting 2 issues.




    1. BundleReference has a squiggly line saying "Element
      'BundleReference' is not a known element/ This can occur if there is
      a complication error in the Web site, or the web.config file is
      missing".


    2. It also can't seem to find the package I have just installed which
      is "Could not load file or assembly
      'Microsoft.AspNet.Web.Optimization.WebForms' or one of its
      dependencies. The system cannot find the file specified".



    If anyone can help resolve this, it would be greatly appreciated. Been stuck on it for 4 hours now.



    Here is the likely relevant stuff in my web.config file:



    <pages>
    <namespaces>
    <add namespace="System.Web.Optimization"/>
    </namespaces>
    <tagMapping>
    <add tagType="System.Web.UI.HtmlControls.HtmlForm" mappedTagType="we3.Site.Form" />
    </tagMapping>
    <controls>
    <add assembly="Microsoft.AspNet.Web.Optimization.WebForms" namespace="Microsoft.AspNet.Web.Optimization.WebForms" tagPrefix="webopt"/>
    </controls>
    </pages>
    <compilation debug="true" strict="false" explicit="true" targetFramework="4.0" />









    share|improve this question

























      0












      0








      0








      I can't find anything to resolve this and have tried multiple things.



      Task: I am trying to add bundles to an old existing web project. I have added everything I need I believe as I have done the same in a new project and it works.



      <webopt:BundleReference runat="server" Path="~/bundles/masterstyle" />


      This seems to be where the issue has started with this line above. I installed via nuget the web optimization webforms package which fixed the squiggly line under webopt. However, now, I am getting 2 issues.




      1. BundleReference has a squiggly line saying "Element
        'BundleReference' is not a known element/ This can occur if there is
        a complication error in the Web site, or the web.config file is
        missing".


      2. It also can't seem to find the package I have just installed which
        is "Could not load file or assembly
        'Microsoft.AspNet.Web.Optimization.WebForms' or one of its
        dependencies. The system cannot find the file specified".



      If anyone can help resolve this, it would be greatly appreciated. Been stuck on it for 4 hours now.



      Here is the likely relevant stuff in my web.config file:



      <pages>
      <namespaces>
      <add namespace="System.Web.Optimization"/>
      </namespaces>
      <tagMapping>
      <add tagType="System.Web.UI.HtmlControls.HtmlForm" mappedTagType="we3.Site.Form" />
      </tagMapping>
      <controls>
      <add assembly="Microsoft.AspNet.Web.Optimization.WebForms" namespace="Microsoft.AspNet.Web.Optimization.WebForms" tagPrefix="webopt"/>
      </controls>
      </pages>
      <compilation debug="true" strict="false" explicit="true" targetFramework="4.0" />









      share|improve this question














      I can't find anything to resolve this and have tried multiple things.



      Task: I am trying to add bundles to an old existing web project. I have added everything I need I believe as I have done the same in a new project and it works.



      <webopt:BundleReference runat="server" Path="~/bundles/masterstyle" />


      This seems to be where the issue has started with this line above. I installed via nuget the web optimization webforms package which fixed the squiggly line under webopt. However, now, I am getting 2 issues.




      1. BundleReference has a squiggly line saying "Element
        'BundleReference' is not a known element/ This can occur if there is
        a complication error in the Web site, or the web.config file is
        missing".


      2. It also can't seem to find the package I have just installed which
        is "Could not load file or assembly
        'Microsoft.AspNet.Web.Optimization.WebForms' or one of its
        dependencies. The system cannot find the file specified".



      If anyone can help resolve this, it would be greatly appreciated. Been stuck on it for 4 hours now.



      Here is the likely relevant stuff in my web.config file:



      <pages>
      <namespaces>
      <add namespace="System.Web.Optimization"/>
      </namespaces>
      <tagMapping>
      <add tagType="System.Web.UI.HtmlControls.HtmlForm" mappedTagType="we3.Site.Form" />
      </tagMapping>
      <controls>
      <add assembly="Microsoft.AspNet.Web.Optimization.WebForms" namespace="Microsoft.AspNet.Web.Optimization.WebForms" tagPrefix="webopt"/>
      </controls>
      </pages>
      <compilation debug="true" strict="false" explicit="true" targetFramework="4.0" />






      vb.net webforms web-project






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 22 '18 at 12:11









      TobyToby

      238




      238
























          1 Answer
          1






          active

          oldest

          votes


















          0














          Install it from nugget: https://www.nuget.org/packages/Microsoft.AspNet.Web.Optimization.WebForms/



          Install-Package Microsoft.AspNet.Web.Optimization.WebForms


          Or you can manually download it from: https://www.nuget.org/api/v2/package/Microsoft.AspNet.Web.Optimization.WebForms/1.1.3



          and add it as reference to your project (unzip first the .nupkg file)






          share|improve this answer
























          • Hi Sergui, It says 'Package 'Microsoft.AspNet.Web.Optimization.WebForms.1.1.3' already exists in project'. Also I can see the System.Web.Optimization.dll in the bin folder if that helps.

            – Toby
            Nov 22 '18 at 13:19













          • can you also see it in the References section of your project?

            – Sergiu Muresan
            Nov 22 '18 at 13:25











          • I can't see a references section of my project. It's a fairly old project I have taken over. I right clicked the project > add reference and I couldn't even find anything under optimization so it looks like I can't add it that way.

            – Toby
            Nov 22 '18 at 13:38













          • you should see something like this in solution explorer: imgur.com/a/PUq6nJm and there you should find a reference to Microsoft.AspNet.Web.Optimization.WebForms

            – Sergiu Muresan
            Nov 22 '18 at 13:45













          • This is all I have for this project... imgur.com/a/Q1gLo8W further down the solution explorer are just basically aspx pages and then the config file. The second picture on that link is it all correctly working in a seperate project I have.

            – Toby
            Nov 22 '18 at 13:52













          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%2f53430740%2fcould-not-load-file-or-assembly-microsoft-aspnet-web-optimization-webforms-or%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          0














          Install it from nugget: https://www.nuget.org/packages/Microsoft.AspNet.Web.Optimization.WebForms/



          Install-Package Microsoft.AspNet.Web.Optimization.WebForms


          Or you can manually download it from: https://www.nuget.org/api/v2/package/Microsoft.AspNet.Web.Optimization.WebForms/1.1.3



          and add it as reference to your project (unzip first the .nupkg file)






          share|improve this answer
























          • Hi Sergui, It says 'Package 'Microsoft.AspNet.Web.Optimization.WebForms.1.1.3' already exists in project'. Also I can see the System.Web.Optimization.dll in the bin folder if that helps.

            – Toby
            Nov 22 '18 at 13:19













          • can you also see it in the References section of your project?

            – Sergiu Muresan
            Nov 22 '18 at 13:25











          • I can't see a references section of my project. It's a fairly old project I have taken over. I right clicked the project > add reference and I couldn't even find anything under optimization so it looks like I can't add it that way.

            – Toby
            Nov 22 '18 at 13:38













          • you should see something like this in solution explorer: imgur.com/a/PUq6nJm and there you should find a reference to Microsoft.AspNet.Web.Optimization.WebForms

            – Sergiu Muresan
            Nov 22 '18 at 13:45













          • This is all I have for this project... imgur.com/a/Q1gLo8W further down the solution explorer are just basically aspx pages and then the config file. The second picture on that link is it all correctly working in a seperate project I have.

            – Toby
            Nov 22 '18 at 13:52


















          0














          Install it from nugget: https://www.nuget.org/packages/Microsoft.AspNet.Web.Optimization.WebForms/



          Install-Package Microsoft.AspNet.Web.Optimization.WebForms


          Or you can manually download it from: https://www.nuget.org/api/v2/package/Microsoft.AspNet.Web.Optimization.WebForms/1.1.3



          and add it as reference to your project (unzip first the .nupkg file)






          share|improve this answer
























          • Hi Sergui, It says 'Package 'Microsoft.AspNet.Web.Optimization.WebForms.1.1.3' already exists in project'. Also I can see the System.Web.Optimization.dll in the bin folder if that helps.

            – Toby
            Nov 22 '18 at 13:19













          • can you also see it in the References section of your project?

            – Sergiu Muresan
            Nov 22 '18 at 13:25











          • I can't see a references section of my project. It's a fairly old project I have taken over. I right clicked the project > add reference and I couldn't even find anything under optimization so it looks like I can't add it that way.

            – Toby
            Nov 22 '18 at 13:38













          • you should see something like this in solution explorer: imgur.com/a/PUq6nJm and there you should find a reference to Microsoft.AspNet.Web.Optimization.WebForms

            – Sergiu Muresan
            Nov 22 '18 at 13:45













          • This is all I have for this project... imgur.com/a/Q1gLo8W further down the solution explorer are just basically aspx pages and then the config file. The second picture on that link is it all correctly working in a seperate project I have.

            – Toby
            Nov 22 '18 at 13:52
















          0












          0








          0







          Install it from nugget: https://www.nuget.org/packages/Microsoft.AspNet.Web.Optimization.WebForms/



          Install-Package Microsoft.AspNet.Web.Optimization.WebForms


          Or you can manually download it from: https://www.nuget.org/api/v2/package/Microsoft.AspNet.Web.Optimization.WebForms/1.1.3



          and add it as reference to your project (unzip first the .nupkg file)






          share|improve this answer













          Install it from nugget: https://www.nuget.org/packages/Microsoft.AspNet.Web.Optimization.WebForms/



          Install-Package Microsoft.AspNet.Web.Optimization.WebForms


          Or you can manually download it from: https://www.nuget.org/api/v2/package/Microsoft.AspNet.Web.Optimization.WebForms/1.1.3



          and add it as reference to your project (unzip first the .nupkg file)







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Nov 22 '18 at 12:45









          Sergiu MuresanSergiu Muresan

          3346




          3346













          • Hi Sergui, It says 'Package 'Microsoft.AspNet.Web.Optimization.WebForms.1.1.3' already exists in project'. Also I can see the System.Web.Optimization.dll in the bin folder if that helps.

            – Toby
            Nov 22 '18 at 13:19













          • can you also see it in the References section of your project?

            – Sergiu Muresan
            Nov 22 '18 at 13:25











          • I can't see a references section of my project. It's a fairly old project I have taken over. I right clicked the project > add reference and I couldn't even find anything under optimization so it looks like I can't add it that way.

            – Toby
            Nov 22 '18 at 13:38













          • you should see something like this in solution explorer: imgur.com/a/PUq6nJm and there you should find a reference to Microsoft.AspNet.Web.Optimization.WebForms

            – Sergiu Muresan
            Nov 22 '18 at 13:45













          • This is all I have for this project... imgur.com/a/Q1gLo8W further down the solution explorer are just basically aspx pages and then the config file. The second picture on that link is it all correctly working in a seperate project I have.

            – Toby
            Nov 22 '18 at 13:52





















          • Hi Sergui, It says 'Package 'Microsoft.AspNet.Web.Optimization.WebForms.1.1.3' already exists in project'. Also I can see the System.Web.Optimization.dll in the bin folder if that helps.

            – Toby
            Nov 22 '18 at 13:19













          • can you also see it in the References section of your project?

            – Sergiu Muresan
            Nov 22 '18 at 13:25











          • I can't see a references section of my project. It's a fairly old project I have taken over. I right clicked the project > add reference and I couldn't even find anything under optimization so it looks like I can't add it that way.

            – Toby
            Nov 22 '18 at 13:38













          • you should see something like this in solution explorer: imgur.com/a/PUq6nJm and there you should find a reference to Microsoft.AspNet.Web.Optimization.WebForms

            – Sergiu Muresan
            Nov 22 '18 at 13:45













          • This is all I have for this project... imgur.com/a/Q1gLo8W further down the solution explorer are just basically aspx pages and then the config file. The second picture on that link is it all correctly working in a seperate project I have.

            – Toby
            Nov 22 '18 at 13:52



















          Hi Sergui, It says 'Package 'Microsoft.AspNet.Web.Optimization.WebForms.1.1.3' already exists in project'. Also I can see the System.Web.Optimization.dll in the bin folder if that helps.

          – Toby
          Nov 22 '18 at 13:19







          Hi Sergui, It says 'Package 'Microsoft.AspNet.Web.Optimization.WebForms.1.1.3' already exists in project'. Also I can see the System.Web.Optimization.dll in the bin folder if that helps.

          – Toby
          Nov 22 '18 at 13:19















          can you also see it in the References section of your project?

          – Sergiu Muresan
          Nov 22 '18 at 13:25





          can you also see it in the References section of your project?

          – Sergiu Muresan
          Nov 22 '18 at 13:25













          I can't see a references section of my project. It's a fairly old project I have taken over. I right clicked the project > add reference and I couldn't even find anything under optimization so it looks like I can't add it that way.

          – Toby
          Nov 22 '18 at 13:38







          I can't see a references section of my project. It's a fairly old project I have taken over. I right clicked the project > add reference and I couldn't even find anything under optimization so it looks like I can't add it that way.

          – Toby
          Nov 22 '18 at 13:38















          you should see something like this in solution explorer: imgur.com/a/PUq6nJm and there you should find a reference to Microsoft.AspNet.Web.Optimization.WebForms

          – Sergiu Muresan
          Nov 22 '18 at 13:45







          you should see something like this in solution explorer: imgur.com/a/PUq6nJm and there you should find a reference to Microsoft.AspNet.Web.Optimization.WebForms

          – Sergiu Muresan
          Nov 22 '18 at 13:45















          This is all I have for this project... imgur.com/a/Q1gLo8W further down the solution explorer are just basically aspx pages and then the config file. The second picture on that link is it all correctly working in a seperate project I have.

          – Toby
          Nov 22 '18 at 13:52







          This is all I have for this project... imgur.com/a/Q1gLo8W further down the solution explorer are just basically aspx pages and then the config file. The second picture on that link is it all correctly working in a seperate project I have.

          – Toby
          Nov 22 '18 at 13:52






















          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%2f53430740%2fcould-not-load-file-or-assembly-microsoft-aspnet-web-optimization-webforms-or%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







          Popular posts from this blog

          android studio warns about leanback feature tag usage required on manifest while using Unity exported app?

          SQL update select statement

          'app-layout' is not a known element: how to share Component with different Modules