I had created an application that worked, was deployed and used for a while before someone asked for an addition. When I tried to run the completed executeable file, I got a System.InvalidOperationException error immediately. When I opened the source code and tried to run it before making any changes, I got the same error.

System.InvalidOperationException was unhandled
  Message="An error occurred creating the form. See Exception.InnerException for details.  The error is: The NeutralResourcesLanguageAttribute on the assembly \"VanRouter, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null\" specifies an invalid culture name: \"en-CB\"."

What is this and how do i fix it??!!?

Recommended Answers

All 3 Replies

I think you use localization feature in your application and it doesn't recognize "en-CB" language.

commented: Your post got me moving on the right track! Thanks +2

I think you use localization feature in your application and it doesn't recognize "en-CB" language.

Ok, where is that, and how do I turn it off? The application worked fine before - but now ...

When I stepped through the application source code the error occurs at the last line in this code snippet:

Dim DBSPATH As String = "\\Sbiaccpac\AccPac\MS52A\Settings.mdb"
    Dim VanDBS As String = "\\sbiaccpac\accpac\AR VAN Router\VanRoutes.mdb"

    Const ACCPAC_ConnectionString = "Data Source=sbidbsvr;Database=SBI_ACCPAC_DATA;User Id=sbiapps;Password=itadmin123"

    Dim VanRoutes_ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & VanDBS & ";User ID =Admin;Password=;"
    Dim ODBC_ConnectionString As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & DBSPATH & ";User ID =Admin;Password=;"

   Dim ScriptString As String, LocationCode As String, UserID As String, UserName As String
    Dim VanRouteCon As New OleDbConnection(VanRoutes_ConnectionString)
    Dim SQLCon As New SqlConnection(ACCPAC_ConnectionString)

I think you use localization feature in your application and it doesn't recognize "en-CB" language.

Ok! After reading up on what Localization actually was (thanks again, Google!) I opened my application's Project Properties and clicked on the Assembly Information button - one of the fields was "Neutral Language" - and yes, Ramy, it was set to 'en-CB'. I have NO IDEA how this got like this, but setting it back to 'none' fixed my application.

Thanks a bunch!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.