No compilation errors when sending a query string

I have an ASP.Net MVC application that compiles dormant files into CSS. In the specific case, if I hit my endpoint

Http: /// account / ResetPassword t = eyJ0eXAiOiJKV1Qi ...

a query string results in a compilation failure warning

directive block with unrecognised format on line 1 in file '~/Content/packageForm.less': []: /beginning of file [1]: @t: eyJ0eXAiOiJKV1Qi...; ^ [2]: @import "setup.less"; directive block with unrecognised format on line 1 in file '~/Content/packageForm.less': []: /beginning of file [1]: @t: eyJ0eXAiOiJKV1Qi...; ^ [2]: @import "setup.less"; directive block with unrecognised format on line 1 in file '~/Content/IE.less': []: /beginning of file [1]: @t: eyJ0eXAiOiJKV1Qi...; ^ [2]: #notes{ directive block with unrecognised format on line 1 in file '~/Content/IE.less': []: /beginning of file [1]: @t: eyJ0eXAiOiJKV1Qi...; ^ [2]: #notes{ 

If I remove the query string parameter "t", compilation errors will not occur.

Anyone have a solution?

Thanks,

Pavel.

+7
css less asp.net-mvc
source share
2 answers

The problem arises because of a possible error in the aimless WebOptimization adapter.

To fix the problem, add disableParameters = "true" to the no-pause settings section in your Web.config, as shown below:

 <dotless minifyCss="false" cache="true" web="true" disableParameters="true" /> 
+5
source share

I just solved the problem by updating the dotless and dotless adapterfor System.Web.Optimization to their latest available versions:

  • dotless : new version 1.5.0
  • dotless adapterfor System.Web.Optimization : new version 1.3.3

See the GitHub article " Empty CSS Generation at Startup " for a history of this issue and resolution, and the related migration request that fixed it.

+4
source share

All Articles