Style messed up after nuget update.

2019-08-05 05:43发布

问题:

I updated multiple nuget packages of default MVC application and my page style got messed up. Looks like partial styles are being loaded but I am unable to track down what went wrong.

Thanks in advance.

My Navbar before update.

My Navbar after update.

回答1:

Sorry to hear that.

I got the same problem, and it cost me a lot. So frustrating. Fortunately I found the solution.

It is because of the the new version of Bootstrap. To solve the problem, please follow the steps below:

  1. Right click on your project, and go to "Manage NuGet Packages":

  1. Then find bootstrap, click on it. And you can see to the right the version selector. Click on the drop-down button:

  1. Then find an older version of bootstrap (most likely, 3.3.7 will work for you), and select it:

  1. Then click on the "Update" button:

  1. And then you can see that "bootstrap" has changed back to the old version you have selected:

  1. Then refresh you web page, and you can see it has returned to normal.

Don't repeat these steps if you don't have to.