July 2018 - Digital Tool Factory blog July 2018 - Digital Tool Factory blog

The Digital Tool Factory Blog

The simple way to force redirect to https in web config files

There are two things:
1. Just insert this code in the web.release.config

<system.webServer xdt:Transform=”Insert”>
<rewrite>
<rules>
<rule name=”Force HTTPS” enabled=”true”>
<match url=”(.*)” ignoreCase=”false” />
<conditions>
<add input=”{HTTPS}” pattern=”off” />
</conditions>
<action type=”Redirect” url=”https://{HTTP_HOST}/{R:1}” appendQueryString=”true” redirectType=”Permanent” />
</rule>
</rules>
</rewrite>
</system.webServer>

2. Then make sure that the Url Rewrite module is installed in IIS – if that module is not installed you will get perplexing, unhelpful error messages


24
Jul 18


Written By Steve French

 

How to fix the problem of undeletable characters in json strings in Visual Studio

So – you’re cruising around in web services, pulling data from various sources and your want to deserialize a string into an object, however, you can’t seem to remove extra quotations and escape characters. In fact everything you see looks like this

“{\”DataThingObject\”:{\”DataThingOneID\”:89,\”Status\”:\”Active\”,\”UserId\”:89,

and the \ and ” don’t go away, no matter how much text manipulation you do.

There actually isn’t a problem, you’re just looking at the string in the debugger, which adds the escape charachters for some reason – if you save it to a text or json file you will see that your json files are perfectly formatted.


06
Jul 18


Written By Steve French

 




Copyright 2011 Digital Tool Factory. All Rights Reserved. Powered by raw technical talent. And in this case, WordPress.