|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
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. 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. Show quote "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 > njsokal***@hotmail.com > http://www.nathansokalski.com/ > > > 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. Show quote "Siva M" <shiva***@online.excite.com> wrote in message news:184866E6-FF38-4456-A8A6-A4E00CEF5513@microsoft.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 >> njsokal***@hotmail.com >> http://www.nathansokalski.com/ >> >> >> *.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/Migration2/Migration2.aspx http://webproject.scottgu.com/CSharp/UnderstandingCodeBehind/UnderstandingCodeBehind.aspx http://weblogs.asp.net/scottgu/archive/2006/02/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/default.aspx?ForumGroupID=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/ ====================================== Show quote "Nathan Sokalski" <njsokal***@hotmail.com> wrote in message news:%23pgynBFlHHA.4872@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 > njsokal***@hotmail.com > http://www.nathansokalski.com/ > 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. Show quote "Juan T. Llibre" <nomailrepl***@nowhere.com> wrote in message news:ubbhiOIlHHA.4960@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/Migration2/Migration2.aspx > > http://webproject.scottgu.com/CSharp/UnderstandingCodeBehind/UnderstandingCodeBehind.aspx > > http://weblogs.asp.net/scottgu/archive/2006/02/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/default.aspx?ForumGroupID=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" <njsokal***@hotmail.com> wrote in message > news:%23pgynBFlHHA.4872@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 >> njsokal***@hotmail.com >> http://www.nathansokalski.com/ >> > > 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. -- Show quoteHope this helps, Mark Fitzpatrick Former Microsoft FrontPage MVP 199?-2006 "Nathan Sokalski" <njsokal***@hotmail.com> wrote in message news:%23pgynBFlHHA.4872@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 > njsokal***@hotmail.com > http://www.nathansokalski.com/ > 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. Show quote "Mark Fitzpatrick" <markf***@fitzme.com> wrote in message news:OnJ8eHJlHHA.588@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" <njsokal***@hotmail.com> wrote in message > news:%23pgynBFlHHA.4872@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 >> njsokal***@hotmail.com >> http://www.nathansokalski.com/ >> > > |
|||||||||||||||||||||||