0

My problem is that when I ran my project locally it worked just fine. But when I publish to my IIS server I get an error saying.

Could not load file or assembly 'Microsoft.Owin' or one of its dependencies

When I fixed the Microsoft.Owin problem there was a problem with System.Web.Http. Why is it only a problem after I publish?

Alpo
  • 95
  • 1
  • 3
  • 11

5 Answers5

1

For some reason that I can't explain (please do if you know why) it worked to use my web.release.config instead of web.debug.config. I copied my entire web.debug.config to web.release.config and it worked.

Alpo
  • 95
  • 1
  • 3
  • 11
1

A little late to the party, but a recent fix that I've found for this is if publishing from Visual Studio, to make sure that you select the option to remove all additional files at destination. I upgraded my .NET framework, and it wasn't replacing the recompiled packages with the newer versions on Publish.

Kevin C
  • 11
  • 3
0

Set your project References CopyLocal property to true.

Andrei Filimon
  • 1,138
  • 8
  • 12
0

in my case it was the unvalid certificate in MyProject -> Properties -> Signing were I ticked "Sign the Assembly"

0

I just encountered this issue when deploying to an Azure App Service via Devops CI.

The fix was to restart the App service. Once it had JIT compiled after the first call to the web service, the error disappeared and it began working again as normal.

Rory McCrossan
  • 331,213
  • 40
  • 305
  • 339