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, and the combination f Visual Studio 2017 and Visual Studio.com will take care of everything for you
Visual Studio will then be open to the FOLDER of the newly created project. Note the folder location, then close Visual Studio, and open the solution (.sln) file in that folder (why Visual Studio doesn’t open it immediately I don’t know)
From there, you have to copy over the nuget packages – in the nuget package manager, just enter “Update-Package -reinstall” and they will all be reinstalled or installed (that solution found here – the packages are not copied into source control)
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 2000 database (not created by me)) had no primary key defined.
So – I copy the data into a new table, create a key with the commands
alter table TableInQuestion
add NewIDColumn int identity(1,1)
Delete the empty key field (that was what threw me, there was a column named “Id”, which was not actually and ID column.) rename “NewIDColumn” to “Id”, then point EF to the new table with the data attribute (on the object)
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 encode (and decode) the code as it is sent and interpreted. Below are the Base64 extension methods.
Also – make sure there is a guid (any guid) in the SecurityStamp column in the AspNetUsers table – that will also cause it to claim that the code is invalid.
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 simple jquery .post or .get would do the job, but surprisingly the .get and .post do not send the auth cookie when making the request – you have to use the .ajax features of jQuery, as well as enabling the “SupportsCredentials” part of Cors – the relevant parts look like this
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 when other projects were referenced – and that I had several duplicate controller names.
I.E. Project A had and “AjaxController” and Project B had an “AjaxController”. Everything works fine until you reference Project A from Project B – if you change the name of the controller in Project B the problem goes away and everything works perfectly.
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 web deployment – all that was necessary was to include the x86 and x64 directories in the project in the Solution Explorer in the project and presto! Everything works wonderfully.
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