Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Visual Studio.NET / IDE / May 2008

Tip: Looking for answers? Try searching our database.

Error from resource file's designer file

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
TS - 09 May 2008 17:58 GMT
i get the following error because the designer file creates a private
internal static property on the page that is named the same as the resource:
'HealthService': member names cannot be the same as their enclosing type

since this is not my code, how can i keep this error from happening aside
from deleting this designer file?
Wen Yuan Wang [MSFT] - 12 May 2008 10:16 GMT
Hello TS,

It seems you get an error said 'HealthService': member names cannot be the
same as their enclosing type. But "HealthService" member is defined in
Resource File's Designer file which generated by VS IDE, correct? If I
misunderstood anything here, please don't hesitate to correct me. We
haven't met such issue so far. In order to identity the issue, is it
possible for you to provide us detailed steps to reproduce the issue? This
could help on research very much. If you have any more concern, please also
feel free to let us know. We are glad to assist you. thanks.

Have a great day,
Best regards,
Wen Yuan

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
msdnmg@microsoft.com.
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
TS - 13 May 2008 21:02 GMT
here is the actual contents of designer.cs. the class is named HealthService
and so is the private member (internal static string HealthService ). So the
error says we can't have this internal member to be the same name but it is
a problem with the generated code:
//------------------------------------------------------------------------------

// <auto-generated>

// This code was generated by a tool.

// Runtime Version:2.0.50727.832

//

// Changes to this file may cause incorrect behavior and will be lost if

// the code is regenerated.

// </auto-generated>

//------------------------------------------------------------------------------

namespace DSHS.CMBHS.Resources {

using System;

/// <summary>

/// A strongly-typed resource class, for looking up localized strings, etc.

/// </summary>

// This class was auto-generated by the StronglyTypedResourceBuilder

// class via a tool like ResGen or Visual Studio.

// To add or remove a member, edit your .ResX file then rerun ResGen

// with the /str option, or rebuild your VS project.

[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder",
"2.0.0.0")]

[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]

[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]

internal class HealthService {

private static global::System.Resources.ResourceManager resourceMan;

private static global::System.Globalization.CultureInfo resourceCulture;

[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance",
"CA1811:AvoidUncalledPrivateCode")]

internal HealthService() {

}

/// <summary>

/// Returns the cached ResourceManager instance used by this class.

/// </summary>

[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]

internal static global::System.Resources.ResourceManager ResourceManager {

get {

if (object.ReferenceEquals(resourceMan, null)) {

global::System.Resources.ResourceManager temp = new
global::System.Resources.ResourceManager("DSHS.CMBHS.Resources.HealthService",
typeof(HealthService).Assembly);

resourceMan = temp;

}

return resourceMan;

}

}

/// <summary>

/// Overrides the current thread's CurrentUICulture property for all

/// resource lookups using this strongly typed resource class.

/// </summary>

[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]

internal static global::System.Globalization.CultureInfo Culture {

get {

return resourceCulture;

}

set {

resourceCulture = value;

}

}

/// <summary>

/// Looks up a localized string similar to Appointment Type.

/// </summary>

internal static string AppointmentType {

get {

return ResourceManager.GetString("AppointmentType", resourceCulture);

}

}

/// <summary>

/// Looks up a localized string similar to Billing Unit.

/// </summary>

internal static string BillingUnit {

get {

return ResourceManager.GetString("BillingUnit", resourceCulture);

}

}

/// <summary>

/// Looks up a localized string similar to Service Code.

/// </summary>

internal static string Code {

get {

return ResourceManager.GetString("Code", resourceCulture);

}

}

/// <summary>

/// Looks up a localized string similar to Credentials.

/// </summary>

internal static string Credentials {

get {

return ResourceManager.GetString("Credentials", resourceCulture);

}

}

/// <summary>

/// Looks up a localized string similar to Description.

/// </summary>

internal static string Description {

get {

return ResourceManager.GetString("Description", resourceCulture);

}

}

/// <summary>

/// Looks up a localized string similar to Duration.

/// </summary>

internal static string Duration {

get {

return ResourceManager.GetString("Duration", resourceCulture);

}

}

/// <summary>

/// Looks up a localized string similar to Effective Date.

/// </summary>

internal static string EffectiveDate {

get {

return ResourceManager.GetString("EffectiveDate", resourceCulture);

}

}

/// <summary>

/// Looks up a localized string similar to Encounter Type.

/// </summary>

internal static string EncounterType {

get {

return ResourceManager.GetString("EncounterType", resourceCulture);

}

}

/// <summary>

/// Looks up a localized string similar to End Date.

/// </summary>

internal static string EndDate {

get {

return ResourceManager.GetString("EndDate", resourceCulture);

}

}

/// <summary>

/// Looks up a localized string similar to Gender.

/// </summary>

internal static string Gender {

get {

return ResourceManager.GetString("Gender", resourceCulture);

}

}

/// <summary>

