Question

How to deploy an Application page of Sharepoint 2010 to another production server.

I've created an Application page of Sharepoint 2010 inside the mapped layout folder. Everything works nicely now in Visual Studio 2010. I can debug it after pressing F5, I can retract it and deploy it with Visual Studio 2010.

But when it comes to deploying it to another production server, I have tons of questions.

  1. Basically I don't know how to deploy it to another production server. My first thought was just copy the pages to the Layout folder of IIS and register the referenced dlls. But after I studied a little bit of deployment, I feel my thought is ugly.
  2. I tried "right clicking" on the project name and "package". The Visual Studio generates a "MyProjectName.wsp" in the bin folder. I used the central administration to upload this wsp file. But when I activate it, it raised an error saying "This solution contains invalid markup or elements that cannot be deployed as part of a sandboxed solution. Solution manifest for solution 'af2f9404-3b39-4f90-87f5-31e14b2f9a9a' failed validation, file manifest.xml, line 6, character 4: The element 'Solution' in namespace 'http://schemas.microsoft.com/sharepoint/' has invalid child element 'TemplateFiles' in namespace 'http://schemas.microsoft.com/sharepoint/'. List of possible elements expected: 'FeatureManifests, ActivationDependencies' in namespace 'http://schemas.microsoft.com/sharepoint/'." It seems that my application is not a sandbox, but I can't change it to a sandbox. Because when I do change it, the Visual Studio tells me "The deployment type "TemplateFile" of file "ApplicationPage1.aspx" in Project Item "Layouts" is not compatible with a Package in a Sandboxed Solution. The Project Item "Layouts" cannot be deployed through a Package in a Sandboxed Solution. Package validation failed."
  3. Besides, even if I can successfully activate the .wsp file, I am not sure if the application page can be added to the Layout folder. Because I don't know how the .wsp file locate and find my application page? It doesn't have the page in it. Can anyone explain a bit on it?

Thanks for your answers.

Était-ce utile?

La solution

1) It's strongly recommended that you use powershell to run your test and production deployments: http://dotnet.sys-con.com/node/1208275

2) Try changing your SharePoint solution to a farm solution and repackaging your wsp.

3) By right clicking on your project in visual studio and adding the mapped Layouts folder the solution packaging handles placing any application pages/user controls that you have in the appropriate directory inside your wsp.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top