---
description: How to publish a Wisej app to the Microsoft Azure cloud.
---

# Microsoft Azure

Microsoft Azure supports different deployment types for Wisej (ASP.NET) applications. You can deploy to a Web Site (renamed to Web Service), to an IIS instance or a to a Virtual Machine with IIS.

In all cases you can publish directly from Visual Studio. Please refer to the [Visual Studio Publishing](../concepts/visual-studio-publishing) guide and to Microsoft's Azure Deployment documentation for ASP.NET.

{% embed url="https://docs.microsoft.com/en-us/azure/app-service/quickstart-dotnetcore?pivots=development-environment-vs&tabs=netcore31" %}

## Project Formats

### Old Project Format

#### Supported Frameworks for Publishing

* .NET Framework v4.x

### SDK-Project Format

#### Supported Frameworks for Publishing

* .NET Core

{% hint style="warning" %}
You cannot publish .NET Framework v4.x projects to Azure using the Visual Studio Publishing Tool with the new SDK-Project format.
{% endhint %}

## Troubleshooting&#x20;

### .NET Core

**The application was published successfully but shows an error 'Couldn't find Wisej.Framework' on startup.**

Remove `<add name="Wisej" type="Wisej.Core.HttpModule, Wisej.Framework" />` from `<modules>` in **web.config**.

#### The application was published successfully but shows a blank white screen on startup.

Make sure `<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" />` is uncommented under \<handlers> in **web.config**.&#x20;

## 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.

{% code title="Conditional UseFileServer" %}
```csharp
// app.UseFileServer();
app.UseWhen(
 cx => !cx.Request.Path.Value.EndsWith(".json", StringComparison.OrdinalIgnoreCase), 
 app => app.UseFileServer()
);
```
{% endcode %}