/// Looks up a localized string similar to Health Service.

/// </summary>

internal static string HealthService {

get {

return ResourceManager.GetString("HealthService", resourceCulture);

}

}

/// <summary>

/// Looks up a localized string similar to Medicaid Billing Code.

/// </summary>

internal static string MedicaidBillingCode {

get {

return ResourceManager.GetString("MedicaidBillingCode", resourceCulture);

}

}

/// <summary>

/// Looks up a localized string similar to Medicaid Funding Source.

/// </summary>

internal static string MedicaidFundSource {

get {

return ResourceManager.GetString("MedicaidFundSource", resourceCulture);

}

}

/// <summary>

/// Looks up a localized string similar to Medicaid Modifier 1.

/// </summary>

internal static string MedicaidModifier1 {

get {

return ResourceManager.GetString("MedicaidModifier1", resourceCulture);

}

}

/// <summary>

/// Looks up a localized string similar to Medicaid Modifier 2.

/// </summary>

internal static string MedicaidModifier2 {

get {

return ResourceManager.GetString("MedicaidModifier2", resourceCulture);

}

}

/// <summary>

/// Looks up a localized string similar to Medicaid Modifier 3.

/// </summary>

internal static string MedicaidModifier3 {

get {

return ResourceManager.GetString("MedicaidModifier3", resourceCulture);

}

}

/// <summary>

/// Looks up a localized string similar to Medicaid Modifier 4.

/// </summary>

internal static string MedicaidModifier4 {

get {

return ResourceManager.GetString("MedicaidModifier4", resourceCulture);

}

}

/// <summary>

/// Looks up a localized string similar to Modifier 1.

/// </summary>

internal static string Modifier1 {

get {

return ResourceManager.GetString("Modifier1", resourceCulture);

}

}

/// <summary>

/// Looks up a localized string similar to Modifier 2.

/// </summary>

internal static string Modifier2 {

get {

return ResourceManager.GetString("Modifier2", resourceCulture);

}

}

/// <summary>

/// Looks up a localized string similar to Modifier 3.

/// </summary>

internal static string Modifier3 {

get {

return ResourceManager.GetString("Modifier3", resourceCulture);

}

}

/// <summary>

/// Looks up a localized string similar to Modifier 4.

/// </summary>

internal static string Modifier4 {

get {

return ResourceManager.GetString("Modifier4", resourceCulture);

}

}

/// <summary>

/// Looks up a localized string similar to Program Type.

/// </summary>

internal static string ProgramType {

get {

return ResourceManager.GetString("ProgramType", resourceCulture);

}

}

/// <summary>

/// Looks up a localized string similar to Provider Type.

/// </summary>

internal static string ProviderType {

get {

return ResourceManager.GetString("ProviderType", resourceCulture);

}

}

/// <summary>

/// Looks up a localized string similar to Rate.

/// </summary>

internal static string Rate {

get {

return ResourceManager.GetString("Rate", resourceCulture);

}

}

/// <summary>

/// Looks up a localized string similar to Recipient Type.

/// </summary>

internal static string RecipientType {

get {

return ResourceManager.GetString("RecipientType", resourceCulture);

}

}

/// <summary>

/// Looks up a localized string similar to Service Location.

/// </summary>

internal static string ServiceLocation {

get {

return ResourceManager.GetString("ServiceLocation", resourceCulture);

}

}

/// <summary>

/// Looks up a localized string similar to Service Type.

/// </summary>

internal static string ServiceType {

get {

return ResourceManager.GetString("ServiceType", resourceCulture);

}

}

}

}

> Hello TS,
>
[quoted text clipped - 35 lines]
> This posting is provided "AS IS" with no warranties, and confers no
> rights.
Wen Yuan Wang [MSFT] - 14 May 2008 06:39 GMT
Hello TS,
Thanks your reply.

I have reproduced the issue. VS IDE generates an internal static string
HealthService, because you have created a member named"HealthService" in
HealthService.resx file. "HealthService" is the name of class. Members in
that class cannot contain the same name as its class.

Renaming member from "HealthService" to "healthService" could resolve the
issue. Another option is renaming the resource file in VS IDE Solution
Explorer. VS IDE re-generates designer.cs file according to the change you
made in resource file.

Hope this helps. Please try the above method and let me know if this method
works. If there is anything unclear, please also feel free to let us know.
We are glad to be of assistance.

Have a great day,
Best regards,
Wen Yuan
Microsoft Online Community Support
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
msdnmg@microsoft.com.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
TS - 14 May 2008 14:03 GMT
thanks that was it

> Hello TS,
> Thanks your reply.
[quoted text clipped - 26 lines]
> This posting is provided "AS IS" with no warranties, and confers no
> rights.
Wen Yuan Wang [MSFT] - 15 May 2008 04:02 GMT
You are welcome, TS.

Have a great day,
Best regards,
Wen Yuan
Microsoft Online Community Support
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
msdnmg@microsoft.com.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.