What!? Orchard CMS with Owin throwing some sorta weird "No owin.Environment item was found in the context" error under IIS?

Tags: Orchard, OWIN, Powershell

Today I decided to get OWIN up and running on Orchard. Sebastien had done the leg work, I just needed to get it compiling, update the DLL packages for Owin, and get those unit tests running. Fantastic, not hard.. but hang on!! What's this error!

No owin.Environment item was found in the context

After lots of googling, it appears that this error will only occur if the Owin Startup class is not called.

I fire up IIS Express, and hey presto, it works, Orchard kicks up, so the issue is IIS!

So I cleared my cache, deleted dependencies, cleaned, rebuilt, still issues.... ultimately, its the ASP.Net temporary files that are going to kick ya. Just do this..

Run this in PowerShell

net stop w3svc
Remove-Item -Path "C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\*" -Force -Recurse
Remove-Item -Path "C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\*" -Force -Recurse
net start w3svc

No Comments, be the first to leave one!

Leave a Comment

Yay! You've decided to leave a comment. That's fantastic! Please keep in mind that comments are moderated and rel="nofollow" is in use. So, please do not use a spammy keyword or a domain as your name, or it will be deleted. Let's have a personal and meaningful conversation instead. Thanks for dropping by!