Cannot start service SPUserCodeV4 on computer

Posted by Troy on August 6, 2010 under .net, IT, Microsoft, SharePoint, Visual Studio, Web | Read the First Comment

This week I was creating my first SharePoint 2010 Sandboxed solution using Visual Studio 2010.  I have successfully built and deployed other SharePoint projects on the server but I always used Farm based solution due to the requirements.

When I built the Sandboxed solution the project would build and package without any errors but when I tried to deploy it to the SharePoint site the following error occurred:

Error    1    Error occurred in deployment step ‘Activate Features’: Cannot start service SPUserCodeV4 on computer ‘SERVERNAME’ 0    0    SP2010Dev1

The error can be easily resolved by starting the Microsoft SharePoint Foundation Sandboxed Code Service which can be accessed through the Central Administration site in SharePoint.   Open the Central Administration site and go to System Settings and click on Manage Service on server:

image

Check to see if Microsoft SharePoint Foundation Sandboxed Code Service  is running, it should be stopped :

image

Start the service and try deploying the Sandboxed solution.

Thanks to Sergey Hyper Kravchenko for his post on the MSDN SharePoint discussion forum:

error occurred in deployment step ‘retract solution’ cannot start service SPUserCodeV4 on this computer

Troy

Running Visual Studio 2010 as Administrator

Posted by Troy on August 5, 2010 under .net, IT, Microsoft, Visual Studio | Be the First to Comment

If you are using Windows 7 or Windows Server 2008 and you try to create a project once Visual Studio has been opened you may receive the following message:

This task requires the application to have elevated permissions

image

If this occurs you have two options:

Right-click on the Visual Studio 2010 Shortcut

Hold down the SHIFT key and right click the shortcut:

image

Select Run as administrator and when you try to create project it will work.   The downside of this approach is that you have to do this every time you want to run Visual Studio.

Set the Visual Studio Shortcut Properties to Run As Administrator

Hold down the SHIFT key and right click the shortcut:

image 

Select properties and then click on the  Compatibility tab.  In the Privilege level section select the Run this program as an administrator check box.

image 

Click Apply and when you double click the shortcut next time the program will run with Administrative privileges.   However, you will receive a User Account Control notification when the program is run:

image

Troy

Update requires a valid UpdateCommand when passed DataRow collection …

Posted by Troy on October 29, 2009 under .net, csharp, Microsoft | Be the First to Comment

 

I have been creating an application for work over the last couple of days which requires ADO.Net.  I work in the Business Intelligence field so I do not code verify often unless I need a custom script for an SSIS package.  Most of the Microsoft BI products just require a solid understanding of SQL or MDX and of course the customers business requirements.   While creating the application I ran into the following error when updating the databases with changes in the dataset.  I am using Visual Studio 2008 Express Edition and the database is a Compact Database. 

I only received the error when I tried to update a record in the database.  If I added a new record (INSERT) and saved my changes the application worked fine.  Below is a screenshot of the simple app:

image 

When you hit the save button it executes the following code:

try
{
 
this.Validate();
  this.rulesBindingSource.EndEdit();
  this.rulesTableAdapter.Update(this.ruleEngineDataSet.Rules);

  MessageBox.Show("Update successful!");

}

catch (System.Exception ex)
{
  MessageBox.Show("Update failed:\n" + ex.Message + "\n" + ex.StackTrace );

}

I placed a breakpoint on: this.Validate(); line.  When I ran the program  the program failed on: this.rulesTableAdapter.Update(this.ruleEngineDataSet.Rules);.  Below is a print screen of the message:

 

image 

The issue is with the TableAdapter.  There was no UpdateCommand (which is mentioned in the error message) or DeleteCommand for the TableAdapter:

 image

Create a new UpdateCommand by click (new) in the dropdown box.  You can use the query designer to create the update statement for the CommandText property:

image

Once the the CommandText property was set for the UpdateCommand the program worked. Below is a link to the issue found on msdn forums:

http://social.msdn.microsoft.com/Forums/en-US/Vsexpressvcs/thread/6d4de721-7571-49ca-a1fc-8689ec19a94e/

Troy