As I continue to explore Blazor I came across an interesting problem – to wit – how does one change the appsettings.json in an Azure Release? Ideally you would want to use the appsettings.QA.json in your QA environment, your appsettings.Dev.json in your dev environment, etc. I could not find any obvious way of doing this.
Were is regular asp.net mvc 5 I could just name the release stage “QA” and the magic of Azure would do the necessary web.config changes (i.e. change web.qa.config to web.config upon release/publish.)
After writing out an email to a friend to ask him how he would do it I came across the answer – on this elmah.io blog post actually. The key is to add an ASPNETCORE_Environment variable to whatever it is you want your environment to be, i.e. if you have appsettings.PublicDev.json you would just need to add an ASPNETCORE_ENVIRONMENT value of “PublicDev” – then release!
I’ve become quite a fan of Test Cafe Studio this past year – I’ve found it to be an excellent mix of automated testing and browser automation. One persistent problem I’ve had is how it treats the datepicker – specifically it works for one month, and then doesn’t work at all (due to the position of the numbers changing on the datepicker).
One convenient way of always selecting the last item in the datepicker is by selecting the last table cell using css, namely by using this as the target of the click event
However, that doesn’t work if there are other tables on the page. The workaround I’ve found is to add the following to the click event. That will find the right box and click it properly.
My only problem with asp.net web api 2 is the inability to pass additional parameters the action, along with a base object. For example – if you want to update a contact, but keep track of where the update request came from (the location is not really part of the contact object) you cannot just add location as an additional parameter in addition to contact.
The only way of doing this is to add a parameter to the route – for example