Amehiny
Amehiny

Reputation: 135

How to make the server use the startup.cs instead of Global.asax.cs

I am trying to publish an app in the web but the server searches for Global.asax.cs and I deleted that file and added startup.cs instead.

How can I make the server search for startup.cs instead of Global.asax.cs, or what is the best approach to fix this issue ?

Upvotes: 0

Views: 2402

Answers (1)

Claudio P
Claudio P

Reputation: 2203

You have to add the Owin package from Nuget and use a startup class looks like this:

using Owin;
using Microsoft.Owin;
[assembly: OwinStartup(typeof(YOURNAMESPACE.Startup))]
namespace YOURNAMESPACE
{
    public class Startup
    {
        public void Configuration(IAppBuilder app)
        {
            //DO your stuff
        }
    }
}

Hope this helps

Upvotes: 2

Related Questions