Make sure you add the control dll to your app. See: https://wyday.com/wybuild/help/automatic-updates/automatic-updater-for-your-.net-app.php
Hi, I've been using wyBuild/wyUpdate/AutomaticUpdater in my project for a few months now. Recently, I've started encountering the following.
When I make changes to a form (I *think* any change that causes a change in frmMain.Designer.vb), Visual Studio generates the following two errors:
BC30002 Type 'wyDay.Controls.AutomaticUpdater' is not defined. BC30456 'Controls' is not a member of '<projectname>.wyDay'.
frmMain.Designer.vb has "Imports wyDay.Controls". The lines causing the two errors are:
Me.AutomaticUpdater1 = New wyDay.Controls.AutomaticUpdater()Me.AutomaticUpdater1.UpdateType = wyDay.Controls.UpdateType.CheckAndDownload
In both cases, if I remove the superflous "wyDay.Controls." - that is, change the two lines to:Me.AutomaticUpdater1 = New AutomaticUpdater()Me.AutomaticUpdater1.UpdateType = UpdateType.CheckAndDownload
, the errors disappear and I can compile.
However, the next time I make a change to the form, Visual Studio reinserts the two "wyDay.Controls.", and the errors come back.
I was using the AutomaticUpdater control for some months without ever seeing this, and I'm not *aware* of making any change that could cause it, though of course it's possible. (And I've been living with this issue for awhile before getting irritated enough to seek help, so it's conceivable I have simply forgotten something).
Any suggestions greatly appreciated.
Make sure you add the control dll to your app. See: https://wyday.com/wybuild/help/automatic-updates/automatic-updater-for-your-.net-app.php
Wyatt wrote:> Make sure you add the control dll to your app. See:> https://wyday.com/wybuild/help/automatic-updates/automatic-updater-for-your-.net-app.php
Hi WyattI did follow that procedure in the first place, both browsing to the dll and dragging the control to the form. I see the control available in the toolbox.
We can't reproduce this. My advice: never directly change the "frmMain.Designer.vb" file. Instead always use the IDE designed.
Also, the solution to a "reference not defined" type error is the same as it is for any other class:
1. Make sure the assembly is referenced in your project.
2. Make sure the namespaces are correct (and you're not poisoning the namespaces with your own).
3. Always use our build of the AutomaticUpdater. We don't support modified builds (for obvious reasons).
Wyatt wrote:> We can't reproduce this.
I'm not surprised - like I said, it was working fine for months, until this problem started happening (with no apparent cause, that I am aware of). I expect this is some weird artifact of my specific solution - I just don't know where to begin looking to solve it (and to be honest, my solution isn't very complicated or exotic!)
> My advice: never directly change the> "frmMain.Designer.vb" file. Instead always use the IDE designed.
I never have, *except* that I've adjusted the two references to the AutomaticUpdater control as previously detailed, to get it to compile. (Because if I don't, well, I can't compile!)
In other words, I've only done that *in response to this issue*, I'm sure it isn't the *cause* of the issue.
If you can suggest how I can get the IDE back to generating it correctly, well, that is exactly why I'm posting here 🙂
> Also, the solution to a "reference not defined" type error is the> same as it is for any other class:> > 1. Make sure the assembly is referenced in your project.
- The control appears in the toolbox. - "AutomaticUpdater" appears under "References" in Solution Explorer. - If I go to "Add Reference", "AutomaticUpdater.dll" is in the "Recent" list, and checked.
So unless I'm missing something, it is definitely referenced.
> 2. Make sure the namespaces are correct (and you're not poisoning the> namespaces with your own).
I haven't added any namespaces other than those automatically generated by the IDE (and my project name etc are nothing like "wyDay" or "AutomaticUpdater").
Beyond that, I'm not sure what you mean by "make sure the namespaces are correct"?
> 3. Always use our build of the AutomaticUpdater. We don't support modified> builds (for obvious reasons).
Of course. I've never built it from source myself, I'm just using the dll as provided.
I have just tried reinstalling wyBuild, removing the reference from my solution, and following the steps in the how-to you linked earlier - this doesn't seem to have helped.
Having done this, and dragging a new AutomaticUpdater control to my main form, I see the following lines generated in the designer:
Me.AutomaticUpdater2 = New wyDay.Controls.AutomaticUpdater()
Friend WithEvents AutomaticUpdater2 As wyDay.Controls.AutomaticUpdater
Can you confirm that these are correct? And that the designer should have:Imports wyDay.Controlsat the top?