Tuesday, 30 November 2010

Sharepoint Solution Debug or Release build

Today I just come across very unusual sharepoint development snag. I was adding some functionality to a exsiting sharepoint site. I found that the project is releasing 'Debug' build configuration. So I changed the build to a 'Release' build configuration. Compiled successfully but build failed with following error message:
"mySite.wsp" does not appear to be a valid upgrade for solution "mySite.wsp".The two solutions must have the same resource types (global or Web-application scoped)

Compared the new manifest file with old manifest file, Bang! they are hugely different. New manifest file has DeploymentTarget: GlobalAssemblyCache and it does not have CodeAccessSecurity section at all.

Confused! 've not changed anything in the solution. Still gone through everything, to check what could be changing the deployment target.

So rolled back my change(Release->Debug) and rebuilt. Build and deployment successful without a noise.

I'm using wspbuilder to build sharepoint solution from Visual Studio(VS) project.

The default behaviour of WSPBuilder is as follows:
Building sharepoint solution from VS Solution with Build configuration = Debug generates Sharepoint solution with DeploymentTarget=WebApplication
And similarly:
VS Solution with Build configuration = Release generates Sharepoint solution with DeploymentTarget=GlobalAssemblyCache


No comments:

Post a Comment