Deploy Client Web Part globally using SPFx on SharePoint 2016 (On Prem) - sharepoint

I have succedeed in deploying a simple client web part on a SharePoint 2016 site with the following steps (following many guides, including https://www.voitanos.io/blog/definitive-guide-sharepoint-framework-sharepoint-server-2016/):
I configured the required Service applications (subscription and app management) and managed the blocked file types.
I created an App Catalog site for my Web Application.
I wrote two urls in "Central Administration -> Apps -> Configure App URLs" (it seems that it doesn't matter what URLs I write, the important thing is that they are not empty or I can't add the App to my sites).
I set up my CDN by creating a Document Library and a folder. I specified this location in the write-manifest.json -> "cdnBasePath".
I uploaded the sppkg (output of gulp package-solution --ship) to the App Catalog and it got distributed succesfully.
I went to the root web of the site collection I was working on and added the App.
I created a web part page with an empty web part zone and.
I succesfully added the client web part that was in the default "Other" group, and it rendered fine in the page.
Until here everything is fine. There was some tweaking to do with yeoman, gulp and node versions, but it works.
The problem is that if I add the app to the site root web, the web part is not available to the other webs, since from what I read, if I add an app that way the scope is only that web. In order to make the web part available on other webs, I would have to go to every web and add the app there. This could be fine if I had 2 or 3 webs, but what if I have 1000 webs?
I also read that if you add the app to the App Catalog Site, the scope should be "tenant", and you can then choose where to distribute the app so that it's added for all webs from this page:
https://i.stack.imgur.com/MAX8K.png
If I add the target site here, and the press "OK", an exception occurs:
Exception in page: https://i.stack.imgur.com/S8cl1.png
Exception in log: https://i.stack.imgur.com/K2GMB.png
I tried debuggingg the Microsoft.SharePoint.ApplicationPages.AppInvPage.SetControlStateUsingAppInstanceId method with dotpeek and I think I was able to identify the problem with the AppManifest object, that seems to have some null fields that on which gets called a "ToString", but wasn't able to pinpoint the exact problem yet.
So I thought I could maybe write some PowerShell script to add the App to all subsites, but it seems the method require some parameters that somehow don't seem right. For example, Install-SPApp requires a SPApp object that is obtained with Import-SPAppPackage. Even if I manage to launch the command with the .sppkg file stream, when you launch Install-SPApp an exception occurs: "Install-SPApp : Value cannot be null.".
Honestly I'm running out of ideas.
TL;DR: Has anyone had issues with SharePoint 2016 and globally deployed client web parts? Is it possible to automatically add the app containing one or more client web parts to all subsite on SharePoint 2016?

Related

How do I deploy my app to a folder underneath a website

I have a deployment script to deploy an application to a website called admintools3t. After the deployment, I see the folders for the app directly underneath that website (when viewed in IIS). The code is deployed to the folder D:\applications\admintools\admintools_wwwroot\myapp1, which is where I (think?) want the code. However, my website is the generic site that needs to host multiple applications, myapp1, myapp2, myapp3, myapp4.
Here is the call I make to use msdeploy to perform the deployment:
call D:\temp\AdminTools\%APP%\%APP%.deploy.cmd /Y "-setParam:name='IIS Web Application Name',value='admintools3t'"
I'm doing this on-the-fly switch on the value because I have multiple environments where I will be deploying to and rather than having multiple profiles, I do this on-the-fly switch, which appears to be working.
How can I tweak this command or add additional parameters so when I view the website in IIS that I see a myapp1 underneath admintools3t?

I have copied files via FileZilla to Azure but the index page doesn't show

I shall try not to be subjective so as not be closed.
This is my first foray into Azure and it really is NOT like my dedicated server on another hosting company. Suffice it to say, what takes me minutes to deploy a site via FTP, then to IIS to set it up, has taken me WEEKS!
I don't want to set up any of the "pre-packaged" Quickstart solutions. I simply want my INDEX.HTML file to DISPLAY.
I copied all the files via Filezilla to Azure, quite easily, but yet, when I go to the URL, I keep getting:
Your App Service app has been created
Go to your app's Quick Start guide in the Azure portal to get started or read our deployment documentation.
Everything is set up on Azure perfectly.
Here's what it looks like under the appSettings Tab:
**Virtual applications and directories**
/ site\wwwroot Application …
/wwwroot site\wwwroot\mynewsite Application …
The directory, site\wwwroot\mynewsite has an index.html but it will not display when I type in the URL.
I already built the site and the company I'm working for wants it on AZURE.
A dedicated server takes under 15 min. This has taken weeks.
UPDATE:
Thiago, thank you... so here's the file structure below...
Reveals EXACTLY what my directory looks like. Under /thingblugrow is where "the fake name" mynewsite exists. I thought it'd be easier to just show you what I really have.
So, /thingblugrow has an index.html file....
If your want to visit http://yoursitename.azurewebsites.net/mynewsite/index.html,
The appsetting we need config it as following in your case:
Virtual applications and directories
/ site\wwwroot Application …
/mynewsite site\wwwroot\thingblugrow Application …
You also can refer to another SO Thread to get more info about creating Virtual applications and directories
You're adding an extra level, so in your case you'll be able to see the index through:
http://yoursitename.azurewebsites.net/mynewsite/index.html
Just move all the content from "mynewsite" folder to the parent directory (wwwroot).

MVC Durandal app doesn't work when deployed to IIS

The platform is IIS on Win8.1
The project is created from the Durandal project template. No changes are made, and the project is run: the Durandal start kit appears in a web browser.
The project is deployed to a folder D:\Client
IIS manager is used to map a virtual application off the default web to D:\Client. The app pool for this is specified as DefaultAppPool which on my machine is set to FX4.0 and runs with my user credentials. Deliberately setting it to FX2.0 produces a 502 as expected. This implies that the FX version is not the problem.
http://localhost/Client produces the splash screen but the app hangs there. Using the browser's own debugger reveals that main has NOT been executed.
Loaded:
bootstrap.js
jquery-1.9.1.js
knockout 2.3.0.debug.js
require.js
Has anyone experienced this and what did you do to resolve it?
Virtual Directories are created to serve static content as far as I understand. ( Just a subfolder of another application ). As the StarterKit runs using MVC4/5 you need also ASP.NET support thus creating a normal application ( parallel to defaultapp ) should do the trick.
If you did that already that way maybe you're missing some files. Had a situation where some files weren't deployed ( eg. the views folder ). Double check if those are present.

Does ASP.NET MVC 4 application have to be in the root folder of a site on IIS 8?

iI have a ASP.NET MVC 4 application based on the VS 2012 Basic template. Using VS 2012, I can deploy the app into a root of an IIS server, such as c:\inetpub\wwwroot. Then, I can go to [http://]mymachine/ and see the app.
But, if I try to move the app to c:\inetpub\wwwroot\Test, an attempt to access [http://]mymachine/Test results in "HTTP Error 403.14 - Forbidden The Web server is configured to not list the contents of this directory."
I tried to move the folder both manually, and also by deploying to that folder from VS 2012, but there was no difference. I tried to move the web.config file into c:\inetpub\wwwroot while leaving the rest of the app under c:\inetpub\wwwroot\Test, but that also doesn't work. I have to move global.asax, global.asax.cs and the bin folder into the site root, but then the whole app is again in the root folder, which is not what I wanted.
Does anyone know whether what I'm trying to do is possible? Thanks.
PS.: Sorry about the link formatting - I used the square brackets around [http://] to prevent stackoverflow from treating the example URIs as links.
You need to ensure that the sub-folder has been converted (or created) as an application in IIS. Load the IIS manager and locate the folder under the website node in the tree, right-click and select convert to application. If it's not listed, use the add application option.
Keep in mind that the child application will inherit web.config settings from it's parent by default (among other things). More information can be found on MSDN.

WF4 hosting conversion of self hosting console app to service hosted in IIS

I have a console application project which is a workflow service self hosted using WorkflowServiceHost. It contains a flowchart workflow definition (xaml) and some custom activities in cs files. This application connects (via a service reference) to a WCF data service hosted as .svc. I have an aspnet web app that interacts with the workflow service via a service ref. It's all working fine.
I'd like to convert the workflow service console app to instead be hosted on IIS (I'm developing using IIS5 and the live environment is IIS6) but am unsure how to go about it. I tried creating a WCF WorkflowService Application project and copying my xaml (changing to xamlx - not sure if I needed to do that or not) and cs files in, and created a service reference to my WCF data service but when I tried to browse the xamlx I got an error "Cannot create unknown type x" x being a type that it should be able to "see" via the service reference it has.
What are my options for hosting - do I have to use WorkflowServiceApplication or can I host using .svc? Can someone point to a tutorial or talk me through what I need to do? Also I would like to have the workflow definition in a class library project if possible, thus separating it from its host. Not critical though.
A XAML and XAMLX file are almost the same but not quite. The XAML file results in a class being generated to wrap the XAML and you work with that type as if it is a normal class. A XAMLX file is not compiled and parsed at runtime. The root element is also different for the two and the XAMLX has no x:Class attribute because it isn't compiled.
The easiest way is to just create a XAMLX file and copy the activities from the XAML file into the XAMLX file.

Resources