About Me

My photo
a Dynamic and Energetic guy.....
Showing posts with label Visual studio. Show all posts
Showing posts with label Visual studio. Show all posts

Monday, February 20, 2012

SPUserCodeV4 service not started when deploying a solution using Visual Studio

When we are trying to deploy a solution using visual studio,
it throws  cannot start "SPUserCodeV4" service.

The solution is simple :)
Go to Services --> Start the service "SharePoint 2010 User Code Host"

Wednesday, September 17, 2008

Create a webpart using Visual Studio

This is an old method, but i think this will be useful if someone has very basic knowledge.
User can add a usercontrol & any code can be in your usercontrol

using System;
using System.Collections.Generic;
using System.Text;
using System.Web;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.WebControls;
using System.Web.UI;

namespace UCAddSubjectNewsWebpart
{
public class UCAddSubjectNews : WebPart
{
UserControl usercontrol;
protected override void Render(System.Web.UI.HtmlTextWriter writer)
{
usercontrol.RenderControl(writer);
}

protected override void CreateChildControls()
{
base.CreateChildControls();
this.Controls.Clear();
usercontrol=(UserControl)this.Page.LoadControl("~/usercontrols/Name_of_user_control.ascx");
this.Controls.Add(usercontrol);
}
}
}

My Masters