VoiceModel Now Available on NuGet
VoiceModel is now available on NuGet, which is the recommended method for starting a VoiceModel project in Visual Studio. NuGet handles all of the dependencies and if you follow these instruction you will have a working "Hello World" voice application as a starting point.
To install VoiceModel with NuGet just create an Empty MVC 4 project. Remove the Global.asax file and remove App_Start\RouteConfig.cs file. Right click on References, select "Manage NuGet Packages...", and search for VoiceModel. Select the VoiceModel package and install. When installation is complete you will have a running "Hello World" example that will run on any VoiceXML compatible IVR and Tropo.
The reason for deleting the RouteConfig.cs and Global.asax file is that NuGet does not have an easy method for modifying existing source files yet. If you do not delete these files you will have to modify them yourself to get the application to work. The modifications are minor. The RouteConfig.cs file is modified so that the starting action is "StateMachine". This is useful if you are trying to do some minor testing/debugging in a web browser. Here is the line that is modified.
Since an empty MVC 4 project is created the NuGet install will drop a source file for a Home Controller that contains the Hello World Application.
The Global.asax is modified to register VoiceModel with the application. There are only two lines added to this file. First you need to add a using statement.
And then add the following line to the Application_Start method.
That is all there is to getting a working VoiceModel project going. Try it out.
To install VoiceModel with NuGet just create an Empty MVC 4 project. Remove the Global.asax file and remove App_Start\RouteConfig.cs file. Right click on References, select "Manage NuGet Packages...", and search for VoiceModel. Select the VoiceModel package and install. When installation is complete you will have a running "Hello World" example that will run on any VoiceXML compatible IVR and Tropo.
The reason for deleting the RouteConfig.cs and Global.asax file is that NuGet does not have an easy method for modifying existing source files yet. If you do not delete these files you will have to modify them yourself to get the application to work. The modifications are minor. The RouteConfig.cs file is modified so that the starting action is "StateMachine". This is useful if you are trying to do some minor testing/debugging in a web browser. Here is the line that is modified.
defaults: new { controller = "Home", action = "StateMachine", id = UrlParameter.Optional }
Since an empty MVC 4 project is created the NuGet install will drop a source file for a Home Controller that contains the Hello World Application.
The Global.asax is modified to register VoiceModel with the application. There are only two lines added to this file. First you need to add a using statement.
using VoiceModel;
And then add the following line to the Application_Start method.
VoiceViewEngine.Register(ViewEngines.Engines);
That is all there is to getting a working VoiceModel project going. Try it out.
Comments
Post a Comment