Archive

Posts Tagged ‘Deployment’

How to fix the issue Unrecognized attribute ‘targetFramework’.

October 2, 2014 Leave a comment

Issue:

Recently, I am having issues with deploying asp.net mvc 4 application to Windows Server 2008 R2.After add the necessary role and features and I setup an application in IIS. However , I received the following error message: Unrecognized attribute ‘targetFramework’.

Solution:

It turns out that this is because App pool is not configured to use .net 4.0, after changing from .net 2.0 to .net 4.0. It works like a charm.


Note if .net v4.0x does not show up under .NET Framework version dropdown, you can need to install .net or re-register .NET 4 with IIS, you can check my previous blogpost to learn how to do it.

Advertisements

Salesforce deployment best practice?

October 1, 2014 1 comment

I am very new to Salesforce and as you can see from my blog, I am .Net developer and more specifically a SharePoint developer. In salesforce , there is no clear strategy for release management and I am asking the wider Salesforce community to help me to see if the proposed release plan is OK.

The current deployment model we use are multiple Sandbox environments and changeset to deploy change from Dev >> Test>>Preprod>>Prod . Here are the challenges I understand so far in Salesforce deployment.

  1. You cannot rollback after a changeset is successfully deployed
  2. Creating changeset is very manual

To address the first issue (You cannot rollback after a changeset is successfully deployed):

  1. Backup the data by scheduling a weekly data export (my question would be , how we can use the data export to restore the data)
  2. Backup the apex code (trigger, visual force…), we can use eclipse to deploy these changes so that the apex code can be rolled back.
  3. Document all the schema changes(custom object, custom fields, custom labels, tabs …) , if we do need rolled back we can manually delete all those changes..

To address second issue (Creating changeset is very manual)

We are looking at using Salesforce IDE or Salesforce migration tool to deploy the changes from environment to environment.

Reference:

Deploy Force.com Applications to Production Faster,

Using the Force.com IDE to Deploy Apex

How to fix: Handler “PageHandlerFactory-Integrated” has a bad module “ManagedPipelineHandler” in its module list

July 21, 2014 Leave a comment

Issue:

Recently, I am having issues with deploying asp.net mvc 4 application to Windows Server 2008 R2.After add the necessary role and features and I setup an application in IIS. However , I received the following error message: PageHandlerFactory-Integrated” has a bad module “ManagedPipelineHandler” in its module list

 


Solution:

It turns out that this is because ASP.Net was not completely installed with IIS even though I checked that box in the “Add Feature” dialog.

 

To fix this, I simply ran the following command at the command prompt

%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_regiis.exe -i

If I had been on a 32 bit system, it would have looked like the following:

%windir%\Microsoft.NET\Framework\v4.0.21006\aspnet_regiis.exe –i

 

References:

http://stackoverflow.com/questions/6846544/how-to-fix-handler-pagehandlerfactory-integrated-has-a-bad-module-managedpip

How to fix “Error: This solution contains no resources scoped for a Web application and cannot be deployed to a particular Web application.”

November 17, 2012 Leave a comment

Problem:

When I try to deploy my custom wsp solution to a specific web application, I got the error below:

This solution contains no resources scoped for a Web application and cannot be deployed to a particular Web application.

Analysis:

The error message itself explains why you cannot deploy the solution to a web application. However if you do not like to deploy the solution to all the web applications and only like to deploy your solution to a specific application , you need to change the solution settings Assembly Deployment Target from GlobalAssemblyCache to WebApplication.

From:

TO:

Solution:

After you change the Assembly Deployment Target and run the script again, you will have the solution deployed successfully.
References:

http://blogs.msdn.com/b/jjameson/archive/2007/06/17/issues-deploying-sharepoint-solution-packages.aspx

How to write PowerShell code part 1 (Using external xml configuration file)

May 13, 2012 1 comment

In this post, I will show you how to use external xml file with PowerShell. The advantage for doing so is that you can avoid other people to open up your PowerShell code to make the configuration changes; instead all they need to do is to change the xml file. I will refactor my site creation script as an example; you can download the script here and refactored code here.

1. As you can see below, I hard code all the variables in the script itself.


$url = "http://ybbest"
$WebsiteName = "Ybbest"
$WebsiteDesc = "Ybbest test site"
$Template = "STS#0"
$PrimaryLogin = "contoso\administrator"
$PrimaryDisplay = "administrator"
$PrimaryEmail = "administrator@contoso.com"
$MembersGroup = "$WebsiteName Members"
$ViewersGroup = "$WebsiteName Viewers"

2. Next, I will show you how to manipulate xml file using PowerShell. You can use the get-content to grab the content of the file.

[xml] $xmlconfigurations=get-content .\SiteCollection.xml

3. Then you can set it to variable (the variable has to be typed [xml] after that you can read the content of the xml content, PowerShell also give you nice IntelliSense by press the Tab key.

[xml] $xmlconfigurations=get-content .\SiteCollection.xml
$xmlconfigurations.SiteCollection
$xmlconfigurations.SiteCollection.SiteName

4. After refactoring my code, I can set the variables using the xml file as below.


#Set the parameters
$siteInformation=$xmlinput.SiteCollection
$url = $siteInformation.URL
$siteName = $siteInformation.SiteName
$siteDesc = $siteInformation.SiteDescription
$Template = $siteInformation.SiteTemplate
$PrimaryLogin = $siteInformation.PrimaryLogin
$PrimaryDisplay = $siteInformation.PrimaryDisplayName
$PrimaryEmail = $siteInformation.PrimaryLoginEmail
$MembersGroup = "$WebsiteName Members"
$ViewersGroup = "$WebsiteName Viewers"

How to write PowerShell code part 1
How to write PowerShell code part 2
How to write PowerShell code part 3
How to write PowerShell code part 4

How to find out which process actually locks your dll when SharePoint Solution deployment failed

March 1, 2012 Leave a comment

When your SharePoint Solution package include third party or external dlls , you will often see your solution fail to deploy due to the locking of the dlls. Today I will show you how to find which process locks your dlls using Process Explorer.

1. Here is an example that your solution fails to deploy due to dll being locked.

2. Start the explorer by double click the procexp.exe

3. From the find tab click Find Handle or DLL

4.Type the your dll name and click Search

5. I can see all the processes that use my dlls at the moment, it looks like the iis , visual studio and SharePoint timer services might be the trouble. From my experience , it could be Visual studio.

6. Close visual studio and redeploy my solution, it works like charm. Re-search the dll, you can see Visual studio is not in the results.

How to fix “The database is in single-user mode, and a user is currently connected to it.”

February 21, 2012 Leave a comment

Recently, when I running the buildscript for a SharePoint. I get the following error message:

[exec] Remove-SPSite : Cannot open database “WSS_Content_YBBEST_AAA_2013′ requested by the login. The login failed.

[exec] Login failed for user ‘YBBEST\administrator’.

Then I went to the SQL Management studio, the database is in Single user mode, not sure how it ends up in that state. When I try to delete the database then I got the following errors:

Changes to the state or options of database ‘WSS_Content_YBBEST_AAA_2013’ cannot be made at this time. The database is in single-user mode, and a user is currently connected to it.

Guess, how to fix the issue?

Restart your SQL Server to fix the problem.

You can restart SQL Server by right click the server in your Management studio and choose restart.