My current contract involves working on a project based on Umbraco.
Unit testing Umbraco, can be a bit tricky, especially given the existence of the static ApplicationContext.Current.Services class, which contains handy references to the Umbraco services – provided by a static type! We can’t mock this.
So, I created a little wrapper around this that would allow us to mock the returned service, via an interface
In the implementation, I use reflection to return the underlying service from ApplicationContext.Current:
I ran into this issue when deploying an application that uses the DynamicPDF Rasterizer.
After emailing support, who got back to me within the promised 24 hours, they offered some good suggestions.
The solution for me was to use the installer provided on their download page, which in turn installs the pre-requisites (Visual C++ distributable)
Secondly, I changed the reference in my project to the x64 version of the binary, and changed the build platform target
If you’re using the default JSON formatter (ie- haven’t set another one up) your outputted JSON may look something like this:
Notice the $id element appearing.
What you see as $id is actually a reference used to preserve the handle so that if the element repeats somewhere in the output, it wont print a repeat pf the data, it will just set a “$ref” property of the duplicate to the “$id” of the original.
You can disable this by adding the following code to Application_Start method in the Global.asax file: