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>&nbsp;</DIV>
<DIV><FONT size=2 face=Arial>&nbsp;&nbsp;&nbsp; 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>&nbsp;</DIV>
<DIV><FONT size=2 face=Arial>Zodziu projekto base namespace yra:</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT>&nbsp;</DIV>
<DIV><FONT size=2 face=Arial><STRONG><EM>Projektas</EM></STRONG></FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT>&nbsp;</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>&nbsp;</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>&nbsp;</DIV>
<DIV><FONT size=2 face=Arial>Ir t.t...</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT>&nbsp;</DIV>
<DIV><FONT size=2 face=Arial>Ir pvz <STRONG>Projektas.Controls</STRONG> 
namespace kuriu savo UserControl&nbsp; pvz. pavadinimu UclCustomersList 
ir&nbsp;Projektas.Controls.UclCustomersList naudoja 
Projektas.Controls.GridCustomersList controla, automatu kada as ji idedu i user 
controla jis faile:&nbsp;<STRONG><EM>UclCustomersList.Designer.cs faile 
</EM></STRONG>automatiskai susigeneruoja&nbsp;daugmaz <STRONG>toki koda 
</STRONG>:</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT>&nbsp;</DIV>
<DIV><FONT size=2 face=Arial>namespace Projektas.Controls<BR>{<BR>&nbsp;partial 
class UclCustomersList</FONT></DIV>
<DIV><FONT size=2 face=Arial>&nbsp;{</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT>&nbsp;</DIV>
<DIV><FONT size=2 face=Arial>&nbsp;&nbsp;&nbsp; ... blbalbla..</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT>&nbsp;</DIV>
<DIV><FONT size=2 face=Arial>&nbsp;&nbsp;private void InitializeComponent 
()<BR>&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;this.MainList = new Projektas.<FONT 
color=#ff0000>Controls</FONT>.GridCustomersList ();</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT>&nbsp;</DIV>
<DIV><FONT size=2 face=Arial>&nbsp;&nbsp;&nbsp; Taip pat kas idomu jis isiraso 
vat taip pati memberi:</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT>&nbsp;</DIV>
<DIV><FONT size=2 face=Arial>&nbsp;&nbsp;&nbsp; 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&nbsp;7&nbsp;The type or namespace name 
<STRONG>'Controls'</STRONG> does not exist in the namespace 
<STRONG>'Projektas.Projektas'</STRONG> (are you missing an assembly 
reference?)&nbsp;<EM><FONT 
color=#808080>C:\Projects\...\Projektas\Controls\UclCustomersList.Designer.cs</FONT></EM>&nbsp;33&nbsp;34&nbsp;Projektas</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT>&nbsp;</DIV>
<DIV><FONT size=2 face=Arial>Jeigu rankomis pataisau:</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT>&nbsp;</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>&nbsp;</DIV>
<DIV><FONT size=2 face=Arial>Į:</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT>&nbsp;</DIV>
<DIV><FONT size=2 face=Arial>
<DIV><FONT size=2 face=Arial>this.MainList = new Controls.GridCustomersList 
();</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;&nbsp; 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>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;&nbsp; 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>