Digital Tool Factory blog - Backend web development in Atlanta GA

The Digital Tool Factory Blog

How to fix 404 errors in web api 2

So – you’ve tried everything and you’re still getting weird 404 errors in 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.

Sep 16

Written By Steve French


How to fix the Compiler Error Message: The compiler failed with error code 255 error

Recently I was deploying some sites, and got the error “Compiler Error Message: The compiler failed with error code 255.” – which looks like this

after some research the cause of, and solution to was all in the nuget package manager.  I had recently added a new project to the solution and some of the more “stock” nuget packages were out of sync with with the newer packages.  Make sure all of the nuget packages are the same version and your problems will be resolved.

Jul 16

Written By Steve French


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 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.

Jul 16

Written By Steve French


How to set the zoom level in Visual Studio 2015

This is non-intuitive, but all you have to do is click in the zoom area – type in the value (in my case 90%) and then click enter, NOT TAB OUT.

That just threw me for ten minutes.

May 16

Written By Steve French


How to fix the System.InvalidOperationException: The property ‘PropertyID’ is part of the object’s key information and cannot be modified problem

Often times when you are using Entity Framework and trying to update objects using the handy


Method you will encounter the error

InvalidOperationException: The property ‘PropertyID’ is part of the object’s key information and cannot be modified problem

After lots of thought I came across the remarkably simple answer, to wit – the PropertyID field is not being EXPLICITLY included in the object you are passing back to the controller.  Just put that in a “HiddenFor and you’re all set.

Nov 15

Written By Steve French


How to fix an odd problem with autonumeric.js

So, you’re using the standard autonumeric.js jquery plugin on your html 5 site – you set up the initialization properties and nothing happens – what is wrong?

First check to make sure that your textbox is of type “text” and not type “number” – that threw me for about ten minutes today.

Apr 15

Written By Steve French


How to fix problems with FoolProof Validation in mvc

For some reason the otherwise delightful nuget Package FoolProof Validation does not work with modern version of the entity framework – rather, the validation works just fine, but it chokes when you try to update the database with entity framework.

The workaround I found was to validate on a view model – and then translate that viewmodel to the actual model, which is then sent to the database.

Mar 15

Written By Steve French


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


to the javascript and everything would be fine. I tried that to no avail. Then I read things more closely and realized that I needed to specify which form I wanted to validate, I changed the code to


And voila! Problem so.

Mar 15

Written By Steve French


How to use query strings in framesets with mvc 5 routing

The problem – I was working on a project that required frames – and I was trying to pass a querystring value to the frameset, as in /FramePage/?page=/SomePageOffSite.aspx – my first thought was to just pass the url of one of the frames to the frameset page as a string.  I made the model for the view a string and attempted to pass it via the usual way in the controller, i.e.

return View(“MyFramedInPage.aspx”);

My thought was that I could just use the Model property as the url, as in

frame src=”@Model” name=”main” noresize scrolling=”auto” marginheight=”0″ marginwidth=”0″

However, whenever I did that MVC would try to find a view with the url of the string (in this case SomePageOffSite.aspx – which did not exist) I was passing in the model.  I eventually figured it out – there is a feature I never use on return View – to wit – you can redirect it to another view simply by passing in the view name (I always used the redirect option) – therefore you can’t ever use a model as a string.  Lesson learned.

Feb 15

Written By Steve French


How to web deploy to a virtual directory or web application in IIS and Visual Studio 2013

For whatever reason you cannot directly deploy (using Visual Studio WebDeploy) to a virtual directory in IIS.  This threw me for a bit until I created both the virtual directory, a separate website, and pointed them both to the same directory.  Then you just deploy to the otherwise unused website, and your web application shows up in your virtual directory

Dec 14

Written By Steve French


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