Live Smooth Streaming: Managing Publishing Points Programmatically on IIS Media Services 3.0
Many people have been asking me how to manage publishing point programmatically on IIS Media Services 3.0 (instead of the 2.0 bits, as I explained in this post)
So, I started to dig and I came up with the following code:
// Live Streaming Section Pathconst string LiveStreamingSectionPath = “system.webServer/media/liveStreaming“;// Change this settings with your values// Site namestring siteName = “Default Web Site“;// Application namestring applicationName = “/SmoothStreaming“;// Publishing point filenamestring fileName = “LiveSmooth.isml“;ServerManager serverManager = new ServerManager();// Gets the site from IISSite site = serverManager.Sites[siteName];// Gets the application from IISApplication application = site.Applications[applicationName];// Gets the LiveStreamingSection from the site configurationConfigurationSection section = site.GetWebConfiguration().GetSection(LiveStreamingSectionPath);// Gets the ConfigurationMethodInstance to get the available publishing pointsConfigurationMethodInstance instance = section.Methods["GetPublishingPoints"].CreateInstance();// Sets the input parameters of the GetPublishingPoints methodinstance.Input["siteName"] = site.Name;instance.Input["virtualPath"] = applicationName;// Executes the methodinstance.Execute();// Gets the PublishingPointCollection type.Type type = Type.GetType("Microsoft.Web.Management.Media.LiveStreaming.PublishingPointCollection, Microsoft.Web.Management.Media.LiveStreaming“);// Gets the PublishingPointCollection associated with the method outputConfigurationElement collection = instance.Output.GetCollection(type);// Gets an item from the collection using the Publishing Point fileName as parameter.// The item is of type PublishingPoint.object pubPoint = collection.GetType().InvokeMember("Item“,BindingFlags.Public | BindingFlags.GetProperty | BindingFlags.Instance,null, collection, new object[] { fileName }, null);// Invokes the desired method of the Publishing Point.// In this case we are calling the Start method (others supported functions are “Shutdown” and “Stop”)pubPoint.GetType().InvokeMember("Start“,BindingFlags.Instance | BindingFlags.Public | BindingFlags.InvokeMethod,null, pubPoint, null);
Remember that in order to use the previous code, you must have references to the following assemblies:
- Microsoft.Web.Administration.dll (can be found at IIS Directory %windir%\System32\inetSrv)
- Microsoft.Web.Management.Media.LiveStreaming.dll (can be found in the GAC after installing the Live Smooth Streaming bits)
Hope this helps.
Happy streaming!


client development technologies such as Silverlight. And in the last few weeks, I started to look to some of the new 
So, if we want to the start the LiveSmoothStream publishing point associated to the SmoothStreaming application from the Default Web Site, we should call the ExecuteRscaFunction method in this way: