Sabrecat

All,

Im not sure if this is the correct forum for this post but I am hoping that someone here has seen this problem before. This is becoming a real serious issue for me and I am hoping that the solution isnt "re-install" VS 2005.

When I create a project now in C# I am getting this error at run time.

"Could not find any resources appropriate for the specified culture or the neutral culture. Make sure "DonsLoanAnalysisTool.Form1.resources" was correctly embedded or linked into assembly "DonsLoanAnalysisTool" at compile time, or that all the satellite assemblies required are loadable and fully signed. "

This just started happening yesterday. The offending line of code is in the module Form1.Designer.cs and is

this.sqlSelectCommand1.CommandText = resources.GetString("sqlSelectCommand1.CommandText");

When I look at my project in solution explorer I see that there is a Form1.Resx and a form1.Resources. When I look at the resx file I see the select command text just as I entered it in the SqlDataAdapter wizard. When I look at form1.Resource in notepad I see a nagled version of the same Sql as well so it looks like the resource file is being generated correctly.

Can anyone tell me what has happened to my VS 2005 Any help is greatly appreciated!!



Re: Visual C# IDE Strange problem seen at runtime.

Sabrecat

To try and give as much info as possible here is a simple test project that fails with this error.

Form1.Designer.cs

Code Snippet

namespace simpleTest

{

partial class Form1

{

///

/// Required designer variable.

///

private System.ComponentModel.IContainer components = null;

///

/// Clean up any resources being used.

///

/// true if managed resources should be disposed; otherwise, false.

protected override void Dispose(bool disposing)

{

if (disposing && (components != null))

{

components.Dispose();

}

base.Dispose(disposing);

}

#region Windows Form Designer generated code

///

/// Required method for Designer support - do not modify

/// the contents of this method with the code editor.

///

private void InitializeComponent()

{

System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form1));

this.sqlConnection1 = new System.Data.SqlClient.SqlConnection();

this.sqlSelectCommand1 = new System.Data.SqlClient.SqlCommand();

this.sqlDataAdapter1 = new System.Data.SqlClient.SqlDataAdapter();

this.sqlUpdateCommand = new System.Data.SqlClient.SqlCommand();

this.sqlDeleteCommand = new System.Data.SqlClient.SqlCommand();

this.SuspendLayout();

//

// sqlConnection1

//

this.sqlConnection1.FireInfoMessageEventOnUserErrors = false;

//

// sqlSelectCommand1

//

this.sqlSelectCommand1.CommandText = "SELECT approved, noQualifies, changeDate, apprID\r\nFROM approveCountry" +

"Wide";

this.sqlSelectCommand1.Connection = this.sqlConnection1;

//

// sqlDataAdapter1

//

this.sqlDataAdapter1.DeleteCommand = this.sqlDeleteCommand;

this.sqlDataAdapter1.SelectCommand = this.sqlSelectCommand1;

this.sqlDataAdapter1.TableMappings.AddRange(new System.Data.Common.DataTableMapping[] {

new System.Data.Common.DataTableMapping("Table", "approveCountryWide", new System.Data.Common.DataColumnMapping[] {

new System.Data.Common.DataColumnMapping("approved", "approved"),

new System.Data.Common.DataColumnMapping("noQualifies", "noQualifies"),

new System.Data.Common.DataColumnMapping("changeDate", "changeDate"),

new System.Data.Common.DataColumnMapping("apprID", "apprID")})});

this.sqlDataAdapter1.UpdateCommand = this.sqlUpdateCommand;

//

// sqlUpdateCommand

//

this.sqlUpdateCommand.CommandText = resources.GetString("sqlUpdateCommand.CommandText");

this.sqlUpdateCommand.Connection = this.sqlConnection1;

this.sqlUpdateCommand.Parameters.AddRange(new System.Data.SqlClient.SqlParameter[] {

new System.Data.SqlClient.SqlParameter("@approved", System.Data.SqlDbType.Bit, 0, "approved"),

new System.Data.SqlClient.SqlParameter("@noQualifies", System.Data.SqlDbType.Bit, 0, "noQualifies"),

new System.Data.SqlClient.SqlParameter("@changeDate", System.Data.SqlDbType.DateTime, 0, "changeDate"),

new System.Data.SqlClient.SqlParameter("@IsNull_approved", System.Data.SqlDbType.Int, 0, System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "approved", System.Data.DataRowVersion.Original, true, null, "", "", ""),

new System.Data.SqlClient.SqlParameter("@Original_approved", System.Data.SqlDbType.Bit, 0, System.Data.ParameterDirection.Input, false, ((byte)(0)), ((byte)(0)), "approved", System.Data.DataRowVersion.Original, null),

new System.Data.SqlClient.SqlParameter("@IsNull_noQualifies", System.Data.SqlDbType.Int, 0, System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "noQualifies", System.Data.DataRowVersion.Original, true, null, "", "", ""),

new System.Data.SqlClient.SqlParameter("@Original_noQualifies", System.Data.SqlDbType.Bit, 0, System.Data.ParameterDirection.Input, false, ((byte)(0)), ((byte)(0)), "noQualifies", System.Data.DataRowVersion.Original, null),

new System.Data.SqlClient.SqlParameter("@IsNull_changeDate", System.Data.SqlDbType.Int, 0, System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "changeDate", System.Data.DataRowVersion.Original, true, null, "", "", ""),

new System.Data.SqlClient.SqlParameter("@Original_changeDate", System.Data.SqlDbType.DateTime, 0, System.Data.ParameterDirection.Input, false, ((byte)(0)), ((byte)(0)), "changeDate", System.Data.DataRowVersion.Original, null),

new System.Data.SqlClient.SqlParameter("@Original_apprID", System.Data.SqlDbType.Int, 0, System.Data.ParameterDirection.Input, false, ((byte)(0)), ((byte)(0)), "apprID", System.Data.DataRowVersion.Original, null),

new System.Data.SqlClient.SqlParameter("@apprID", System.Data.SqlDbType.Int, 4, "apprID")});

//

// sqlDeleteCommand

//

this.sqlDeleteCommand.CommandText = resources.GetString("sqlDeleteCommand.CommandText");

this.sqlDeleteCommand.Connection = this.sqlConnection1;

this.sqlDeleteCommand.Parameters.AddRange(new System.Data.SqlClient.SqlParameter[] {

new System.Data.SqlClient.SqlParameter("@IsNull_approved", System.Data.SqlDbType.Int, 0, System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "approved", System.Data.DataRowVersion.Original, true, null, "", "", ""),

new System.Data.SqlClient.SqlParameter("@Original_approved", System.Data.SqlDbType.Bit, 0, System.Data.ParameterDirection.Input, false, ((byte)(0)), ((byte)(0)), "approved", System.Data.DataRowVersion.Original, null),

new System.Data.SqlClient.SqlParameter("@IsNull_noQualifies", System.Data.SqlDbType.Int, 0, System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "noQualifies", System.Data.DataRowVersion.Original, true, null, "", "", ""),

new System.Data.SqlClient.SqlParameter("@Original_noQualifies", System.Data.SqlDbType.Bit, 0, System.Data.ParameterDirection.Input, false, ((byte)(0)), ((byte)(0)), "noQualifies", System.Data.DataRowVersion.Original, null),

new System.Data.SqlClient.SqlParameter("@IsNull_changeDate", System.Data.SqlDbType.Int, 0, System.Data.ParameterDirection.Input, ((byte)(0)), ((byte)(0)), "changeDate", System.Data.DataRowVersion.Original, true, null, "", "", ""),

new System.Data.SqlClient.SqlParameter("@Original_changeDate", System.Data.SqlDbType.DateTime, 0, System.Data.ParameterDirection.Input, false, ((byte)(0)), ((byte)(0)), "changeDate", System.Data.DataRowVersion.Original, null),

new System.Data.SqlClient.SqlParameter("@Original_apprID", System.Data.SqlDbType.Int, 0, System.Data.ParameterDirection.Input, false, ((byte)(0)), ((byte)(0)), "apprID", System.Data.DataRowVersion.Original, null)});

//

// Form1

//

this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);

this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;

this.ClientSize = new System.Drawing.Size(292, 273);

this.Name = "Form1";

this.Text = "Form1";

this.ResumeLayout(false);

}

