Sharepoint Deployment - sharepoint

I am creating an .STP for a site. But here I have a DLL file in BIN , a XAP file in 12 Hive Folder and few more custom entries in teh Web.Config. How do I include there in the .STP File? When I say IncludeContent when I create a .STP file for the Site , then also the above said things are not getting included.

There is not a way I know of that you can modify an exported STP file.
It is possible you could try renaming the extension to ZIP or CAB, see if you can view the file, check for the presence of the a Manifest.xml file and attempt to modify that way. Have never tried though

A Site Template will not export your web.config settings, 12 hive files or assemblies. All of these can be provisioned through a SharePoint solution file (WSP) though. I would suggest researching how to create and deploy those.

Related

Get which .wsp deployed certain file in sharepoint

Is there a way to see which .wsp deploys a certain file in sharepoint?
I have 30 wsps and I need to find out which of them deployed a given file.
In Windows Explorer rename all of the .wsp files to .cab and you can see the files contained therein. Rename them back to .wsp when you're done and they'll still function properly.

Add "already added" folders to solution?

I created a couple of App_LocalResource folders along with alot of resx files in my MVC4 solution. But when web-deploying to Azure, they aren't recoqnized/found/listed in change sets. None of the folders are pushed to Azure. I can't add them to the solution cause they are already there? I created the folders through VS so i suppose they are included in the solution on creation.
What do I do?
You need to set each of the .resx files' "Copy to Output Directory" property to "Copy if newer" or "Copy always." If you don't change this property for any of the .resx files in an App_LocalResources folder, the entire folder won't show up in your resulting cloud service package, and it won't appear in the Project/csx/Debug/roles/rolename/approot/bin folder when you debug locally either. When you deploy the package without changing each .resx file's "Copy to Output Directory" property, they won't be included in your service package when its uploaded via web deploy.
Also, from a maintainability standpoint, I would recommend looking into using Azure Tables instead of .resx files. They're more flexible in a deployed environment because a Table entity can be changed at runtime if necessary, without redeploying.
I changed Build Action for the resx file to Content instead of Embeded Resource. Embeded Resource complies the resources into a dll where you cant access the usual way.

Deploying a file to the filesystem using MOSS Solutions and Features

I have a .browser file that I need to deploy to the following location:
c:\browsers\
as part of a moss .wsp file. Can I do this in the manifest.xml or as part of a feature?
It is not possible. You can use the wsp solution to deploy any File to
Inside 12 Hive Folder Hierarchy
GAC
bin Folder of the Web Application.
Rest of the other location you need to look out for the custom solution. One option I can say is to use a Feature Installed event and keep it a Farm Feature.

Can I deploy in SharePoint two Web Parts with the same DLL, but two .webpart files, at the same time

Is it possible to have two Web Parts with the same DLL, but two .webpart files, deployed in Sharepoint at the same time?
Background :
I am developing an application that will generate a ".cab" file containing a Web Part (ASP.NET 2.0 Web Part). After that, the user should be able to deploy this ".cab" file in a in a SharePoint server.
My application already includes the DLL of a Web Part. The "behavior" of this Web Part depends on the properties of the ".webpart" file which will be generated at runtime by my application (its content will change depending on certain user choices)
After generating the ".webpart" file, it packages it to a ".cab" file along a Manifest.xml and the DLL.
Imagine that the user creates two "cab" files using my application. And he wants to deploy them into SharePoint.
To test this, I create this two ".cab" files with my app, and in SharePoint I execute:
$> STSADM.EXE -o addwppack <cab filename #1>
$> STSADM.EXE -o addwppack <cab filename #2>
$> STSADM.EXE -o deletewppack <cab filename #1>
After the execution of the third command, the Web Part #2 doesn't have the DLL.
When I installed Web Part #2, SharePoint override the DLL file of Web part #1
The problem here is that the DLL of both files is copied to same location. That location is the Assembly name of DLL. That assembly name cannot be changed without recompiling again (I think).
Is there anyway to deploy two cab files independently, even if they share the same DLL?
You could split your application in 2 parts: a 'library' that contains only your dll. And something that deploys the .webpart file only.
Users must always keep the 'library' part installed..
Also, you might want to look at alternatives from installing a 'wpppack'.. the .webpart file is nothing more than a file in a library in your sites.. may be easier to add that than to install a .cab on the server.
This shouldn't be an issue at all. A .webpart file simply points to a class within an assembly, and provides the configuration values for a specific instance of that class. If you want to have multiple configurations of your webpart available from the webpart gallery, you would go about it by uploading multiple .webpart files which reference the same class. For example, every instance of the listview webpart can be exported to a .webpart file, but they are all using the same webpart class. Check this blog posting for more info on the contents of the .webpart file.

Use an XML File with a Feature

Currently I have a custom Web Part, deployed as a Feature, and it accesses an XML file as follows:
string sUri = #"C:\inetpub\wwwroot\wss\VirtualDirectories\80" + #"\wpresources\links.xml";
ds = new DataSet();
ds.ReadXml(sUri);
What is the correct way to include an XML file as part of a SharePoint Feature deployment?
Load it into the 12 hive under your layouts directory and link to it via
http://[currentsite]/[currentweb]/_layouts/links.xml
. Or add a subdirectory to group all of your file together. e.g.
http://[currentsite]/[currentweb]/[myFeature]/_layouts/links.xml
how do I include it in the Feature
project...?
I am using STSDEV and that automagically puts an entry into the manifest.xml under
<Templates>
e.g.
<TemplateFile Location="LAYOUTS\[myFeature]\links.xml" />
In my mind there are a few correct ways.
The place you want to deploy your xml file I would not pick however.
It would have to be either:
deployed directly in the 12-hive using a solution file (like Nat suggests, I'd use WSPBuilder though)
deployed to the site using a feature ( see: http://msdn.microsoft.com/en-us/library/ms441170.aspx )
this would make the file be pushed into the content database for your code to read.
To my knowledge there is no simple way of deploying files to the InetPub folder for your website. I needed this once to deploy a .browser file and ended up creating a feature receiver that copied the file from the 12-hive into the InetPub folder.
Maybe if you explain what the xml file is for, the answers can be better :)

Resources