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??!!?

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

Comments
Your post got me moving on the right track! Thanks

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!

This article has been dead for over six months. Start a new discussion instead.