Taritsyn / WebMarkupMin

The Web Markup Minifier (abbreviated WebMarkupMin) - a .NET library that contains a set of markup minifiers. The objective of this project is to improve the performance of web applications by reducing the size of HTML, XHTML and XML code.
Apache License 2.0
449 stars 48 forks source link

WebMarkupMin.Core is not add to the reference #25

Closed hiromi3 closed 7 years ago

hiromi3 commented 7 years ago

Hello, I am facing a problem that WebMarkupMin.Core is not add to the reference of my MVC project.

I could reproduce this problem below. In VS2015 Community, create a simple MVC project. Then, add these package by nuget. WebMarkupMin.AspNet4.Mvc WebMarkupMin.MsAjax WebMarkupMin.Yui

Then, dependencies are also installed and all the installed packages are below. WebMarkupMin.AspNet.Common 2.2.5.0 WebMarkupMin.AspNet4.Common 2.2.2.0 WebMarkupMin.AspNet4.Mvc 2.2.2.0 WebMarkupMin.MsAjax 2.2.0.0 WebMarkupMin.Yui 2.2.0.0 WebMarkupMin.Core 2.2.2.0

I have been using these packages in my other projects and they worked fine.

But, in the new MVC project I created today, only the WebMarkupMin.Core is not added to the reference in the project. So, the web site could not be show with error. In the nuget package manager window, WebMarkupMin.Core is listed properly in the installed package. Then, I manually added it to the reference, but the web site could not be shown with another error. If you can reproduce the problem, please fix it.

Taritsyn commented 7 years ago

Hello, Hiromi!

I have everything working correctly.

WebMarkupMin.AspNet.Common 2.2.5.0 ... WebMarkupMin.Core 2.2.2.0

This combination of versions of packages is only possible, if upgrade of the WebMarkupMin.AspNet.Common package was not completed. Upgrade the WebMarkupMin.Core package to version 2.2.4, and everything be work.

hiromi3 commented 7 years ago

Taritsyn, Thank you for your reply.

After your reply, I tested again.

I created a simple MVC project. Then, update jQuery, Bootstrap, others by nuget package manager. Install the packages below. WebMarkupMin.AspNet4.Mvc WebMarkupMin.MsAjax WebMarkupMin.Yui

I copied the WebMarkupMinConfig.cs below to my project. https://github.com/Taritsyn/WebMarkupMin/blob/master/samples/WebMarkupMin.Sample.AspNet4.Mvc4/App_Start/WebMarkupMinConfig.cs

I tested the following combinations(Case1), WebMarkupMin.AspNet.Common 2.2.2.0 WebMarkupMin.AspNet4.Common 2.2.0.0 WebMarkupMin.AspNet4.Mvc 2.2.0.0 WebMarkupMin.Core 2.2.3.0 WebMarkupMin.MsAjax 2.2.0.0 WebMarkupMin.Yui 2.2.0.0 => Everything works fine.

Then, I upgraded these packages to latest as shown below(Case2).

WebMarkupMin.AspNet.Common 2.2.5.0 WebMarkupMin.AspNet4.Common 2.2.2.0 WebMarkupMin.AspNet4.Mvc 2.2.2.0 WebMarkupMin.Core 2.2.4.0 WebMarkupMin.MsAjax 2.2.0.0 WebMarkupMin.Yui 2.2.0.0 => WebMarkupMin.Core is removed from Reference.

Then I downgrade the Case2 to the Case1, WebMarkupMin.Core is added to the Reference. But web page could not be shown.

So, currently I can minify and show my web site by Case1 only. You said everything working correctly, but on my simple MVC project, somothing is wrong. I have other ten MVC sites and I used your WebMarkupMin packages with Case1 or older packages. If I upgrade them to latest, I guess the same problem will happen. I hope you can reproduce the problem.

Taritsyn commented 7 years ago

Maybe it's a error in the NuGet Package Manager?

hiromi3 commented 7 years ago

Taritsyn, No error message is shown in Nuget console. I am using a Nuget Package Manager in VS2015 Community. Are you using a same one?

Taritsyn commented 7 years ago

Yes, I use it too. Version 3.5.0.1484.

hiromi3 commented 7 years ago

Nuget version in my VS2015 is below.

install date: 2016/10/20 version: 3.4.4.1321

I checked the automatic update checkbox for Nuget Package Manager. So, VS2015 will automatically update this Nuget Package Manager and I think this is the latest one by Microsoft. Are you installed the latest Nuget Package Manager from nuget.org ?

I can find the latest one below, maybe this is the same one you are using.

Visual Studio 2015 VS 2015 VSIX - latest (v3.5.0)

Taritsyn commented 7 years ago

I installed it via an automatic update. Probably it was removed from the Visual Studio Gallery :-)

Taritsyn commented 7 years ago

Try to install a VS 2015 VSIX - latest (v3.5.0).

hiromi3 commented 7 years ago

Taritsyn,

Thank you for your suggestion. I think the latest Nuget Package Mageger will solve the problem. I will install it later, maybe next month. Because, currently I am developing several MVC sites and your Minifier working fine as far as I use the Case1. If I upgrade Nuget, it may solve the problem, but it may cause other side effect. I think such problem will be very rare, but I want to choose the safest way. If I upgrade the Nuget and test the Case2 again, I will report the result to you.

hiromi3 commented 7 years ago

Taritsyn,

Problem solved!

I have upgraded the Nuget to the latest 3.5.0.1996 . Because I noticed that NuGet 3.4 has many bugs after I searched the internet. Before update, I made a image backup of windows. I tested other my MVC sites and updated WebMarkupMin to the latest, everything works fine.

So the problem completely solved. Thank you for your quick support.