Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8080333
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T16:22:55+00:00 2026-06-05T16:22:55+00:00

I am getting this error when I try to deploy my Web API project

  • 0

I am getting this error when I try to deploy my Web API project to both Cloud WebSites and Cloud Hosted Services on Azure:

"{"ExceptionType":"System.TypeLoadException","Message":"Could not load type 'System.ComponentModel.DataAnnotations.Schema.DatabaseGeneratedOption' from assembly 'System.ComponentModel.DataAnnotations, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.","StackTrace":"\r\nServer stack trace: \r\n   at System.Reflection.RuntimeAssembly.GetExportedTypes(RuntimeAssembly assembly, ObjectHandleOnStack retTypes)\r\n   at System.Reflection.RuntimeAssembly.GetExportedTypes()\r\n   at System.Web.Http.Dispatcher.DefaultHttpControllerTypeResolver.GetControllerTypes(IAssembliesResolver assembliesResolver)\r\n   at System.Web.Http.WebHost.WebHostHttpControllerTypeResolver.GetControllerTypes(IAssembliesResolver assembliesResolver)\r\n   at System.Web.Http.Dispatcher.HttpControllerTypeCache.InitializeCache()\r\n   at System.Lazy`1.CreateValue()\r\n\r\nException rethrown at [0]: \r\n   at System.Reflection.RuntimeAssembly.GetExportedTypes(RuntimeAssembly assembly, ObjectHandleOnStack retTypes)\r\n   at System.Reflection.RuntimeAssembly.GetExportedTypes()\r\n   at System.Web.Http.Dispatcher.DefaultHttpControllerTypeResolver.GetControllerTypes(IAssembliesResolver assembliesResolver)\r\n   at System.Web.Http.WebHost.WebHostHttpControllerTypeResolver.GetControllerTypes(IAssembliesResolver assembliesResolver)\r\n   at System.Web.Http.Dispatcher.HttpControllerTypeCache.InitializeCache()\r\n   at System.Lazy`1.CreateValue()\r\n   at System.Lazy`1.LazyInitValue()\r\n   at System.Web.Http.Dispatcher.DefaultHttpControllerSelector.InitializeControllerInfoCache()\r\n   at System.Lazy`1.CreateValue()\r\n\r\nException rethrown at [1]: \r\n   at System.Web.Http.Dispatcher.DefaultHttpControllerSelector.SelectController(HttpRequestMessage request)\r\n   at System.Web.Http.Dispatcher.HttpControllerDispatcher.SendAsyncInternal(HttpRequestMessage request, CancellationToken cancellationToken)\r\n   at System.Web.Http.Dispatcher.HttpControllerDispatcher.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)"}"

Here is just the message:

"Could not load type 'System.ComponentModel.DataAnnotations.Schema.DatabaseGeneratedOption' from assembly 'System.ComponentModel.DataAnnotations, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'."

It happens when I try to hit any of my API’s from the remote site. I know its not my 500 errors because some of my API’s wont throw them regardless of what happens.

One thing to note and I am not sure if this would affect anything is I started this project targeted at .NET 4.5 but then switched it to 4.0 when Azure Web Sites said they don’t support 4.5.

I can’t find anything about this except this link:
http://support.appharbor.com/discussions/problems/4822-internal-server-error-500-mvc-4-web-api

except that guy is using app-harbor, andeven still there is still no solution. Thanks of any help.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T16:22:56+00:00Added an answer on June 5, 2026 at 4:22 pm

    So it seemed that the problem was caused by me rolling back to .NET 4 from 4.5 and Entity not rolling back. It seems that Entity 5 only runs on .NET 4.5 and when the deployment was expecting 4.3.1 it had a 5.0.0 DLL and it messed everything up.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Getting this error when try to add an item to my repositories/context: Collection has
I keep getting this error when I try to commit a group of executed
I am getting this error when I try to build for the device: Code
I keep getting this error when I try to call Find() public void findTxt(string
I keep getting this error when I try to install a package: Download error
Okay, I'm getting this error when I try to execute this procedure. The thing
I’m getting an error when I try to do something like this below, <%
We are getting following error when we try to validate our app. This bundle
I'm getting a nothing to repeat error when I try to compile this: search
Ok... changing the question here... I'm getting an error when I try this: SELECT

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.