I was trying to automate the deployment process of the InfoPath form to a SharePoint list and also make the dataconnetion relative to the server and the site collection it is deployed to and i have found a very good links to do that
Posts Tagged ‘Deployment’
Some times You Need a Quick Reference for the deployment operations inside SharePoint
i found that link … it contains a good description of the most used methods for deploying inside SharePoint SharePoint Deploying
I was trying to make a Site template based in Collaboration template with a bit of customization
and then i found that good reference that describes every thing
Site Template and This
SharePoint Search By Default Exclude the Front Pages From The Search
to be able to include them you need to add the following rules
I was Trying to set up a new search crawl inside sharepoint and i got access denied error
how ever i was using the right user and the had the right permissions
that was the solution
- Create a Deployment Project under you solution structure called deployment
- Place all the xml ,xslt ,css and aspx in the right structure under the 12 folder in the deployment project
- Create Projects for code behinds , business or data layers to generate only dlls
- Add this post build events to copy the generated dlls to the GAC folder under your deployment project
cd $(ProjectDir)
Copy "$(TargetPath)" "..\Deployment\GAC"
- Add this post build events to the deployment project to generate the WSP Package and place it under the Deployment project directory
cd $(ProjectDir)
"C:\Program Files\WSPTools\WSPBuilderExtensions\WSPBuilder.exe" -WSPName $(ProjectName).wsp
This parameter “-WSPName $(ProjectName).wsp” generate a WSP Package with the name of the Deployment Project by default it the name of the project directory.
For more parameters help please run the command
"C:\Program Files\WSPTools\WSPBuilderExtensions\WSPBuilder.exe" –Help
- From the solution properties Set the Deployment project to depend on all other projects
so by this you make sure that whenever you are building the package it will contain the latest dlls because other projects will be building by default and copying the dlls to the GAC Folder
- when first time building the project it will automatically create a text file called “solutionid.txt” under the deployment project directory , that file will contain the id of the generated wsp package, it is very recommended to include that txt file into your project and check it in into TFS , so you make sure that all the team members will have the same WSP package id .
Disadvantages
- WSP Builder Includes any file included in the “File” structure of the deployment project and not the “project” structure, so any files that is hidden or not included in the deployment project structure, however placed in the physical structure of the files will still be included ,
So before each build you have to clean up your file structure from any unwanted hidden files.
- The commands lines copying the dlls to the GAC folder will also copy the external referenced dlls that is having the property “Copy Local” to true , and that will end you up deploying dlls that you don’t want to deploy or even deploying dlls that is already included by other packages which is totally not recommended.
So please make sure that any dll reference has the property “Copy local” is set to false.
- sometimes to use the WSPBuilder it is needed to create empty Folders Like "GAC" and empty folders are not physically created in the TFS , and that causes some problems when Using MSBuild tasks to Do a release on the Build Server
must admit that deploying to the /Bin is healthy since any dlls deployed to the GAC directory is granted "Full trust " permissions by default…so the /bin is more secure however it needs more configurations and settings to make sure your dlls are granted the right permissions to work
That required some special way to make the packages work still with the new structure and making it generate the Code Access Security (CAS) Automatically and add it by default to the web.config
so here is a small explanation of what we did
each project have AssemblyInfo.cs under properties folder example
you can set the needed permission for that assembly in that file example
[assembly: SharePointPermission(SecurityAction.RequestMinimum, ObjectModel = true, Unrestricted = true)]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, Execution = true, Unrestricted = true)]
[assembly: WebPartPermission(SecurityAction.RequestMinimum, Connections = true)]
[assembly: FileIOPermission(SecurityAction.RequestMinimum, Unrestricted = true)]
[assembly: EnvironmentPermission(SecurityAction.RequestMinimum, Unrestricted = true)]
[assembly: AspNetHostingPermission(SecurityAction.RequestMinimum, Level = AspNetHostingPermissionLevel.High)]
[assembly: WebPermission(SecurityAction.RequestMinimum, Unrestricted = true)]
[assembly: AllowPartiallyTrustedCallers()]
I use the post build event to copy the generated dlls to the 80/bin folder located in the project structure
and build the WSP package using the WSPBuilder Also from the build events
Which automatically define the dlls located in the 80/bin folder and generate the CAS permissions and add them to the web.config when deployed and it uses the ASsemblyInfo.cs as reference for that
but i know for fact that there is no way we can deploy list event receiver to the bin it have to be deployed to the gac . that is even how it is defined in the SP API
also please consider that any feature scoped to web application its receiver should be deployed to the GAC , or else the package should also be deployed to the central administration site
since the web application features are activated form the central administration site .. it will look into the gac or the bin folder of the CA site for the feature receiver
hope that was clear enough
in one of our projects we created a site collection template by createing the onet.xml file and so on
and we configured the template to activate some features when ever trying to create a new instance of that tempalte..
but some of the features were using some web.config keys of the webapplication that the new site collection is beeing added to..
and amazingly we find out that when ever creating new site collection when it tries to activate the features it uses the web.config of the central administration site instead
I faced this problem when i was deploying to a farms that contains one Central administration (CA) server and to windows front end servers (WFE)
the problem was when trying to upgrade the wsp packages it didn’t execute the timer jobs in the other servers unless i force them by running the command "stsadm.exe -o execadmsvcjobs" on each front end server
The problem was that the timer jobs cached files was not the same on all the farm servers …
so i found out that topic
Which explains how to clear the caches across all servers by
1- Stop the OWSTIMER service on ALL of the MOSS servers in the farm.
2- On the Index server, navigate to %ALLUSERSPROFILE% \Application Data\Microsoft\SharePoint\Config\
3- Edit cache.ini and reset the number in the file to 1.
4- Start the OWSTIMER service on the Index server and wait for XML files to begin to reappear in the directory
5- After you see XML files appearing on the Index server, repeat steps 2, 3 & 4 on the query server(s), waiting for XML files to appear before moving to subsequent servers.
6- After the query servers have all been cleared, proceed to the WFE and Application servers in the farm, following steps 2, 3 & 4. for each server
of course you should make sure that the timer job service is started across all the servers
also notice that the timer job caches some dlls in the path c:\windows\assembly\temp
to know how to view that path please see this link
you can delete the cached dlls by closing the vs stopping the timer job and doing iisreset
Very Good batch file to make the deployment progress easy
@echo off
SET SPDIR=C:\Program Files\Common Files\Microsoft Shared\web server extensions\12
IF [%1]==[-add] ("%SPDIR%\bin\stsadm.exe" -o addsolution -filename %2\%3)
IF [%1]==[-remove] ("%SPDIR%\bin\stsadm.exe" -o deletesolution -name %2)
IF [%1] == [-upgrade] ("%SPDIR%\bin\stsadm.exe" -o upgradesolution -name %3 -filename %2\%3 -immediate -allowGacDeployment)
IF [%1]==[-deploy] (
IF NOT [%4] == [] ("%SPDIR%\bin\stsadm.exe" -o deploysolution -name %3 -immediate -allowGacDeployment -allowCasPolicies -url %4)
IF [%4] == [] ("%SPDIR%\bin\stsadm.exe" -o deploysolution -name %3 -immediate -allowGacDeployment -allowCasPolicies)
"%SPDIR%\bin\stsadm.exe" -o execadmsvcjobs )
IF [%1]==[-retract] (
IF NOT [%3] == [] ("%SPDIR%\bin\stsadm.exe" -o retractsolution -name %2 -immediate -url %3)
IF [%3] == [] ("%SPDIR%\bin\stsadm.exe" -o retractsolution -name %2 -immediate)
"%SPDIR%\bin\stsadm.exe" -o execadmsvcjobs)
:end












