Wednesday, February 26, 2014

Solving "The term 'mongod' is not recognized as the name of a cmdlet, function, script file, or operable program.

Recently, while attempting to install an instance of MongoDB on a Windows Azure VM, I got a nice error.

mongod : The term 'mongod' is not recognized as the name of a cmdlet, function, script file, or operable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

I was in the bin directory of MongoDB at the command prompt and trying to run the database with the following statement -
mongod  --dbpath c:\MongoData\ --logpath C:\MongoLogs\mongolog.db

Ha! I forgot the .\!
mongod  --dbpath c:\MongoData\ --logpath C:\MongoLogs\mongolog.db

should have been
.\mongod  --dbpath c:\MongoData\ --logpath C:\MongoLogs\mongolog.db

I'm adding this here just in case anyone else is spacing out on a Wednesday wondering what in the world is going on when they are trying to run their Mongo databases.

Smooches,

Kila

Thursday, February 20, 2014

Solving System.Web.Http.GlobalConfiguration' does not contain a definition for 'Configure

When upgrading your fantastic Asp.Net Web Api projects to version 2.0, you might come across this wonderful error -

System.Web.Http.GlobalConfiguration' does not contain a definition for 'Configure 
on this line of code -
GlobalConfiguration.Configure(WebApiConfig.Register);

The solution is quick and simple.

1. Open the Package Manager Console for the project with the error.
2. Type in Install-Package Microsoft.AspNet.WebApi.WebHost and hit Enter
3. Rebuild your project and all should be right with the world (or at least right with your project)


Smooches,
Kila