How to Deploy a Custom WebPartPage to a specific target site (Web) - sharepoint

I have created a custom web part, let's call is AppPart, and a custom web part page, let's call it AppPage, in the same solution. I changed the AppPage's Elements.xml so that it automatically contains the AppPart when the Feature is activated. This works excellent for my purposes. My problem is that Visual Studio will only allow me deploy the feature to a Site (site collection) scope and I need to deploy this page to a Web (specific web site) scope. From my understanding, this is possible to do but a configuration change has to be made by hand.

using powershell, specify the web application in the command.
Install-SPSolution -Identity <SolutionName> -WebApplication <URLname>
take a look at this link & do a ctrl+F for "To deploy a solution package to a single Web application by using Windows PowerShell"
http://technet.microsoft.com/en-us/library/cc262995(v=office.14).aspx

Related

Opening a web app page using View Definition

In my managed application deployment I deploy an App Service Web app.
Is it possible to use viewDefinition.json to create an Overview Command Action that will open the deployed site in a new tab or link me to that deployed site?
No, frustratingly, it is not. viewDefinition.json artifacts do not allow you to read in any sort of dynamic variable from the deployment, which would be necessary for something like this.

How to get .publishsettings for Web Deployable Web Role?

I enabled the Web Deploy feature for my Web Role and deployed it.
But how can I get hold of the .publishsettings file so I can create a Publishing Profile for it?
This 2 year old article states that it should have been created automatically, but I haven't got that in my profile manager.
Any ideas?
If you are using Visual Studio 2012 or greater, the server explorer to the left will have several Azure items.
Specifically the Windows Azure Compute is what we are looking for, right click on that and say 'add deployment environment'. You will then be prompted with a dialog that allows you to sign in and download publish settings file:
You can get publishsettings file from the following link: https://windows.azure.com/download/publishprofile.aspx
Well, the problem was really behind the keyboard.
So the publishing profile is actually provisioned correctly and automatically to the Web project as the documentation states.
The problem and confusion was that I have a secondary web application in my Solution that I also publish to the same Web Role (referenced as an additional Site in the ServiceDefinition.csdef file).
That Web Project does not get the Publishing Profile, and when I try to create a profile manually, it doesn't work since that (secondary) IIs instance is not configured for Web Deployment.
Oh well, back to the tedious Cloud Service deployment it is...

Feature with WebApplication scope - deploy only to one webapplication

After deploying my new Sharepoint solution, containing a feature with WebApplication scope, I noticed that feature was added to ALL webapplications in the farm.
The solution was deployed to a one particluar webapplication, so I wonder if such behavior is correct. Any way to make feature appear only in WebApplication, solution was deployed to?
How did you deploy from powershell or from central admin? If you deployed from central admin you should have been given a list of web apps to deploy too, but if you did powershell and left off the WebApplication flag (http://technet.microsoft.com/en-us/library/ff607534.aspx), it would have deployed to all of the web apps.
This is unfortunately by design.
The solution is deployed to a single web application, e.g.
but the features are visible on all web applications, i.e.:
Feature /= solution. That means that some elements from the solution (not features) will appear only in the designated web application.
One workaround is to hide the feature so that users cannot activate it.
Check out also these posts:
Is it possible to deploy a solution to a web application so that its features are only visible within this web application?
Creating a solution that deploys to selected WebApplications but copies the assembly to GAC
if the solution deployed to ABC webApp so it won't deployed to another WebApp, if it happened better remove from all WebApp and deploy to ABC webApp by PowerShell command.
-
Praveen

How do I deploy a Web Site (NOT a Web Application) to Azure through Azure Web Role Accelerator?

I have two VS 2010 projects. The 1st is an existing WEB Site while the 2nd is Web project. Should I select b) and ask for Publish I do have the option for Web Deploy to an Azure Web Role Accelerator service and it works fine.
But, I am not able to do the same for the 1st. There is no Publish option in the corresponding context menu, just "Publish Web Site ..." which is the old known one. I do not have the option to web deploy the site.
How can I do it?
Thanks in advance,
You can't publish a web site to Azure directly. Take a look at this for how to convert the site to an application:
http://msdn.microsoft.com/en-us/library/aa983476.aspx
If you really need to publish a web site, you can try:
http://www.davidaiken.com/2010/07/14/how-to-deploy-an-asp-net-web-site-to-windows-azure/

Sharepoint Site Template - Activate dependent features on provisioning

I wish to define a Sharepoint site template that will also include a web part dependent feature. How can I install and activate the web part feature when I provision a site using my custom template?
You can't install a feature when provisioning a site you can only activate it
If your developing a Site Template then you can activate the feature by activating it inside the site you use to create your site template before you save it as a template.
But if this is something that's going to be reused I recommend that you develop a Site Definition instead and in here you can specify which feature to activate both at Site Collection and Site level. You can then package your feature and site definition into the same Solution package then the feature will always be installed when referenced by the Site definition

Resources