I have referred one of the page on MSDN https://msdn.microsoft.com/en-us/library/gg327924.aspx. Here they convert a content into binary format and then it create a particular web resource.
To refer this my html are stored on CRM field entity and i have set the crm field html to a web resource content, i have specified the code below.
Entity TileConfiguration = service.Retrieve("livetile_tileconfiguration", entity.Id, new ColumnSet(true));
string JSContent = TileConfiguration.Attributes["livetile_jscontent"].ToString();
string HTMLContent = TileConfiguration.Attributes["livetile_htmlcontent"].ToString();
//Set the Web Resource properties
WebResource wr = new WebResource
{
Content = JSContent + HTMLContent, // Content set
DisplayName = "Test1",
Description ="Sample Test",
Name = "livetile_" +"test1",
LogicalName = WebResource.EntityLogicalName,
WebResourceType = new OptionSetValue(1)
};
CreateRequest cr = new CreateRequest
{
Target = wr
};
service.Execute(cr);
The tile got created successfully but when i am clicking on text editor on created web resource. it shows an error. What possibly the cause of this error.