0

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 ?

Amehiny
  • 125
  • 4
  • 16

1 Answers1

1

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

Claudio P
  • 2,133
  • 3
  • 25
  • 45
  • I have this file. But when I push the project into the test server it searches for the global.asax.cs but I deleted because I added the startup.cs file. How can I configure the server to search for the startup.cs instead of the global.asax.cs – Amehiny Feb 14 '15 at 16:16
  • I think there's no reason to delete the global.asax.cs. If you have a startup class like this it uses this. – Claudio P Feb 14 '15 at 17:25
  • Hmm so I should add the global.asax.cs and have the startup.cs as well. OK I thank you .. I will try it and see if it works :) – Amehiny Feb 14 '15 at 20:39