Could not load type StrictModeException when generating csharp

I’ve just got the latest 4.5.13 from MyGet and get an exception “Could not load type ‘ServiceStack.StrictModeException’” when visiting the /types/csharp route.

To test this in a clean project and environment, I cleared my Nuget cache and I created a new VS project from the Selfhosted empty template and ran it, and visiting the route /types/csharp I get the error.

I tried setting the AppHost.Config.StrictMode to false in the Configure method, but the problem still occurs.

I’m using the latest 4.5.13 to try an address another issue which is reportedly fixed in 4.5.13. I’ve had a look at the source and it looks like this StrictModeException was added fairly recently.

I’m hoping there’s a simple work-around for this - or do I need to bunker down and wait for a stable version?

I’d say you still have a dirty NuGet cache, I’ve just cleared out the NuGet packages cache, created a new ServiceStack Self Host Empty VS.NET Template upgraded all deps to v4.5.13 and was able to run both /metadata and /types/csharp without error.

Try re-downloading the latest NuGet.exe from NuGet.org then running:

c:\path\to\nuget.exe locals all -clear

Then try re-creating a new Template to see if that helps.

2 Likes

Thanks - I’d used

del %LOCALAPPDATA%\NuGet\Cache*.nupkg /q

in the past with success, but this time I needed to do

nuget locals all -clear

for some reason.

Thanks for the prompt response!

1 Like