Shazwazza / ClientDependency

DEPRECATED. A library for managing CSS & JavaScript dependencies and optimization in ASP.Net
139 stars 64 forks source link

Field not found: 'ClientDependency.Core.CompositeFiles.Providers.XmlFileMapper.FileMapVirtualFolder' #133

Closed sayeedchoudhury closed 6 years ago

sayeedchoudhury commented 6 years ago

Umbraco version 7.7.8 and Client Dependency 1.9.4

ronaldbarendse commented 6 years ago

Same here, seems the latest release is not backwards compatible... This field is set here: https://github.com/umbraco/Umbraco-CMS/blob/dev-v7/src/Umbraco.Web/WebBootManager.cs#L265.

Shazwazza commented 6 years ago

Can you list steps to replicate? If you install a clean 7.7.8 site, there is no problem

nul800sebastiaan commented 6 years ago

Where do you see this error, what does it break, is your site down, is it just in the logs? What does your CDF configuration look like?

sayeedchoudhury commented 6 years ago

Steps to reproduce:

image

ronaldbarendse commented 6 years ago

Umbraco uses the depreciated static field XmlFileMapper.FileMapVirtualFolder here:

However, the stack trace originates from the WebBootManager, where the field XmlFileMapper.FileMapDefaultFolder is used: https://github.com/umbraco/Umbraco-CMS/blob/dev-v7/src/Umbraco.Web/WebBootManager.cs#L265.

ronaldbarendse commented 6 years ago

Looking at the diffs between ClientDependency 1.9.3 and 1.9.4, it looks like the field is changed to a property, this is not a backwards compatible change!

ronaldbarendse commented 6 years ago

See 'Field to Property Change' from this SO question: https://stackoverflow.com/questions/1456785/a-definitive-guide-to-api-breaking-changes-in-net.

Shazwazza commented 6 years ago

Sorry guys, wasn't thinking about that change from Field to Property, my bad!

I'll be making a new release to un-break this and then will hide this 1.9.4 release, will post back soon

Shazwazza commented 6 years ago

new 1.9.5 version is pushed to nuget which is compatible with all versions of Umbraco

ronaldbarendse commented 6 years ago

The fix in 1.9.5 writes the mapping file to the wrong location, because the constructor could be called before setting the static field/property (FileMapVirtualFolder or FileMapDefaultFolder) and therefore set FileMapFolder to the wrong value.

When used in Umbraco (latest 7.7.9), the file is now written to App_Data\ClientDependency\MACHINENAME-HASH-map.xml, instead of the dynamically set App_Data\TEMP\ClientDependency.

Shazwazza commented 6 years ago

It's not the constructor being called before the field/property is set, it's that I rushed to get this unbreaking change made and didn't fully test running this in 7.7.8/7.7.9 where umbraco uses the new property and this new property's underlying value is reset.

fixing now....

ronaldbarendse commented 6 years ago

Looks like it's fixed in version 1.9.6, thanks!