Hello guys,
I am having issues frequently when trying to debug an AspNetZero project.
We are using VS2015 and latest version of AspNetZero.
First time we debug the solution using F5 everything works normal. Then we stop debugging and make some code changes in order to fix/add something. We hit F5 again and the debugger starts, browser opens and the output window is filled with information until we can see the messages generating DynamicProxyGenAssembly2 (Castle proxies) and it stays there forever. Browser keeps loading (spinning wheel) and debug output shows nothing. No exception at all (even marking all exceptions to be break into in ExceptionSettings).
I don't know what else to investigate.
Does anyone have the same issue ?
Does anyone uses VS2015 with Abp and debug / stop / change code / debug again and it works normal ?
I'm using IIS Express. The only thing left for tests is to use normal IIS instead of express...
Thanks a lot and hope someone can help me out with this.
Bruno
6 Answer(s)
-
0
Hi,
As I tested more, you're right. There is a problem. It's very strange but probably it's a problem of .Net framework when you create a MemoryCache on application start (ABP does it). You can find more explanation here: <a class="postlink" href="http://www.zpqrtbnk.net/posts/appdomains-threads-cultureinfos-and-paracetamol">http://www.zpqrtbnk.net/posts/appdomain ... aracetamol</a>
But, as a short solution, copy this code to your web project:
/* Got from here: http://www.zpqrtbnk.net/posts/appdomains-threads-cultureinfos-and-paracetamol */ public static class ThreadCultureSanitizer { public static void SanitizeThreadCulture() { var currentCulture = CultureInfo.CurrentCulture; // at the top of any culture should be the invariant culture, // find it doing an .Equals comparison ensure that we will // find it and not loop endlessly var invariantCulture = currentCulture; while (invariantCulture.Equals(CultureInfo.InvariantCulture) == false) invariantCulture = invariantCulture.Parent; if (ReferenceEquals(invariantCulture, CultureInfo.InvariantCulture)) return; var thread = Thread.CurrentThread; thread.CurrentCulture = CultureInfo.GetCultureInfo(thread.CurrentCulture.Name); thread.CurrentUICulture = CultureInfo.GetCultureInfo(thread.CurrentUICulture.Name); } }
Then call ThreadCultureSanitizer.SanitizeThreadCulture(); from 2 places:
- In global.asax file, as first line in Application_Start method.
- In Startup.cs, as first line in Configuration method.
Then close all VS instances and open your project again.
Please let me know if this works for you.
Thanks, Have a nice day.