2

I want to publish one of my sites to my host. the site was published successfully by VS and FTP method. but the thing is the database side. I have used Entity Framework in this project. I changed the connection string after publishing and i have created the tables in my online database.

first i want to know how to make my site to show complete error message as it shows when i am debugging in local mode.

and the second is that is there any thing else i should do for my DB?

after i added this line to web.config:

<configuration>
  <system.web>
    <customErrors mode="off">
    </customErrors>
    .
    .
    .
  </system.web>
</configuration>

now the error is this:

Internal Server Error

1
  • It's hards to say, could be many different things, check your IIS instance and permissions, check this link: stackoverflow.com/questions/20373376/… Commented Oct 17, 2014 at 14:45

4 Answers 4

1

You can disable the Custom Errors in the section system.web of your web.config:

<!-- Default -->
<customErrors mode="RemoteOnly" defaultRedirect="~/Home/Error" />

<!-- Disabled -->
<customErrors mode="Off" defaultRedirect="~/Home/Error" />

MSDN: The customErrors element can be defined at any level in the application file hierarchy.

The Official MSDN Documentation: customErrors Element (ASP.NET Settings Schema)

What you want to do with the DB? I dont know what you mean with anything else.

Sign up to request clarification or add additional context in comments.

3 Comments

where should i add this? in my web.config isn't any thing like this!
but as i add this line to web.config , i got Internal server error! is this problem from my service provider???
@ConductedClever I think you should post your error in another thread or give more info about your error, the line in the web.config only show it.
1

If you want to automate your database deployment you need to be using EF Code-First and you need to look into automating code-first migrations.

Comments

1

It seems you have published the site successfully but the database is not in sync with the code that is published.

First identify the database changes and prepare the script.

Publish the code on server.

Run the script on the database.

Now go to the Database i.e SQL Server, select the database, Expand the Tables, you will find "System Tables" under that you will find [__MigrationHistory] table. You need to clear all the rows from the table Delete * from [__MigrationHistory]

Now run the website.

Let me know if this worked.

5 Comments

i don't have migration history.
the database is ok. i tested it by a simple log making code. but stil i can't receive the errors!
<compilation debug="true" targetFramework="4.5" /> change your web.config and let me know whats the error.
this didn't work too! as i add the system.web in my web.config , every thing stops working.
I think you should check the Event Viewer or the Windows Logs
1

500 Internal server error

Like the error suggests it is an internal error on the server.

Of course it would be a terrible idea to display internal errors in the browser

So why take a guess?

Simply log into your server and check 2 things:

Both should lead you to the solution.

Don't waste your time guessing, instead invest your time in learning how to troubleshoot.

Hope this helps!

4 Comments

I am in the same idea with you. but the server of the host is very limited and my knowledge about publishing asp web sites is very low. thank you for your suggestion.
so what are you going to do, find the erros, or take more guesses
@ConductedClever how do you host your site, you dont have access to the server ?
i just have access from WebsitePanel.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.