472,780 Members | 1,767 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,780 software developers and data experts.

Visual Studio isn't generating the Code Gen file (*.designer.vb)

I am an ASP.NET developer, and Visual Studio 2005 seems to have stopped
declaring the controls that I add in the *.designer.vb files, therefore
forcing me to manually add them before I can use them in code that I write
in the *.aspx.vb and *.ascx.vb files. Why is it no longer automatically
declaring the controls? Is there a way to manually force Visual Studio 2005
to regenerate these files? Is there a setting somewhere that could have
gotten changed that is causing Visual Studio 2005 to no longer declare the
controls I add in the *.designer.vb files? Thanks.
--
Nathan Sokalski
nj********@hotmail.com
http://www.nathansokalski.com/
May 12 '07 #1
7 8048
The designer.vb file is a VS2005-generated file and not intended for direct
edit. So, the right way to add controls to a page is adding them to the .aspx
file either in source mode or designer mode.

"Nathan Sokalski" wrote:
I am an ASP.NET developer, and Visual Studio 2005 seems to have stopped
declaring the controls that I add in the *.designer.vb files, therefore
forcing me to manually add them before I can use them in code that I write
in the *.aspx.vb and *.ascx.vb files. Why is it no longer automatically
declaring the controls? Is there a way to manually force Visual Studio 2005
to regenerate these files? Is there a setting somewhere that could have
gotten changed that is causing Visual Studio 2005 to no longer declare the
controls I add in the *.designer.vb files? Thanks.
--
Nathan Sokalski
nj********@hotmail.com
http://www.nathansokalski.com/
May 12 '07 #2
*.designer files are generated by VS 2005's Web Application
Project automatically, and you generally don't touch them.

You *can* edit them, as a last resort, for example to change the field's accessor
from "protected" to "public" but, generally, you should let the code generator do its thing.

Read Scott Guthrie's explanations of what *.designer files, their characteristics,
and the procedures to follow with them, here :

http://webproject.scottgu.com/CSharp...igration2.aspx

http://webproject.scottgu.com/CSharp...odeBehind.aspx

http://weblogs.asp.net/scottgu/archi...05/437439.aspx

The VS 2005 Web Application Project option should monitor both
source-view and design-view, and update the declarations appropriately.

