A quick write up to document web config changes when deploying to azure using release pipelines in azure devops
So – you want a step by step guide to deploying web apps to azure web apps from azure devops and changing config files in the release pipelines? Look no further. First create the new web.config files, as seen below In the file properties – make sure they are set to “Content” and “Copy Always” […]
How to Get the ID of the logged in user in asp.net mvc web api apicontroller
After much googling, and evening Bing-ing revealed nothing I discovered that for some reason I had the line config.SuppressDefaultHostAuthentication(); In my WebAPIConfig.cs file – I removed that and everything magically worked and I could use User.Identity.GetUserId();
How to fix problems with jquery data tables and a list of objects from ASP.net Web API
The main problem is that data tables does not expect a list of objects, instead it wants a differently formatted json object, something like data: {“Property”: Value} etc Instead it’s getting a pure list, like this [ {“Name”:”Value}, {“Name”:”Value}, {“Name”:”Value}, {“Name”:”Value}, {“Name”:”Value}, ] Solution – list out the values in the columns property of the […]
How to properly clone a project from Visual Studio.com
So – I recently had to clone a site off of Visual Studio.com lately – after some discovery, here are the proper steps Don’t try to do it from Visual Studio 2017 directly – instead just go to the project in VisualStudio.com, and click “Clone Is Visual Studio” – a dialogue window will pop up, […]
The peculiar problem when your entity framework query returns the same row for every record
This one had me confused for a long time, several hours in fact. There were over 8,000 rows in the table, and the for some reason the query was returning the same row 8,000 times. After much rending of garments and gnashing of teeth, I discovered that the table in question (in a sql server […]
How to fix problems with password reset tokens
For some reason, asp.net identity 2 generates password reset tokens that are not property url encoded, but does send them as part of a querystring. Therefore – when you send out the email – the web browser will add spaces to the code, which renders it invalid. The way around that is to base 64 […]
How to do a cross domain json request with jquery and asp.net mvc web api
So – I was trying to request some data from one server from another – not normally a big deal, but the data would vary depending on whether or not the user was logged in or not. I thought just setting up CORS would work (I’m using asp.net mvc web api 2). I thought a […]
How to fix 404 errors in asp.net web api 2
So – you’ve tried everything and you’re still getting weird 404 errors in asp.net web api 2. You’ve tried the 4 main ways of fixing it, and you still get nothing – that was what I did anyway. Finally I started a new project in the solution, and noticed that the problem only occured […]
How to fix the The type initializer for Emgu.CV.CvInvoke threw an exception problem when deploying to azure web apps
I’ve been doing a little Facial Recognition lately – then came across the following error “The type initializer for ‘Emgu.CV.CvInvoke’ threw an exception.” after I deployed to azure web apps. Everything was working fine locally. After doing more digging I realized that the actual .exe files for open cv were not being included in the […]
How to fix problems with Jquery Validate and dynamically generated forms
I recently came across the problem of validating dynamically generated forms with the jquery.validate plugin – everything worked well with the original form, but when there were multiple forms available I got peculiar syntax errors. A quick googling told me to simply add the following code $(“form”).validate(); to the javascript and everything would be fine. […]