Tema: namespace'u problema *.designer.cs & user controls [html]
Autorius: Jornada Del Muerto
Data: 2010-12-29 04:51:30
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=utf-8" http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 8.00.6001.18999">
<STYLE></STYLE>
</HEAD>
<BODY>
<DIV><FONT size=2 face=Arial>Sveiki,</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial> Yra didelis .net projektas ir
kuri laika su tokia beda susiduriu, tiesiog rankom pataisau pries kompiliavima
ir taip tai apeinu, bet dalykas toks labai nervinantis.</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial>Zodziu projekto base namespace yra:</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial><STRONG><EM>Projektas</EM></STRONG></FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial>Jame toliau pas mane dalinasi i katalogus ir sub
namespace'us daugmaz taip:</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2
face=Arial><STRONG><EM>Projektas.Controls;</EM></STRONG></FONT></DIV>
<DIV><FONT size=2
face=Arial><STRONG><EM>Projektas.Forms;</EM></STRONG></FONT></DIV>
<DIV><FONT size=2
face=Arial><STRONG><EM>Projektas.DataTypes;</EM></STRONG></FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial>Ir t.t...</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial>Ir pvz <STRONG>Projektas.Controls</STRONG>
namespace kuriu savo UserControl pvz. pavadinimu UclCustomersList
ir Projektas.Controls.UclCustomersList naudoja
Projektas.Controls.GridCustomersList controla, automatu kada as ji idedu i user
controla jis faile: <STRONG><EM>UclCustomersList.Designer.cs faile
</EM></STRONG>automatiskai susigeneruoja daugmaz <STRONG>toki koda
</STRONG>:</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial>namespace Projektas.Controls<BR>{<BR> partial
class UclCustomersList</FONT></DIV>
<DIV><FONT size=2 face=Arial> {</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial> ... blbalbla..</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial> private void InitializeComponent
()<BR> {<BR> this.MainList = new Projektas.<FONT
color=#ff0000>Controls</FONT>.GridCustomersList ();</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial> Taip pat kas idomu jis isiraso
vat taip pati memberi:</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial> private
<STRONG><U>global::</U></STRONG>Projektas.Controls.GridCustomersList
MainList;<BR><BR></FONT></DIV>
<DIV><FONT size=2 face=Arial>Ir kur raudonai man metasi tada erroras
kompiliojant: Error 7 The type or namespace name
<STRONG>'Controls'</STRONG> does not exist in the namespace
<STRONG>'Projektas.Projektas'</STRONG> (are you missing an assembly
reference?) <EM><FONT
color=#808080>C:\Projects\...\Projektas\Controls\UclCustomersList.Designer.cs</FONT></EM> 33 34 Projektas</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial>Jeigu rankomis pataisau:</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial>this.MainList = new Projektas.<FONT
color=#ff0000>Controls</FONT>.GridCustomersList ();</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial>Į:</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial>
<DIV><FONT size=2 face=Arial>this.MainList = new Controls.GridCustomersList
();</FONT></DIV>
<DIV> </DIV>
<DIV> Tada pradeda kompiliuotis... siaip jei ne user controlai
tai viskas veikia ir dar taspats jei Projektas.Forms.FrmKazkokia itraukia user
controla is Projektas.Controls irgi lygiai taspats darosi.... </DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV> Projektas cia senas gal kur kazka esu nureguliaves,
sakau gal kas susidure ? beda ner tragiska bet labai jau ikyri paskutiniu metu
kai daugiau controlu det pradejau.</DIV></DIV></FONT></BODY></HTML>