Groups | Blog | Home
all groups > asp.net > january 2005 >

asp.net : Thanks for the reply Juan but...



junk NO[at]SPAM spirit.co.za
1/19/2005 11:51:48 PM
Hi Juan,

Thanks for the reply!

Unfortunately your answer didn't help me. If I don't 'Import' the
custom class then I can't call any of it's functions. This problem
goes away if I compile the .vb file first, and import the namespace
and class with an import directive! It's almost as if the framework
can't see the /code directory the way it should.

What drives me crazy is that Studio's intellisense recognises the
namespace in the source file and allows me to import it. It's only
when I run the application that the error pops up.

So a compiled version of the .vb file works fine with the resulting
..dll dropped in the /bin directory. But the uncompiled .vb file in the
/code directory doesn't!

Karl Seguin
1/20/2005 8:48:56 AM
Sorcrer:
I skipped over your original post to let someone else answer in the hopes
they might be able to help better. I take it you are dealing with VB.Net
2005 and static imports? If so, I agree with you that the behaviour seems
odd/wrong/inconsistent

You can provide feedback on .Net 2005 stuff at:
http://lab.msdn.microsoft.com/productfeedback/ they are very good about
responding.

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/


[quoted text, click to view]

Juan T. Llibre
1/20/2005 10:51:23 AM
re:
[quoted text, click to view]

That's not the way it's supposed to work!

re:
[quoted text, click to view]

Do you mean a YourApp/bin directory,
or the main /bin directory wwwroot/bin ?

If the /bin directory you are referring to is the
/wwwroot/bin directory, check your Applications
in the IIS Manager.

The directory you're working out of,
may not be designated as an Application
or a Virtual Directory for IIS.

The /code directory works individually for each
Application/Virtual Directory, and you can have
one /code directory for each application.

Test the attached script and corresponding page.

Place testcode.aspx in the root directory of any Application,
and place teststring.vb in the /code directory of the same Application.

You'll see that testcode.aspx calls the SampleClass1 class and
its teststring property without having compiled the .vb source.




Juan T. Llibre
ASP.NET MVP
===========
[quoted text, click to view]


begin 666 testcode.aspx
M/"5 (%!A9V4@3&%N9W5A9V4](E9"(B E/@T*#0H\(41/0U194$4@:'1M;"!0
M54),24,@(BTO+U<S0R\O1%1$(%A(5$U,(#$N,2\O14XB(")H='1P.B\O=W=W
M+G<S+F]R9R]44B]X:'1M;#$Q+T141"]X:'1M;#$Q+F1T9"(^#0H-"CQS8W)I
M<'0@<G5N870](G-E<G9E<B(^#0H-"B @("!3=6(@0G5T=&]N,5]#;&EC:RA"
M>59A;"!S96YD97(@07,@3V)J96-T+"!">59A;"!E($%S(%-Y<W1E;2Y%=F5N
M=$%R9W,I#0H@(" @(" @($1I;2!S8R!!<R!.97<@4V%M<&QE0VQA<W,Q#0H@
M(" @(" @('-C+G1E<W13=')I;F<@/2!497AT0F]X,2Y497AT#0H@(" @(" @
M($QA8F5L,2Y497AT(#T@<V,N=&5S=%-T<FEN9PT*(" @($5N9"!3=6(-"CPO
M<V-R:7!T/@T*#0H\:'1M;"!X;6QN<STB:'1T<#HO+W=W=RYW,RYO<F<O,3DY
M.2]X:'1M;"(@/@T*/&AE860@<G5N870](G-E<G9E<B(^#0H@(" @/'1I=&QE
M/E5N=&ET;&5D(%!A9V4\+W1I=&QE/@T*/"]H96%D/@T*/&)O9'D^#0H@(" @
M/&9O<FT@:60](F9O<FTQ(B!R=6YA=#TB<V5R=F5R(CX-"B @(" \9&EV/@T*
M(" @(" @(" \87-P.E1E>'1";W@@240](E1E>'1";W@Q(B!2=6YA=#TB<V5R
M=F5R(B!7:61T:#TB,3 P(CX\+V%S<#I497AT0F]X/CQB<B O/@T*(" @(" @
M(" \87-P.DQA8F5L($E$/2),86)E;#$B(%)U;F%T/2)S97)V97(B(%1E>'0]
M(DQA8F5L(CX\+V%S<#I,86)E;#X\8G(@+SX-"B @(" @(" @/&%S<#I"=71T
M;VX@240](D)U='1O;C$B(%)U;F%T/2)S97)V97(B(%1E>'0](D)U='1O;B(@
M3VY#;&EC:STB0G5T=&]N,5]#;&EC:R(@+SX-"B @(" @(" @#0H@(" @/"]D
D:78^#0H@(" @/"]F;W)M/@T*/"]B;V1Y/@T*/"]H=&UL/@T*
`
end

begin 666 teststring.vb
M4'5B;&EC($-L87-S(%-A;7!L94-L87-S,0T*(" @('!R:79A=&4@;5]T97-T
M4W1R:6YG#0H@(" @4'5B;&EC(%!R;W!E<G1Y('1E<W13=')I;F<@87,@4W1R
M:6YG#0H@(" @(" @($=E= T*(" @(" @(" @(" @<F5T=7)N(&U?=&5S=%-T
M<FEN9PT*(" @(" @("!%;F0@1V5T#0H@(" @(" @(%-E=" H5F%L=64@87,@
M4W1R:6YG*0T*(" @(" @(" @(" @;5]T97-T4W1R:6YG(#T@=F%L=64-"B @
L(" @(" @16YD(%-E= T*(" @($5N9"!0<F]P97)T>0T*16YD($-L87-S#0H`
`
end
AddThis Social Bookmark Button