.NET 4.0 - CultureNotFoundException

后端 未结 10 483
旧巷少年郎
旧巷少年郎 2020-12-03 09:27

I have migrated my ASP.NET MVC 2 project to VS 2010 + .NET 4.0. Now when i start the application i get a lot of \"CultureNotFoundException\" in IntelliTrace and Output/Gebug

相关标签:
10条回答
  • 2020-12-03 10:14

    I think it's the actual designer that messed things up. Try searching across your solution for "designer" string to see if any XML/HTML attributes have their values set to this string.

    0 讨论(0)
  • 2020-12-03 10:17

    I had a similar issue with the "CultureNotFoundException". To resolve this I had to delete all the folders from in here additionally:

    %LocalAppData%\Local\Temp\Temporary ASP.NET Files
    

    Deleting from here wasn't enough:

    C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files
    
    0 讨论(0)
  • 2020-12-03 10:18

    I found that turning on "Enable Just My Code" in the Debugging section of the Visual Studio 2017 options worked for me. That just hides those exceptions, which are part of the normal operation of the framework.

    0 讨论(0)
  • 2020-12-03 10:25

    I had this error message:

    'ViewBag.XXXXX' threw an exception of type 'System.Globalization.CultureNotFoundException' dynamic {System.Globalization.CultureNotFoundException}

    The inner message said:

    The culture is not supported.\r\nParameter name: name\r\nneutral is an invalid identifier culture.

    The problem was that there was an invalid definition of the assembly culture in the AssemblyInfo.cs file:

    [assembly: AssemblyCulture("neutral")]
    

    To fix it, just leave empty the "culture" parameter like this:

    [assembly: AssemblyCulture("")]
    

    That fixed the problem for me.

    0 讨论(0)
提交回复
热议问题