asp.net.netwebgreaseajaxmin

Extension method IsNullOrWhiteSpace with the same namespace is placed in two assemblies


I have ASP.Net MVC project. The project contains WebGrease, packages.config:

<package id="WebGrease" version="1.5.2" targetFramework="net462" />

Recently because of (https://www.nuget.org/packages/BundleTransformer.MicrosoftAjax/) I added AjaxMin into my packages.config:

<package id="AjaxMin" version="5.14.5506.26202" targetFramework="net461" />

In my code, I am using IsNullOrWhiteSpace() extension method. The method actually exists in these two libraries:

enter image description here

Visual Studio cannot decided which one has to be used.

I cannot remove the reference to WebGrease, because if I do so, I have the following exception:

enter image description here

How can I solve the conflict?

Thank you


Solution

  • You can use string.IsNullOrWhitespace() directly.