Protected types can only be decalred inside of a class

I am using VS2005Pro Beta2 to modify a program originally written in VB2005 Express Beta2. In the Express version it compiles just fine, but when I try to compile it in VS2005 then I constantly get an error saying "Protected types can only be decalred inside of a class". The error is found in the Application.Designer.vb file which is auto-generated.
So my question is: Is this a general problem with VS2005 or is it me? I'm also having troubles compiling other projects so I think there's a bigger problem with VS2005. Is there a solution to this problem?
Namespace My

'NOTE: This file is auto-generated, do not modify it directly. To make changes,
' or if you encounter build errors in this file, go to the Project Designer
' (go to project properties or double-click on the My Project node in the
' Solution Explorer), and make changes on the Application tab.
'
Partial Protected Class MyApplication

<Global.System.Diagnostics.DebuggerStepThrough()> _
Public Sub New()
MyBase.New(Microsoft.VisualBasic.ApplicationServices.AuthenticationMode.Windows)
Me.IsSingleInstance = true
Me.EnableVisualStyles = true
Me.SaveMySettingsOnExit = true
Me.ShutDownStyle = Microsoft.VisualBasic.ApplicationServices.ShutdownMode.AfterAllFormsClose
End Sub

<Global.System.Diagnostics.DebuggerStepThrough()> _
Protected Overrides Sub OnCreateMainForm()
Me.MainForm = Global.OfficeAdministrator.frmLogin
End Sub

<Global.System.Diagnostics.DebuggerStepThrough()> _
Protected Overrides Sub OnCreateSplashScreen()
Me.SplashScreen = Global.OfficeAdministrator.sscAdmin
End Sub
End Class
End Namespace
JJRDK

[1744 byte] By [jjrdk] at [2007-12-16]
# 1
Just change the class declaration to



Partial Class MyApplication

Dustin_H at 2007-9-9 > top of Msdn Tech,Visual Basic,Visual Basic General...
# 2
I've already tried that, but that opens up a whole lot of new error messages. Now all the "My" refreences result in Null References.
jjrdk
jjrdk at 2007-9-9 > top of Msdn Tech,Visual Basic,Visual Basic General...
# 3
Here's the code generated from my copy of vb 2005 b2
Note, if you changed the name of your app or form1 or splashscreen, remember to rename the variables Smile

Namespace My
'NOTE: This file is auto-generated; do not modify it directly. To make changes,
' or if you encounter build errors in this file, go to the Project Designer
' (go to Project Properties or double-click the My Project node in
' Solution Explorer), and make changes on the Application tab.
'

Partial Friend Class MyApplication
<
Global.System.Diagnostics.DebuggerStepThrough()> _
Public Sub New()
MyBase.New(Microsoft.VisualBasic.ApplicationServices.AuthenticationMode.Windows)
Me
.IsSingleInstance = false
Me.EnableVisualStyles = true
Me.SaveMySettingsOnExit = true
Me.ShutDownStyle = Microsoft.VisualBasic.ApplicationServices.ShutdownMode.AfterMainFormCloses
End Sub

<Global.System.Diagnostics.DebuggerStepThrough()> _
Protected Overrides Sub OnCreateMainForm()
Me.MainForm = Global.WindowsApplication1.Form1
End Sub

<Global.System.Diagnostics.DebuggerStepThrough()> _
Protected Overrides Sub OnCreateSplashScreen()
Me.SplashScreen = Global.WindowsApplication1.SplashScreen1
End Sub
End Class

End Namespace


Hope this template helps.
Dustin_H at 2007-9-9 > top of Msdn Tech,Visual Basic,Visual Basic General...
# 4
Thanks for the code sample. I think it is pretty much like the one I posted, except my variables are changed. I have taken out the splash screen and it goes directly to the first form. The problem now is that since I erased the Form1 and set the frmLogin as the startup form the program insists on starting up in Form1 which it creates as an empty grey form. No login, no access to the rest of the application.
I should probably mention there was no problems running this program through the express edition.
jjrdk
jjrdk at 2007-9-9 > top of Msdn Tech,Visual Basic,Visual Basic General...
# 5
The only difference i see is the Partial Friend Class MyApplication

Not too sure what else you could do other then create a new project then re-include your files again. Not too much work needed to be done. (Not that it's a pleasant fix)

Dustin_H at 2007-9-9 > top of Msdn Tech,Visual Basic,Visual Basic General...
# 6
It didn't really fix anything. The program refuses to start up in frmLogin and only displays a grey form. Is this a limitation in the Beta, that you have to start up in Form1?
jjrdk
jjrdk at 2007-9-9 > top of Msdn Tech,Visual Basic,Visual Basic General...
# 7

I never had an issue changing the startup form in any .net vb ide.

Dustin_H at 2007-9-9 > top of Msdn Tech,Visual Basic,Visual Basic General...