Culture is not supported - c#

I'm using Visual Studio 2012 Ultimate version.
I've got this error and I don't know how to solve it.
Culture is not supported.
Parameter name: name
en-UK is an invalid culture identifier.
Description: An unhandled exception occurred during the execution of
the current web request. Please review the stack trace for more
information about the error and where it originated in the code.
Exception Details: System.Globalization.CultureNotFoundException:
Culture is not supported. Parameter name: name en-UK is an invalid
culture identifier.
please help me

Go to Debug -> Options -> Debugging and tick "Enable Just My Code"

You should try en-GB for English (United Kingdom)
List of Cultures

In my case with IIS Express, it was caused by its inability to write to C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files as IIS Express runs by a current user. So I've added permission to write to it for the current user to solve the error.

Related

Set a different language for ASP.NET MVC errors

I have an ASP.NET MVC application configured for Portuguese, on Visual Studio 2015. While debugging this application, I've set <customErrors mode="Off" />, but all errors are shown in Portuguese, and I want to see them in English.
I tried to set this in Web.config:
<globalization uiCulture="en-US" culture="en-US" enableClientBasedCulture="true" />
In Global.asax I tried:
Thread.CurrentThread.CurrentUICulture = CultureInfo.GetCultureInfo("en-US");
Thread.CurrentThread.CurrentCulture = CultureInfo.GetCultureInfo("en-US");
and
Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture;
Thread.CurrentThread.CurrentUICulture = CultureInfo.InvariantCulture;
I also uninstalled the Nuget package Microsoft.AspNet.Mvc.pt-br, no success.
This question is similar, but I need a solution that doesn't involve changing the machine's configuration or installed components, as that's not allowed in my workplace.
How can I make all error messages show in a specific language (in this case, English)?
Today when I tried this again, to my surprise the messages were in English (almost, see below). I tried to reproduce the error I had yesterday, but I couldn't.
Perhaps it is just a matter of restarting (VS or the PC). I also kept working on the project at night on a different PC, but not on anything related with this issue, so I can't say it made a difference. All I have set up in Web.config is:
<globalization uiCulture="en-US" culture="en-US" enableClientBasedCulture="true" />
But still not everything was in English. While trying to reproduce the error, I forced a library load error, I used a DLL that requires Ninject to be installed. The error message was (emphasis mine on the translated part):
Server Error in '/' Application.
Could not load file or assembly 'Ninject, Version=3.2.0.0, Culture=neutral, PublicKeyToken=c7192dc5380945e7' or one of its dependencies. O sistema não pode encontrar o arquivo especificado.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
That part was supposed to be: The system cannot find the file specified.
In that case, I don't think there is much that can be done programmatically only.
Uninstall the .net framework in the portugese version and reinstall the english version, that should do the trick.

SQL database on Visual Studio server error when publish

I have created a website on visual studio and I have added an SQL database onto it. I am using DetailsView and GridView to display the data. It works perfectly before I published the website using GoDaddy. I am assuming there is some security issue I need to fix. Any suggestions or help would be great. Thank you.
Here is the error:
Server Error in '/' Application.
Security Exception
Description: The application attempted to perform an operation not allowed by the security policy. To grant this application the required permission please contact your system administrator or change the application's trust level in the configuration file.
Exception Details: System.Security.SecurityException: Request failed.
Source Error:
[No relevant source lines]
Source File: App_Web_lfy0dq0l.0.cs Line: 0
Stack Trace:
If you are not make sure you are running Visual Studio as Administrator. I'm getting this from the application line in your comment.
Server Error in '/' Application.
Security Exception
Description: The application attempted to perform an operation not allowed by the security policy. To grant this application the required permission please contact your system administrator or change the application's trust level in the configuration file.
Exception Details: System.Security.SecurityException: Request failed.

Xamarin C# empty project exception: Culture not supported

