admin管理员组

文章数量:1278851

so I'm working on a VB application for my workplace. We have several of these legacy apps that were created for various parts of production to perform simple tasks. Most of them involve barcoding.

Well, so many times now when I go back to work on some of these programs and update them as managers request additions, various errors will occur breaking the Designer screens in any of these apps we have made.

Just today I was working on this program, testing it fine, then suddenly when I went to test it again, I got 16 of the BC30560 errors, on all of the "padding" sections of the design.vb files, stating 'Padding' is ambiguous.

I have tried qualifying padding, with System.Windows.Forms, the error remained the same. I tried deleting(but backing up) the .design.vb item hoping that when I reopened the designer it would recreate it. It gave errors stating it could not create any of the objects in the form. I tried commenting out all of the padding lines and received the same error as deleting the .design.vb document. I tried Including System.Windows.Forms with no changes.

Each of these fixes followed with Clean Solution and Rebuild solution.

And actually, as writing this, I tried again commenting out all of the padding statements, and this time it actually resolved the issue. Previously, it did not.

We actually create multiple backup copies of the entire project folder every time we update the apps and make changes because this is such a frequent issue for us.

I have decided to still submit this even though my current program is good (for now) because this is such a frequent issue, and every time it happens, there is minimal help for it on the web. We multiple times have had to actually rebuild the forms from scratch, just copy-pasting the controls and the code to get it to work due to the lack of support on this issue.

I am wondering if there are any known compatibility or updating issues involving VB and dotnet that can be avoided in the future? Normally, we don't touch these apps for one or multiple years at a time, because they rarely need changes. But whenever we do go back, all of the designer windows break and cause major issues. I will link a small snippet of the .design.vb file that is throwing the issue in this instance.

        ' pic1
    ' 
    pic1.BackColor = Color.White
    pic1.Location = New Point(277, 93)
    pic1.Margin = New Padding(3, 4, 3, 4)
    pic1.Name = "pic1"
    pic1.Size = New Size(355, 105)
    pic1.TabIndex = 0
    pic1.TabStop = False
    ' 

Again, this is the Automatically Generated code from the .design.vb files created by the Visual Studio VB Design window. We have never edited any of these manually, except when trying to resolve any of the various issues.

I wish I had more examples off the top of my head of the errors that throw, but they're always different, and they always break the design screens, preventing the app from being worked on, built or tested.

Any insight on this would be hugely appreciated.

Thanks,

so I'm working on a VB application for my workplace. We have several of these legacy apps that were created for various parts of production to perform simple tasks. Most of them involve barcoding.

Well, so many times now when I go back to work on some of these programs and update them as managers request additions, various errors will occur breaking the Designer screens in any of these apps we have made.

Just today I was working on this program, testing it fine, then suddenly when I went to test it again, I got 16 of the BC30560 errors, on all of the "padding" sections of the design.vb files, stating 'Padding' is ambiguous.

I have tried qualifying padding, with System.Windows.Forms, the error remained the same. I tried deleting(but backing up) the .design.vb item hoping that when I reopened the designer it would recreate it. It gave errors stating it could not create any of the objects in the form. I tried commenting out all of the padding lines and received the same error as deleting the .design.vb document. I tried Including System.Windows.Forms with no changes.

Each of these fixes followed with Clean Solution and Rebuild solution.

And actually, as writing this, I tried again commenting out all of the padding statements, and this time it actually resolved the issue. Previously, it did not.

We actually create multiple backup copies of the entire project folder every time we update the apps and make changes because this is such a frequent issue for us.

I have decided to still submit this even though my current program is good (for now) because this is such a frequent issue, and every time it happens, there is minimal help for it on the web. We multiple times have had to actually rebuild the forms from scratch, just copy-pasting the controls and the code to get it to work due to the lack of support on this issue.

I am wondering if there are any known compatibility or updating issues involving VB and dotnet that can be avoided in the future? Normally, we don't touch these apps for one or multiple years at a time, because they rarely need changes. But whenever we do go back, all of the designer windows break and cause major issues. I will link a small snippet of the .design.vb file that is throwing the issue in this instance.

        ' pic1
    ' 
    pic1.BackColor = Color.White
    pic1.Location = New Point(277, 93)
    pic1.Margin = New Padding(3, 4, 3, 4)
    pic1.Name = "pic1"
    pic1.Size = New Size(355, 105)
    pic1.TabIndex = 0
    pic1.TabStop = False
    ' 

Again, this is the Automatically Generated code from the .design.vb files created by the Visual Studio VB Design window. We have never edited any of these manually, except when trying to resolve any of the various issues.

I wish I had more examples off the top of my head of the errors that throw, but they're always different, and they always break the design screens, preventing the app from being worked on, built or tested.

Any insight on this would be hugely appreciated.

Thanks,

Share Improve this question edited Feb 24 at 22:52 Craig 2,4841 gold badge22 silver badges27 bronze badges asked Feb 24 at 18:16 K. RileK. Rile 112 bronze badges 8
  • 1 Cross-posted: learn.microsoft/en-us/answers/questions/2181840/… – Tim Williams Commented Feb 24 at 18:21
  • The following may be of interest: Report a problem with the Visual Studio product or installer – It all makes cents Commented Feb 24 at 18:50
  • 2 'Padding' is ambiguous means that your project has something named Padding in multiple namespaces (see Namespace), and it's unclear which one you want to use. Also see Imports Statement. First thing to check is if VS randomly added some unncessary Imports statement. If so, remove it. – It all makes cents Commented Feb 24 at 18:56
  • When there's an ambiguity generated by conflicting names in different namespaces, you are also notified which namespaces generate the conflict. Have you tried to press ALT+ENTER on the affected Property, to see what suggestions may apply in your case? -- Sometimes, when writing some lines of code that implicitly invokes elements contained in an assembly not yet referenced, the wrong namespace is added to a Project (often happens with System.Windows.Controls in WinForms). Verify whether this is the case -- This doesn't appear to be related to VBA, but VB.NET (very different things) – Jimi Commented Feb 24 at 18:59
  • 1 Re the suggestion to check Imports statements, you may also need to check on the project settings, since VB will allow project-wide namespace import to be done there. It's located on the References ply in the checklist entitled "Importated namespaces". – Craig Commented Feb 24 at 21:54
 |  Show 3 more comments

1 Answer 1

Reset to default 0

Try the steps below to see if that helps.

  • Make sure Visual Studio is up to date and update all NuGet packages.
  • Clear and rebuild project.
  • Delete the .vs Folder and bin/obj Folders.

Have you tried to reproduce the issue in a newly created project, or is the issue specific to the current project?

本文标签: vbnetVB Error BC30560 39Padding39 is ambiguous in the namespace 39SystemWindowsForms39Stack Overflow