简体   繁体   中英

Adding service reference to VB.NET project missing nested classes

Having trouble adding a service reference for a vb project in vs2010. I'm able to add the service reference but some of the nested classes (class.nestedclass) are missing. These classes show up fine if I add the service reference in c# project.

I don't have access to the wcf service code, so it's hard to know exactly how the service is setup.

After some testing this is what was happening:

public partial class OuterClass
{
    public Nested nested { get; set; }

    public class Nested
    {
        public string prop { get; set; }
    }
}

When you reference this code from a vb project (service reference or otherwise) you can't see the Nested class because of the case sensitivity issue

Works fine in the c# world, not so much in vb. Hope this helps someone.

This is a long shot, but are there nested classes with the same name, but different case within the outer class? This will work fine from C#, but since VB is case-insensitive, it will regard those 2 classes as a conflict (and will not provide any intellisense for either).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM