Join 150,043 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 1,617 people online right now. Registration is fast and FREE... Join Now!
So I know I've seen this before, but for the life of me I can't remember what the solution was. This is a clean project that I just created that links to SQL Server database and returns a dataset.
Here is the error message when invoking the web service.
CODE
System.Resources.MissingManifestResourceException: Could not find any resources appropriate for the specified culture or the neutral culture. Make sure "Employee.resources" was correctly embedded or linked into assembly "App_Code.wngzxthm" at compile time, or that all the satellite assemblies required are loadable and fully signed. at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo culture, Boolean createIfNotExists, Boolean tryParents) at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo culture, Boolean createIfNotExists, Boolean tryParents) at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo culture, Boolean createIfNotExists, Boolean tryParents) at System.Resources.ResourceManager.GetString(String name, CultureInfo culture) at System.Resources.ResourceManager.GetString(String name) at Employee.InitializeComponent() at Employee..ctor()
Here is the actual code, although I am pretty sure it is not related to the problem.
<WebService(Namespace:="http://tempuri.org/")> _ <WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _ <Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _ Public Class Employee Inherits System.Web.Services.WebService
Private WithEvents sqlDataAdapter1 As System.Data.SqlClient.SqlDataAdapter Private WithEvents sqlDeleteCommand1 As System.Data.SqlClient.SqlCommand Private WithEvents sqlConnection1 As System.Data.SqlClient.SqlConnection Private WithEvents sqlUpdateCommand1 As System.Data.SqlClient.SqlCommand Private WithEvents sqlInsertCommand1 As System.Data.SqlClient.SqlCommand Private WithEvents sqlSelectCommand1 As System.Data.SqlClient.SqlCommand
<WebMethod()> _ Public Function GetEmployeeData() As DataSet 'InitializeComponent() Dim ds As New DataSet() Me.sqlDataAdapter1.Fill(ds) Return ds End Function
<WebMethod()> _ Public Function SaveEmployeeInformation(ByVal ds As DataSet) As Long 'InitializeComponent() Dim recordsAffected As Integer Dim cb As SqlCommandBuilder = New SqlCommandBuilder(Me.sqlDataAdapter1) Dim dsTemp As New DataSet()
Try Me.sqlConnection1.Open() Me.sqlDataAdapter1.Fill(dsTemp) dsTemp.Dispose() recordsAffected = Me.sqlDataAdapter1.Update(ds) Catch ex As Exception Throw New Exception("Error Inserting some records " & ControlChars.NewLine & ex.StackTrace) End Try Return recordsAffected End Function End Class
At this point I only have a couple of web methods created and decided to test them to make sure they were working. The web service works as in showing the methods available, but as soon as I invoke the GetEmployeeData() method the error is returned.
Anyone got any ideas what the solution to fix the problem is?
That exception is thrown if the main assembly does not contain the resources for the neutral culture, those resources are required because the appropriate satellite assembly is missing. Microsoft has a KB Article on this error that may help.
Also, if you go into the properties of your project and check the "Assembly Information" make sure "Neutral Language" is set to (None) (if you're calling the web service from a Windows Application), otherwise you'll have to provide a resource file for the language selected there.
See if that helps at all, hope it does.
EDIT: Also check your RESX file to make sure the resource/namespace names match up with your application
This post has been edited by PsychoCoder: 12 Feb, 2008 - 08:12 PM
Unfortunately, this is not a windows form project. It is just the Web Service itself.
The error is being thrown in the generated code found here, in the sections marked sqlInsertCommand1 and sqlUpdateCommand1. It works just find if I comment them out, which of course is not using the ComponentResourceManager, and naturally then I cannot insert or update with the SqlDataAdapter.
CODE
Private Sub InitializeComponent() Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(Employee)) Me.sqlSelectCommand1 = New System.Data.SqlClient.SqlCommand Me.sqlInsertCommand1 = New System.Data.SqlClient.SqlCommand Me.sqlUpdateCommand1 = New System.Data.SqlClient.SqlCommand Me.sqlDeleteCommand1 = New System.Data.SqlClient.SqlCommand Me.sqlDataAdapter1 = New System.Data.SqlClient.SqlDataAdapter Me.sqlConnection1 = New System.Data.SqlClient.SqlConnection ' 'sqlSelectCommand1 ' Me.sqlSelectCommand1.CommandText = "SELECT EmployeeInformation.*" & Global.Microsoft.VisualBasic.ChrW(13) & Global.Microsoft.VisualBasic.ChrW(10) & "FROM EmployeeInformation" Me.sqlSelectCommand1.Connection = Me.sqlConnection1 ' 'sqlInsertCommand1 ' ************** First error is thrown on next line ***************************** Me.sqlInsertCommand1.CommandText = resources.GetString("sqlInsertCommand1.CommandText") Me.sqlInsertCommand1.Connection = Me.sqlConnection1 Me.sqlInsertCommand1.Parameters.AddRange(New System.Data.SqlClient.SqlParameter() {New System.Data.SqlClient.SqlParameter("@EmployeeID", System.Data.SqlDbType.Int, 0, "EmployeeID"), New System.Data.SqlClient.SqlParameter("@FirstName", System.Data.SqlDbType.VarChar, 0, "FirstName"), New System.Data.SqlClient.SqlParameter("@LastName", System.Data.SqlDbType.VarChar, 0, "LastName"), New System.Data.SqlClient.SqlParameter("@BirthDate", System.Data.SqlDbType.DateTime, 0, "BirthDate"), New System.Data.SqlClient.SqlParameter("@Gender", System.Data.SqlDbType.[Char], 0, "Gender"), New System.Data.SqlClient.SqlParameter("@MaritalStatus", System.Data.SqlDbType.[Char], 0, "MaritalStatus"), New System.Data.SqlClient.SqlParameter("@PermanantAddress1", System.Data.SqlDbType.VarChar, 0, "PermanantAddress1"), New System.Data.SqlClient.SqlParameter("@PermanantAddress2", System.Data.SqlDbType.VarChar, 0, "PermanantAddress2"), New System.Data.SqlClient.SqlParameter("@PermanantAddress3", System.Data.SqlDbType.VarChar, 0, "PermanantAddress3"), New System.Data.SqlClient.SqlParameter("@PermanantCity", System.Data.SqlDbType.VarChar, 0, "PermanantCity"), New System.Data.SqlClient.SqlParameter("@PermanantZip", System.Data.SqlDbType.VarChar, 0, "PermanantZip"), New System.Data.SqlClient.SqlParameter("@CommunicationAddress1", System.Data.SqlDbType.VarChar, 0, "CommunicationAddress1"), New System.Data.SqlClient.SqlParameter("@CommunicationAddress2", System.Data.SqlDbType.VarChar, 0, "CommunicationAddress2"), New System.Data.SqlClient.SqlParameter("@CommunicationAddress3", System.Data.SqlDbType.VarChar, 0, "CommunicationAddress3"), New System.Data.SqlClient.SqlParameter("@CommunicationCity", System.Data.SqlDbType.VarChar, 0, "CommunicationCity"), New System.Data.SqlClient.SqlParameter("@CommunicationZip", System.Data.SqlDbType.VarChar, 0, "CommunicationZip"), New System.Data.SqlClient.SqlParameter("@AreaOfExpertise", System.Data.SqlDbType.VarChar, 0, "AreaOfExpertise"), New System.Data.SqlClient.SqlParameter("@LastCompany", System.Data.SqlDbType.VarChar, 0, "LastCompany"), New System.Data.SqlClient.SqlParameter("@LastSalary", System.Data.SqlDbType.[Decimal], 0, System.Data.ParameterDirection.Input, False, CType(10, Byte), CType(2, Byte), "LastSalary", System.Data.DataRowVersion.Current, Nothing), New System.Data.SqlClient.SqlParameter("@TechnicalInterviewPassed", System.Data.SqlDbType.Bit, 0, "TechnicalInterviewPassed"), New System.Data.SqlClient.SqlParameter("@ManagementInterviewPassed", System.Data.SqlDbType.Bit, 0, "ManagementInterviewPassed"), New System.Data.SqlClient.SqlParameter("@TechnicalInterviewFeedback", System.Data.SqlDbType.VarChar, 0, "TechnicalInterviewFeedback"), New System.Data.SqlClient.SqlParameter("@ManagementInterviewFeedback", System.Data.SqlDbType.VarChar, 0, "ManagementInterviewFeedback")}) ' 'sqlUpdateCommand1 '************** second error is thrown on next line ***************************** Me.sqlUpdateCommand1.CommandText = resources.GetString("sqlUpdateCommand1.CommandText") Me.sqlUpdateCommand1.Connection = Me.sqlConnection1 Me.sqlUpdateCommand1.Parameters.AddRange(New System.Data.SqlClient.SqlParameter() {New System.Data.SqlClient.SqlParameter("@EmployeeID", System.Data.SqlDbType.Int, 0, "EmployeeID"), New System.Data.SqlClient.SqlParameter("@FirstName", System.Data.SqlDbType.VarChar, 0, "FirstName"), New System.Data.SqlClient.SqlParameter("@LastName", System.Data.SqlDbType.VarChar, 0, "LastName"), New System.Data.SqlClient.SqlParameter("@BirthDate", System.Data.SqlDbType.DateTime, 0, "BirthDate"), New System.Data.SqlClient.SqlParameter("@Gender", System.Data.SqlDbType.[Char], 0, "Gender"), New System.Data.SqlClient.SqlParameter("@MaritalStatus", System.Data.SqlDbType.[Char], 0, "MaritalStatus"), New System.Data.SqlClient.SqlParameter("@PermanantAddress1", System.Data.SqlDbType.VarChar, 0, "PermanantAddress1"), New System.Data.SqlClient.SqlParameter("@PermanantAddress2", System.Data.SqlDbType.VarChar, 0, "PermanantAddress2"), New System.Data.SqlClient.SqlParameter("@PermanantAddress3", System.Data.SqlDbType.VarChar, 0, "PermanantAddress3"), New System.Data.SqlClient.SqlParameter("@PermanantCity", System.Data.SqlDbType.VarChar, 0, "PermanantCity"), New System.Data.SqlClient.SqlParameter("@PermanantZip", System.Data.SqlDbType.VarChar, 0, "PermanantZip"), New System.Data.SqlClient.SqlParameter("@CommunicationAddress1", System.Data.SqlDbType.VarChar, 0, "CommunicationAddress1"), New System.Data.SqlClient.SqlParameter("@CommunicationAddress2", System.Data.SqlDbType.VarChar, 0, "CommunicationAddress2"), New System.Data.SqlClient.SqlParameter("@CommunicationAddress3", System.Data.SqlDbType.VarChar, 0, "CommunicationAddress3"), New System.Data.SqlClient.SqlParameter("@CommunicationCity", System.Data.SqlDbType.VarChar, 0, "CommunicationCity"), New System.Data.SqlClient.SqlParameter("@CommunicationZip", System.Data.SqlDbType.VarChar, 0, "CommunicationZip"), New System.Data.SqlClient.SqlParameter("@AreaOfExpertise", System.Data.SqlDbType.VarChar, 0, "AreaOfExpertise"), New System.Data.SqlClient.SqlParameter("@LastCompany", System.Data.SqlDbType.VarChar, 0, "LastCompany"), New System.Data.SqlClient.SqlParameter("@LastSalary", System.Data.SqlDbType.[Decimal], 0, System.Data.ParameterDirection.Input, False, CType(10, Byte), CType(2, Byte), "LastSalary", System.Data.DataRowVersion.Current, Nothing), New System.Data.SqlClient.SqlParameter("@TechnicalInterviewPassed", System.Data.SqlDbType.Bit, 0, "TechnicalInterviewPassed"), New System.Data.SqlClient.SqlParameter("@ManagementInterviewPassed", System.Data.SqlDbType.Bit, 0, "ManagementInterviewPassed"), New System.Data.SqlClient.SqlParameter("@TechnicalInterviewFeedback", System.Data.SqlDbType.VarChar, 0, "TechnicalInterviewFeedback"), New System.Data.SqlClient.SqlParameter("@ManagementInterviewFeedback", System.Data.SqlDbType.VarChar, 0, "ManagementInterviewFeedback"), New System.Data.SqlClient.SqlParameter("@Original_EmployeeID", System.Data.SqlDbType.Int, 0, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "EmployeeID", System.Data.DataRowVersion.Original, Nothing)}) ' 'sqlDeleteCommand1 ' Me.sqlDeleteCommand1.CommandText = "DELETE FROM [EmployeeInformation] WHERE (([EmployeeID] = @Original_EmployeeID))" Me.sqlDeleteCommand1.Connection = Me.sqlConnection1 Me.sqlDeleteCommand1.Parameters.AddRange(New System.Data.SqlClient.SqlParameter() {New System.Data.SqlClient.SqlParameter("@Original_EmployeeID", System.Data.SqlDbType.Int, 0, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "EmployeeID", System.Data.DataRowVersion.Original, Nothing)}) ' 'sqlDataAdapter1 ' Me.sqlDataAdapter1.DeleteCommand = Me.sqlDeleteCommand1 Me.sqlDataAdapter1.InsertCommand = Me.sqlInsertCommand1 Me.sqlDataAdapter1.SelectCommand = Me.sqlSelectCommand1 Me.sqlDataAdapter1.TableMappings.AddRange(New System.Data.Common.DataTableMapping() {New System.Data.Common.DataTableMapping("Table", "EmployeeInformation", New System.Data.Common.DataColumnMapping() {New System.Data.Common.DataColumnMapping("EmployeeID", "EmployeeID"), New System.Data.Common.DataColumnMapping("FirstName", "FirstName"), New System.Data.Common.DataColumnMapping("LastName", "LastName"), New System.Data.Common.DataColumnMapping("BirthDate", "BirthDate"), New System.Data.Common.DataColumnMapping("Gender", "Gender"), New System.Data.Common.DataColumnMapping("MaritalStatus", "MaritalStatus"), New System.Data.Common.DataColumnMapping("PermanantAddress1", "PermanantAddress1"), New System.Data.Common.DataColumnMapping("PermanantAddress2", "PermanantAddress2"), New System.Data.Common.DataColumnMapping("PermanantAddress3", "PermanantAddress3"), New System.Data.Common.DataColumnMapping("PermanantCity", "PermanantCity"), New System.Data.Common.DataColumnMapping("PermanantZip", "PermanantZip"), New System.Data.Common.DataColumnMapping("CommunicationAddress1", "CommunicationAddress1"), New System.Data.Common.DataColumnMapping("CommunicationAddress2", "CommunicationAddress2"), New System.Data.Common.DataColumnMapping("CommunicationAddress3", "CommunicationAddress3"), New System.Data.Common.DataColumnMapping("CommunicationCity", "CommunicationCity"), New System.Data.Common.DataColumnMapping("CommunicationZip", "CommunicationZip"), New System.Data.Common.DataColumnMapping("AreaOfExpertise", "AreaOfExpertise"), New System.Data.Common.DataColumnMapping("LastCompany", "LastCompany"), New System.Data.Common.DataColumnMapping("LastSalary", "LastSalary"), New System.Data.Common.DataColumnMapping("TechnicalInterviewPassed", "TechnicalInterviewPassed"), New System.Data.Common.DataColumnMapping("ManagementInterviewPassed", "ManagementInterviewPassed"), New System.Data.Common.DataColumnMapping("TechnicalInterviewFeedback", "TechnicalInterviewFeedback"), New System.Data.Common.DataColumnMapping("ManagementInterviewFeedback", "ManagementInterviewFeedback")})}) Me.sqlDataAdapter1.UpdateCommand = Me.sqlUpdateCommand1 ' 'sqlConnection1 ' Me.sqlConnection1.ConnectionString = "Data Source=WILD-MAN\SQLEXPRESS;Initial Catalog=AdventureWorks;Integrated Securit" & _ "y=True" Me.sqlConnection1.FireInfoMessageEventOnUserErrors = False
End Sub
QUOTE(PsychoCoder @ 12 Feb, 2008 - 08:08 PM)
EDIT: Also check your RESX file to make sure the resource/namespace names match up with your application
I have even tried using REGEN to manually create a resource file and then used AL to link it together. However, this did not solve the problem.
Where in the RESX file is that located?
I see one tag that has the namespace attribute, but this is all generated code.
Here is the RESX file:
CODE
<?xml version="1.0" encoding="utf-8"?> <root> <!-- Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format that is mostly human readable. The generation and parsing of the various data types are done through the TypeConverter classes associated with the data types.
Example:
... ado.net/XML headers & schema ... <resheader name="resmimetype">text/microsoft-resx</resheader> <resheader name="version">2.0</resheader> <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> <value>[base64 mime encoded serialized .NET Framework object]</value> </data> <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> <comment>This is a comment</comment> </data>
There are any number of "resheader" rows that contain simple name/value pairs.
Each data row contains a name, and value. The row also contains a type or mimetype. Type corresponds to a .NET class that support text/value conversion through the TypeConverter architecture. Classes that don't support this are serialized and stored with the mimetype set.
The mimetype is used for serialized objects, and tells the ResXResourceReader how to depersist the object. This is currently not extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format that the ResXResourceWriter will generate, however the reader can read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64 value : The object must be serialized with : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter : and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64 value : The object must be serialized with : System.Runtime.Serialization.Formatters.Soap.SoapFormatter : and then encoded with base64 encoding.
The RESX file was auto generated by VS, when I added the SqlDataAdapter to the ASMX page designer.
Looks like this is a bug in VS 2005, according to the bug report found here. The repro steps are exactly the same as what I did. It has been given a status of Resolved (Won't Fix). It really sucks when they decide they don't want to fix a bug for whatever reason.
I finally just worked around the problem by grabbing the SQL statements and replacing the resources.GetString("sqlInsertCommand1.CommandText") with the SQL statements themselves. Now everything is working as it is supposed to.
Thats what I was afraid of, I see that error a lot when someone is upgrading their project from 2003 to 2005, but this is the first time Ive seen it in a fresh 2005 project. I tried to find a better solution last night, but what you did was my last alternative, but you beat me to it.