Wednesday, 11 December 2013

SharePoint: Assign Values to the Taxonomy Field

  TaxonomyFieldValue TenderNO = item["Tender No"] as TaxonomyFieldValue;
   TaxonomyField taxonomyField = newWeb.Lists[i].Fields["Tender No"] as TaxonomyField;
                               

                                    try
                                    {                                      
                                        taxonomyField.DefaultValue = TenderNO.ValidatedString;
                                    }
                                    catch
                                    {
                                     
                                        taxonomyField.DefaultValue = String.Empty;
                                    }
                                    taxonomyField.UserCreated = false;
                                    taxonomyField.Update(true);







Tuesday, 10 December 2013

"Unable to load assembly group. The user assembly group provider was unable to provide any user assemblies for the specified assembly group."

Firstly make sure the the sandboxed service run under a managed account that has permissions on the web application.
Secondly, when building the sandboxed solution, make sure you include the assembly in the package.


Monday, 9 December 2013

Changing CPUExecutionTime is having no effect

I see someone is having this problem, because they miss this statement

$uc.ResourceMeasures.Update()



==================================================
# Give our sandboxed solution more resources.
# Worker Process Timeout
$wpe = "900"
# CPU Timeout
$cpu = "900"
# Grab the User Code Service
$uc=[Microsoft.SharePoint.Administration.SPUserCodeService]::Local
# Output current values
Write-Host ""
Write-Host "Current worker process execution timeout is:" $uc.WorkerProcessExecutionTimeout "seconds" -foreground cyan
Write-Host "Current CPU execution timeout is:" $uc.ResourceMeasures["CPUExecutionTime"].AbsoluteLimit "seconds" -foreground cyan
Write-Host ""
Write-Host " ***UPDATING***"
Write-Host ""
# Update worker process execution timeout
$uc.WorkerProcessExecutionTimeout = $wpe
# Update CPU execution time
$uc.ResourceMeasures["CPUExecutionTime"].AbsoluteLimit = $cpu
$uc.ResourceMeasures.Update()
# Update User Code Service
$uc.Update()
# Output new values
Write-Host "New worker process execution timeout is:" $uc.WorkerProcessExecutionTimeout "seconds" -foreground green
Write-Host "New CPU execution timeout is:" $uc.ResourceMeasures["CPUExecutionTime"].AbsoluteLimit "seconds" -foreground green
Write-Host ""
Write-Host "Now go and restart the sandboxed code service on all servers!!!"
Stop-Service SPUserCodeV4
Start-Service SPUserCodeV4

Monday, 2 December 2013

SharePoint 2013: Error Creating Web Application in SharePoint 2013

I recently ran into an issue when creating a new sharepoint 2013 web application. After couple of minutes the dialog box displayed "Internet Explorer cannot display the webpage".  I waited another couple of minutes and I found that the web app is actually created in Central Administration. However, when I ​looked in the Virtual Directory I noticed there was nothing in the folder for my newly created port. 
I think it might be a timing out issue and took these steps to solve the problem
  1. Open IIS Manager and select Application Pools
  2. On the right hand side of the window click Select Application Pool Defaults...
  3. Change the following 3 Process Model time settings
    1. Ping Maximum Response Time
    2. Shutdown Time Limit
    3. Startup Time Limit
      1. I changed all of these from 90 to 900
  4. Do an iis reset