If it isn't doing that, post a comment to Scott's blog, post to the VS 2005 web forums
( http://forums.microsoft.com/MSDN/def...pID=6&SiteID=1 ) ...or file a bug at
Connect.

btw, have you installed Visual Studio 2005 SP1 ?
It fixes quite a few bugs.

Also, apparently the first version released of WAP had the very problem you're describing.
Do you have the latest version installed ( with SP1 ) or, are you running the separate add-in ?

For an explanation regarding that, read Rick Strahl's blog :
http://west-wind.com/weblog/posts/4031.aspx

Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
======================================
"Nathan Sokalski" <nj********@hotmail.comwrote in message
news:%2****************@TK2MSFTNGP03.phx.gbl...
>I am an ASP.NET developer, and Visual Studio 2005 seems to have stopped declaring the controls that
I add in the *.designer.vb files, therefore forcing me to manually add them before I can use them
in code that I write in the *.aspx.vb and *.ascx.vb files. Why is it no longer automatically
declaring the controls? Is there a way to manually force Visual Studio 2005 to regenerate these
files? Is there a setting somewhere that could have gotten changed that is causing Visual Studio
2005 to no longer declare the controls I add in the *.designer.vb files? Thanks.
--
Nathan Sokalski
nj********@hotmail.com
http://www.nathansokalski.com/

May 12 '07 #3
Are you using a Web Site Project? If so then VS doesn't create them. If you
have VS 2005 Service Pack 1 installed than I suggest you use the Web
Application Project. This will create the designer files for the page.
Existing pages within an Web Application Project that may have come from a
Web Site Project can be converted by right-clicking on them once they're
added to the Web Application Project and click the option Convert to Web
Application Project. This will generate the designer file and change any
directives in the .aspx page necessary.
--
Hope this helps,
Mark Fitzpatrick
Former Microsoft FrontPage MVP 199?-2006

"Nathan Sokalski" <nj********@hotmail.comwrote in message
news:%2****************@TK2MSFTNGP03.phx.gbl...
>I am an ASP.NET developer, and Visual Studio 2005 seems to have stopped
declaring the controls that I add in the *.designer.vb files, therefore
forcing me to manually add them before I can use them in code that I write
in the *.aspx.vb and *.ascx.vb files. Why is it no longer automatically
declaring the controls? Is there a way to manually force Visual Studio 2005
to regenerate these files? Is there a setting somewhere that could have
gotten changed that is causing Visual Studio 2005 to no longer declare the
controls I add in the *.designer.vb files? Thanks.
--
Nathan Sokalski
nj********@hotmail.com
http://www.nathansokalski.com/

May 12 '07 #4
I do have Service Pack 1 installed, but clicking Convert to Web Application
Project did not seem to make any difference. Any other ideas? Thanks.
--
Nathan Sokalski
nj********@hotmail.com
http://www.nathansokalski.com/

"Mark Fitzpatrick" <ma******@fitzme.comwrote in message
news:On*************@TK2MSFTNGP06.phx.gbl...
Are you using a Web Site Project? If so then VS doesn't create them. If
you have VS 2005 Service Pack 1 installed than I suggest you use the Web
Application Project. This will create the designer files for the page.
Existing pages within an Web Application Project that may have come from a
Web Site Project can be converted by right-clicking on them once they're
added to the Web Application Project and click the option Convert to Web
Application Project. This will generate the designer file and change any
directives in the .aspx page necessary.
--
Hope this helps,
Mark Fitzpatrick
Former Microsoft FrontPage MVP 199?-2006

"Nathan Sokalski" <nj********@hotmail.comwrote in message
news:%2****************@TK2MSFTNGP03.phx.gbl...
>>I am an ASP.NET developer, and Visual Studio 2005 seems to have stopped
declaring the controls that I add in the *.designer.vb files, therefore
forcing me to manually add them before I can use them in code that I write
in the *.aspx.vb and *.ascx.vb files. Why is it no longer automatically
declaring the controls? Is there a way to manually force Visual Studio
2005 to regenerate these files? Is there a setting somewhere that could
have gotten changed that is causing Visual Studio 2005 to no longer
declare the controls I add in the *.designer.vb files? Thanks.
--
Nathan Sokalski
nj********@hotmail.com
http://www.nathansokalski.com/


May 12 '07 #5
I do have Service Pack 1 installed, and I realize that you are not supposed
to edit the *.designer.vb files (I wasn't editing them, I was simply looking
at them to see if that was the reason for my error, which it was). I looked
at all the links you provided, and tried all the suggested solutions (other
than reinstalling VS2005, which I don't think would be a good idea, since it
would mean reconfiguring all my settings, reinstalling any updates,
including the AjaxControlToolkit, not to mention it is a pain to spend all
that time reinstalling and registering it). I seem to remember having this
problem once before, but I don't remember what (if anything) I did to fix
it. Any other ideas? Thanks.
--
Nathan Sokalski
nj********@hotmail.com
http://www.nathansokalski.com/

"Juan T. Llibre" <no***********@nowhere.comwrote in message
news:ub**************@TK2MSFTNGP02.phx.gbl...
*.designer files are generated by VS 2005's Web Application
Project automatically, and you generally don't touch them.

You *can* edit them, as a last resort, for example to change the field's
accessor
from "protected" to "public" but, generally, you should let the code
generator do its thing.

Read Scott Guthrie's explanations of what *.designer files, their
characteristics,
and the procedures to follow with them, here :

http://webproject.scottgu.com/CSharp...igration2.aspx

http://webproject.scottgu.com/CSharp...odeBehind.aspx

http://weblogs.asp.net/scottgu/archi...05/437439.aspx

The VS 2005 Web Application Project option should monitor both
source-view and design-view, and update the declarations appropriately.

If it isn't doing that, post a comment to Scott's blog, post to the VS
2005 web forums
( http://forums.microsoft.com/MSDN/def...pID=6&SiteID=1 )
...or file a bug at Connect.

btw, have you installed Visual Studio 2005 SP1 ?
It fixes quite a few bugs.

Also, apparently the first version released of WAP had the very problem
you're describing.
Do you have the latest version installed ( with SP1 ) or, are you running
the separate add-in ?

For an explanation regarding that, read Rick Strahl's blog :
http://west-wind.com/weblog/posts/4031.aspx

Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
======================================
"Nathan Sokalski" <nj********@hotmail.comwrote in message
news:%2****************@TK2MSFTNGP03.phx.gbl...
>>I am an ASP.NET developer, and Visual Studio 2005 seems to have stopped
declaring the controls that I add in the *.designer.vb files, therefore
forcing me to manually add them before I can use them in code that I write
in the *.aspx.vb and *.ascx.vb files. Why is it no longer automatically
declaring the controls? Is there a way to manually force Visual Studio
2005 to regenerate these files? Is there a setting somewhere that could
have gotten changed that is causing Visual Studio 2005 to no longer
declare the controls I add in the *.designer.vb files? Thanks.
--
Nathan Sokalski
nj********@hotmail.com
http://www.nathansokalski.com/


May 12 '07 #6
I was not editing the *.designer.vb files, I was looking at them to see if
they were the source of my errors (being told that objects didn't exist,
when I knew they were in my *.aspx file). Any ideas on how to fix this
problem of Visual Studio 2005 not generating the *.designer.vb files?
Thanks.
--
Nathan Sokalski
nj********@hotmail.com
http://www.nathansokalski.com/

"Siva M" <sh******@online.excite.comwrote in message
news:18**********************************@microsof t.com...
The designer.vb file is a VS2005-generated file and not intended for
direct
edit. So, the right way to add controls to a page is adding them to the
.aspx
file either in source mode or designer mode.

"Nathan Sokalski" wrote:
>I am an ASP.NET developer, and Visual Studio 2005 seems to have stopped
declaring the controls that I add in the *.designer.vb files, therefore
forcing me to manually add them before I can use them in code that I
write
in the *.aspx.vb and *.ascx.vb files. Why is it no longer automatically
declaring the controls? Is there a way to manually force Visual Studio
2005
to regenerate these files? Is there a setting somewhere that could have
gotten changed that is causing Visual Studio 2005 to no longer declare
the
controls I add in the *.designer.vb files? Thanks.
--
Nathan Sokalski
nj********@hotmail.com
http://www.nathansokalski.com/

May 12 '07 #7
I noticed a strange warning that is shown anytime I add a new control. Here
is a copy of the warning:
Warning 2 Generation of designer file failed: The relative virtual path '?/'
is not allowed here. C:\Inetpub\wwwroot\CAT_aspnet\worldnews.aspx 0 0
CAT_aspnet
Three things that I noticed about this warning are the following:

1. The strange foreign character (?) that it says is trying to be used as a
relative virtual path
2. It says it is located at Line 0, Column 0, which is not a valid location
(or if it is, Visual Studio 2005 doesn't show it, since it starts numbering
the lines at 1)
3. I tried opening the file it says the error is in using other text editors
as well, such as Notepad, and there are no unexpected characters there. In
other words, I cannot find the ? character anywhere using any editor.
This same warning, with the same strange foreign character, is displayed
regardless of which file I am trying to add a control to. I have looked at
all of the files that it claims contain the strange foreign character, and
none of them have it (at least I can't find it, or any other characters that
I didn't add in Visual Studio 2005). What's going on here? I may not have
found the solution to my problem with Visual Studio 2005 generating the
*.designer.vb files, but at I it knows it's not generating them, and I am
assuming this is the source of the problem. Any ideas?
--
Nathan Sokalski
nj********@hotmail.com
http://www.nathansokalski.com/

"Nathan Sokalski" <nj********@hotmail.comwrote in message
news:%2****************@TK2MSFTNGP03.phx.gbl...
>I am an ASP.NET developer, and Visual Studio 2005 seems to have stopped
declaring the controls that I add in the *.designer.vb files, therefore
forcing me to manually add them before I can use them in code that I write
in the *.aspx.vb and *.ascx.vb files. Why is it no longer automatically
declaring the controls? Is there a way to manually force Visual Studio 2005
to regenerate these files? Is there a setting somewhere that could have
gotten changed that is causing Visual Studio 2005 to no longer declare the
controls I add in the *.designer.vb files? Thanks.
--
Nathan Sokalski
nj********@hotmail.com
http://www.nathansokalski.com/

May 15 '07 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: google | last post by:
Hi, after fighting with an issue in Visual Studio.NET 2003 in aspx, I've finally figured out what it is and maybe you might find it usefull. Symptoms: When you try to open a .aspx or...
3
by: ME | last post by:
I am going insane. Every time I switch between a .cs, designer, or some other type of file in Visual Studio my Toolbars move. I really want my toolbars to STAY put were I put them! I end up...
2
by: Nathan Sokalski | last post by:
Because I wanted the builds for my ASP.NET sites to be a single *.dll in a /bin/ directory (like VSNET 2003), I decided to try the Web Application Project download. However, I am still pulling my...
8
by: WT | last post by:
Is it normal that Visual Studio sets the PreInit handler for a Page from the OnInit code ? No chance to fire it as OnPreInit is run befor OnInit. ??? CS
1
by: Nathan Sokalski | last post by:
Visual Studio 2005 recently stopped generating the *.designer.vb files for my *.aspx and *.ascx files. I am using Service Pack 1, and do not believe I did anything differently than normal prior to...
1
by: Nathan Sokalski | last post by:
Visual Studio 2005 unexpectedly stopped generating the *.designer.vb files for *.aspx and *.ascx files. After a few days of frustration trying to fix this, I noticed that it had the following...
4
by: Goran Djuranovic | last post by:
Hi all, I am experiencing a strange thing happening with a "designer.vb" page. Controls I manually declare in this page are automatically deleted after I drop another control on a ".aspx" page. -...
1
by: ergolargo | last post by:
Hello all Apologies if I've picked the wrong forum, but can anybody offer assistance to me? I'm definitely struggling to get my first data access layer generated using the Dataset Designer in...
0
jwwicks
by: jwwicks | last post by:
Introduction This tutorial describes how to use Visual Studio to create a new C++ program, compile/run a program, resume work on an existing program and debug a program. It is aimed at the...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 2 August 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: erikbower65 | last post by:
Using CodiumAI's pr-agent is simple and powerful. Follow these steps: 1. Install CodiumAI CLI: Ensure Node.js is installed, then run 'npm install -g codiumai' in the terminal. 2. Connect to...
0
linyimin
by: linyimin | last post by:
Spring Startup Analyzer generates an interactive Spring application startup report that lets you understand what contributes to the application startup time and helps to optimize it. Support for...
0
by: erikbower65 | last post by:
Here's a concise step-by-step guide for manually installing IntelliJ IDEA: 1. Download: Visit the official JetBrains website and download the IntelliJ IDEA Community or Ultimate edition based on...
0
by: kcodez | last post by:
As a H5 game development enthusiast, I recently wrote a very interesting little game - Toy Claw ((http://claw.kjeek.com/))。Here I will summarize and share the development experience here, and hope it...
0
by: Rina0 | last post by:
I am looking for a Python code to find the longest common subsequence of two strings. I found this blog post that describes the length of longest common subsequence problem and provides a solution in...
5
by: DJRhino | last post by:
Private Sub CboDrawingID_BeforeUpdate(Cancel As Integer) If = 310029923 Or 310030138 Or 310030152 Or 310030346 Or 310030348 Or _ 310030356 Or 310030359 Or 310030362 Or...
0
by: lllomh | last post by:
How does React native implement an English player?
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.