Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deployment issue. #40

Open
iqbal369 opened this issue Aug 2, 2016 · 2 comments
Open

Deployment issue. #40

iqbal369 opened this issue Aug 2, 2016 · 2 comments

Comments

@iqbal369
Copy link

iqbal369 commented Aug 2, 2016

Even it is a great template to start but I have noted a bug that I could not fix till now.
When I deploy the application to IIS it do not work.

(yourhost) refused to connect.

When we publish in release mode from visual studio the debug is false in web.config.
<compilation debug="false" targetFramework="4.5.1" />
or <compilation targetFramework="4.5.1" />

Application do not load in this mode.

If I change the debug mode as
<compilation debug="true" targetFramework="4.5.1" />
Everything work fine.

I want to run the application with debug=false in web.config.
I could not found any solution. Can anyone help?

@iqbal369
Copy link
Author

iqbal369 commented Aug 5, 2016

Finally I have found the solution myself.
Under App_Start Folder you can find AuthConfig.cs file.
It has two functions:

  1. RegisterMVCAuth
  2. RegisterWebApiAuth

Here we are adding a filter
filters.Add(new RequireHttpsAttribute());
It will only add filter when your site is running in release mode debug="false" in web.config.

If you want to run your website on a server where there is not SSL installed.
Just change these functions.
//Require Https always

if (!HttpContext.Current.IsDebuggingEnabled)
            {
                filters.Add(new RequireHttpsAttribute());
            }

This filter is only added when site is running in release mode. So you can comment out or remove these lines of code. Your site will be running properly without ssl.

@benitazz
Copy link

benitazz commented Aug 5, 2016

Thank you for sharing...I struggled with that issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants