IIS
How to publish a Wisej app to an IIS Server.
Last updated
How to publish a Wisej app to an IIS Server.
Last updated
Deploying a Wisej .NET Core application to IIS is exactly the same as deploying any ASP.NET Core application. However, it's a bit more complex than an ASP.NET application.
IIS Configuration
Basic Steps
Install IIS .NET Core Hosting Bundle for your deployment framework.
Create an application in IIS.
Uncomment and update the IIS entries in web.config.
Publish the application to a folder using the Visual Studio publishing tool.
Create a virtual application in IIS pointing to the published folder.
Create a new App Domain set to Unmanaged Code and assign it to the application.
Our templates have already added the commented out IIS configuration to the web.config file:
However, the web.config in the project has the processPath set to the debug output. When using the publishing tool, it changes the process path to ".\WisejWebPageApplication1.dll" or ".\WisejWebPageApplication1.exe" depending on the hosting model.
When running InProcess, IIS uses the AspNetCoreModuleV2 handler to load your ASP.NET Core app in the app domain's process and directly invokes the OWIN middleware.
When running OutOfProcess, IIS starts your ASP.NET Core application as a standalone executable and acts as a reverse proxy, just like NGINX and Apache.
Everything else in web.config is unchanged. You can set the debug mode, the license key and theme exactly like you did in Wisej 2.x.
Deploying a Wisej 2.x and 3.x .NET 4.8 application to IIS is exactly the same as deploying any ASP.NET application. It's just a matter of copying the right files and configuring IIS to recognize the application folder as a web application.
Create the /bin directory in the application's directory
Copy all the assemblies from your local /bin to the server's /bin (no need to copy xml and pdb files)
Copy the /Themes folder if you have custom themes or mixins
Copy the /Images folder if you have images that need to be served as URLs
Copy the /App_Data folder if your application uses it
Copy Web.config
Copy Default.html (and other html files you use sub-applications)
Copy Default.json (and other json configuration files if you use sub-applications)
Copy favicon.ico.
References:
If you are deploying a child IIS application, remember that IIS inherits the web.config from the parent application. When the parent application is also a Wisej application, you will get a server error because of duplicate settings in web.config.
There are two solutions:
Remove the duplicated setting in the child web.config
Add XML statements to remove the duplicated settings in the child web.config.
Names are case sensitive.
When deploying in production, we recommend to turn off the debug flag in web.config.
When debug mode is false all the .js and .css resources are minified and the debug console in the browser receives much less logging data then debug mode.
Copy your deployment Wisej Server key to web.config in the Wisej.LicenseKey setting. Make sure the server has internet connection in order to activate the license.
When you create a new application in IIS, it will be assigned to the DefaultAppPool which uses the ApplicationPoolIdentify as the user. This is fine in most deployments.
If you want to create a new Application Pool it's also fine. The only aspect of the application pool that affects Wisej is the user and the user's permissions: it must have Full Control on the system's Temp directory (which is usually located at C:\Windows\Temp).
Assigning Full Control for the system's Temp directory is required for the application to start; otherwise you will see the "Access Denied" exception on startup.
There are several settings on the Application Pool that you may also want to look at depending on your deployment requirements. Please refer to Microsoft's documentation for more information.
If you need additional professional support, please contact us.
IIS can also function as a simple load balancer when the AAR module is installed. Please refer to Microsoft's documentation to learn about this feature.