Just downloaded Xamarin Studio 5.9.6 (build 23), and went into Tools - Options - Language, and selected "English" as the "User interface language".
When I created a new C# "empty project", Xamarin complained, a dialog box displayed saying: "An error has occurred - The project could not be created".
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.TypeInitializationException:
The type initializer for 'Microsoft.FSharp.Compiler.SourceCodeServices.FSharpChecker' threw an exception. ---> System.TypeInitializationException:
The type initializer for '<StartupCode$FSharp-Compiler-Service>.$Service' threw an exception. ---> System.TypeInitializationException:
The type initializer for '<StartupCode$FSharp-Compiler-Service>.$Reactor' threw an exception. ---> System.Globalization.CultureNotFoundException: Culture is not supported.
Parameter name: culture
4096 (0x1000) is an invalid culture identifier.
Kinda of a strange little annoyance. Running Windows 10 x64. I have tons of Visual Studios on this PC as well, including VS2015.
This is a bug in Xamarin Studio's language selection on Windows 10. It is fixed in Xamarin Studio 5.10.
This is normally seen when English is selected, typically this would be done with Windows 10 using a non-English language, and configuring Xamarin Studio to use English would not change the UI text but would still show the language used by Windows.
The problem is that on Windows 10 a lot of the English non-neutral cultures returned from CultureInfo.GetCultures have an unspecified custom locale ID (LCID) which is 0x1000. Earlier versions of Windows do not have this problem. One of these cultures was being used to set the current UI culture and it was ignored since it is invalid. According to the MSDN documentation before Windows 10 unspecified custom locale ids were assigned to custom cultures created by the user. In Windows 10 this unspecified custom locale id is assigned to any culture that does not have a unique locale identifier and does not have complete system provided data. So Windows 10 returns more locales with this unspecified locale id.
Since Xamarin Studio was using an invalid culture this caused the F# exception.
Now these cultures with unspecified custom locale ids are ignored by Xamarin Studio 5.10 and above.
The interesting thing about this error is it is complaining about the F# compiler. Yet, my intent was to create a new C# empty project. ...and I do have F# loaded due to my Visual Studio instance(s). And I am in the USA, it's not like I was attempting to load a different language.
So the quick fix for this was to go back into Xamarin Tools - Options - Language, and change it back to (default).
User error (?) by selecting English.

System.Globalization.CultureNotFoundException: Culture is not supported

I develop in C# an site that on my computer works on all 3 browsers(FireFox, IE and Chrome).
On other computer works on IE but on FireFox received following error:
"Culture is not supported.
Parameter name: name
English is an invalid culture identifier.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Globalization.CultureNotFoundException: Culture is not supported.
Parameter name: name
English is an invalid culture identifier.
Source Error:
Line 29: if (!String.IsNullOrEmpty(langValue))
Line 30: {
Line 31: UICulture = langValue;
Line 32: //Culture = langValue;
Line 33: "
I received same error on other computer on IE and Chrome but not on FireFox.
All browsers are updated to the newest versions and are on Windows 7.
Can anyone give me a hint or a solution for this problem, please?
Thanks
You may try to do this:
Go to the Debug menu -> Exceptions... and check that everything is unchecked for the Exception list.
Also try to delete all the files from the ASP.NET temporary folders present at the below location:
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files
English is not an identifier. Try with "en" or "en-US"

Just-in-time debugger throwing errors during compile

I'm using VS 2008. I have a C# application.
When I try to build/run the project it opens the JUST IN TIME debugger for some reason disabling me from stepping through my code where the exception occurred.
How can I get rid of this JUST IN TIME prompt?
I did go to tools=>options-->debugging and disabled JUST IN TIME and now it is giving me an error message:
an unhandled win32 exception occurred in projectname. just in time debugging this exception failed with the following error...basically i guess it's trying to open just in time
How do I get normal compiler debugging capabilities?
Check out the following MSDN article: Just-In-Time Debugging. It sounds like in your case, you might want to make sure you have registry keys for JIT deleted.
Also, the following seems to be applicable in your case:
An unhandled win32 exception occurred in . Just-In-Time
debugging this exception failed with the following error: The logged
in user did not have access to debug the crashing application.
This message indicates that Just-In-Time debugging failed because you
do not have proper access permissions. For information on the required
permissions, see [Obsolete] Remote Debugging Permissions.

Categories

Resources