#endregion

private System.Data.SqlClient.SqlConnection sqlConnection1;

private System.Data.SqlClient.SqlCommand sqlSelectCommand1;

private System.Data.SqlClient.SqlDataAdapter sqlDataAdapter1;

private System.Data.SqlClient.SqlCommand sqlDeleteCommand;

private System.Data.SqlClient.SqlCommand sqlUpdateCommand;

}

}

Form1.Cs

Code Snippet

using System;

using System.Collections.Generic;

using System.ComponentModel;

using System.Data;

using System.Drawing;

using System.Text;

using System.Windows.Forms;

namespace simpleTest

{

public partial class Form1 : Form

{

public Form1()

{

InitializeComponent();

}

}

}

Aside from removing connection info this is the code that gives the error exactly. This is the exact error text I am getting.

An unhandled exception of type 'System.Resources.MissingManifestResourceException' occurred in mscorlib.dll

Additional information: Could not find any resources appropriate for the specified culture or the neutral culture. Make sure "simpleTest.Form1.resources" was correctly embedded or linked into assembly "simpleTest" at compile time, or that all the satellite assemblies required are loadable and fully signed.

The error is occuring on

this.sqlUpdateCommand.CommandText = resources.GetString("sqlUpdateCommand.CommandText");

Im geting desparate here... I stopped in my work. I cant get any programs to run to do any sort of testing so any help that anyone can provide is immensely appreciated!!





Re: Visual C# IDE Strange problem seen at runtime.

Sabrecat

Well I have an answer of sorts. After spending a couple of hours with MS Technical support they have told me that this is a known bug, and that a workaround is to rename the forms with thenamespace in them. IE rename form1 to <nameSpace>.form1.cs. This seems like a real clunky work around and I am hoping that the fix for thiswillcome out soon, but in the meantime I canat least get some work done.

Its still irriating though that this worked just fine up until a couple of days ago when I installed a bunch of update from MS.





Re: Visual C# IDE Strange problem seen at runtime.

Sabrecat

Ok. Well I think I have found the root cause of my issue, but don't know the solution for it.

On a coworkers machine I see the following output from a build

Code Snippet

Task "GenerateResource"

"C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\bin\Resgen.exe" /useSourcePath /r:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Data.dll /r:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Deployment.dll /r:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.dll /r:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Drawing.dll /r:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Windows.Forms.dll /r:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Xml.dll /compile Form1.resx,obj\Debug\WindowsApplication2.Form1.resources

In the build output from my machine I see the following.

Code Snippet

Task "GenerateResource"

"C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\bin\Resgen.exe" /useSourcePath /r:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Data.dll /r:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Deployment.dll /r:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.dll /r:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Drawing.dll /r:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Windows.Forms.dll /r:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Xml.dll /compile Form1.resx,Form1.resources

Apparently the source of my problem is that the build is not assigning the correct output destination for my resource file. instead of form1.Resources it should be specifying "obj\Debug\errorTest.Form1.resources". Somehow apparently there is a setting for the output source for resources that is not getting setup correctly. Does anyone have any idea where I should look to change this setting

This problem is starting to really get annoying Sad





Re: Visual C# IDE Strange problem seen at runtime.

Sabrecat

I finally found my answer!!

There was a file that changed in the .net Framework. This was causing the resource to be compiled with the incorrect destination / name. In the Miscrosoft.CSharp.Targets file I was missing the following code.

Code Snippet

<!-- Create the target resource names for non-culture resx files. -->
<CreateCSharpManifestResourceName Condition="'@(ResxWithNoCulture)'!=''"
ResourceFiles="@(ResxWithNoCulture)"
RootNamespace="$(RootNamespace)">

<Output TaskParameter="ManifestResourceNames" ItemName="ManifestResourceWithNoCultureName"/>

</CreateCSharpManifestResourceName>

Once I replaced that file from a co-worker that didnt have the problem I had my problem was fixed. How this file changed I have no clue. I dont touch the framework files. I suspect that an update that I installed changed the file for me. The file had a change date of the date when I did a mass update ( had 29 updates I had to install ) and it was at that point that I started seeing the problem as well.

In any case Im just happy I found my solution Smile