Wisej.NET Deployment
HomeNewsSupportVideos
  • Deployment
  • Targets
    • IIS
    • NGINX
    • Apache
    • Self Hosted
    • Hybrid
    • Amazon AWS
    • Microsoft Azure
    • ASP.NET Hosting
    • Linux, MacOS
    • Desktop (deprecated)
  • Concepts
    • Load Balancing
    • Visual Studio Publishing
    • Server Debugging
  • Troubleshooting
    • License Activation
Powered by GitBook
On this page
  • .NET Core
  • InProcess
  • OutOfProcess
  • Configuration File
  • Security
  • .NET Framework
  • Basic Steps
  • Configuration file
  • App Pool & Permissions
  • Application Request Routing (AAR)

Was this helpful?

Export as PDF
  1. Targets

IIS

How to publish a Wisej app to an IIS Server.

PreviousDeploymentNextNGINX

Last updated 2 months ago

Was this helpful?

.NET Core

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

  1. Create an application in IIS.

  2. Uncomment and update the IIS entries in web.config.

  3. Publish the application to a folder using the Visual Studio publishing tool.

  4. Create a virtual application in IIS pointing to the published folder.

  5. 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:

<handlers>
	<!--
	Uncomment the aspNetCore handler below to deploy to IIS when using .NET Core.
	-->
	<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" />
	<add name="json" verb="*" path="*.json" type="System.Web.HttpForbiddenHandler" />
	<add name="wisej" verb="*" path="*.wx" type="Wisej.Core.HttpHandler, Wisej.Framework"/>
</handlers>

<!--
Uncomment the aspNetCore section below to deploy to IIS when using .NET Core.
-->
<aspNetCore stdoutLogEnabled="false" hostingModel="InProcess" processPath="bin\Debug\net6.0\WisejWebPageApplication1.exe" arguments="" />

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.

InProcess

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.

OutOfProcess

Configuration File

Security

When deploying on .NET Core, you are unable to use the web.config file to configure the System.Web.HttpForbiddenHandler, which is typically used to block the downloading of potentially sensitive .json files. As a result, these .json files could become accessible for downloading, which might pose a security vulnerability.

Since ASP.NET Core relies on middleware modules instead of using traditional HttpHandlers and HttpModules, to secure specific files or directories, you need to modify the configuration in the Startup.cs file. Adjusting the middleware settings within Startup.cs allows you to implement security measures to protect sensitive files or directories effectively.

Below is an example of how to block access to specific files or directories in ASP.NET Core, based on your security requirements. You can customize the middleware configuration in the Startup.cs file to meet your particular security needs.

Conditional UseFileServer
// app.UseFileServer();
app.UseWhen(
 cx => !cx.Request.Path.Value.EndsWith(".json", StringComparison.OrdinalIgnoreCase), 
 app => app.UseFileServer()
);

.NET Framework

Basic Steps

  1. Create the /bin directory in the application's directory

  2. Copy all the assemblies from your local /bin to the server's /bin (no need to copy xml and pdb files)

  3. Copy the /Themes folder if you have custom themes or mixins

  4. Copy the /Images folder if you have images that need to be served as URLs

  5. Copy the /App_Data folder if your application uses it

  6. Copy Web.config

  7. Copy Default.html (and other html files you use sub-applications)

  8. Copy Default.json (and other json configuration files if you use sub-applications)

  9. Copy favicon.ico.

References:

Configuration file

There are two solutions:

  1. Remove the duplicated setting in the child web.config

  2. Add XML statements to remove the duplicated settings in the child web.config.

<modules>
      <remove name="Wisej"/>
      <add name="Wisej" type="Wisej.Core.HttpModule, Wisej.Framework"/>
</modules>

...

<handlers>
  <remove name="json"/>
  <remove name="wisejn"/>
  <add name="json" verb="*" path="*.json" type="System.Web.HttpForbiddenHandler" />
  <add name="wisej" verb="*" path="*.wx" type="Wisej.Core.HttpHandler, Wisej.Framework"/>
</handlers>

Names are case sensitive.

Debug Mode

When deploying in production, we recommend to turn off the debug flag in web.config.

<configuration>
  <appSettings>
    <add key="Wisej.LicenseKey" value=""/>
    <add key="Wisej.DefaultTheme" value="Blue-1"/>
  </appSettings> 
  <system.web>
    <compilation debug="true|false" />

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.

License Key

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.

App Pool & Permissions

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.

Application Request Routing (AAR)

Install IIS for your deployment framework.

When running OutOfProcess, IIS starts your ASP.NET Core application as a standalone executable and acts as a reverse proxy, just like and .

Everything else in web.config is unchanged. You can set the , the and theme exactly like you did in Wisej 2.x.

Deploying a Wisej 2.x and 3.x .NET 4.8 application to 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.

If you are deploying a child IIS application, remember that 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 several settings on the Application Pool that you may also want to look at depending on your deployment requirements. Please refer to for more information.

If you need additional professional support, please .

IIS can also function as a simple load balancer when the is installed. Please refer to Microsoft's documentation to learn about this feature.

.NET Core Hosting Bundle
NGINX
Apache
IIS
Create an application in IIS
IIS inherits
Microsoft's documentation
contact us
AAR module
debug mode
license key
IIS Configuration in Windows Features
Deploying a .NET 6 Wisej.NET App to IIS
LogoApplication for a Site <application>docsmsft