Go Back   Velocity Reviews > Newsgroups > ASP Net
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply

ASP Net - .NET 2.0 VB Code and C# Code mixed

 
Thread Tools Search this Thread
Old 01-23-2006, 11:57 PM   #1
Default .NET 2.0 VB Code and C# Code mixed


Hi,

I was under the impression it was possible to have two files written in
different langage with the .NET 2.0 Framework?

I have created a new web site, added one APP_CODE folder and under the
APP_CODE folder I created two new item, one C# class and one VB class
to test out if it was working.

However I get the following error when I try to compile (Did I do
something wrong or is it not allowed?)

/: Build (web): The file 'Test/APP_CODE/test.vb' and
'Test/APP_CODE/test2.cs' use a different language, which is not
allowed since they need to be compiled together.


Let me know what I did wrong, THANKS!!
Evian



evian_spring@canada.com
  Reply With Quote
Old 01-24-2006, 12:34 AM   #2
Lloyd Dupont
 
Posts: n/a
Default Re: .NET 2.0 VB Code and C# Code mixed
You could have multiple library in different languages interacting
seamlessly but a single module (a library is generally made of one module)
should be in one language.

The WebServer automatically compile all the files in App_Code as one library
(& module), therefore they should all be in the same language!

--
Regards,
Lloyd Dupont

NovaMind development team
NovaMind Software
Mind Mapping Software
<www.nova-mind.com>
<> wrote in message
news: oups.com...
> Hi,
>
> I was under the impression it was possible to have two files written in
> different langage with the .NET 2.0 Framework?
>
> I have created a new web site, added one APP_CODE folder and under the
> APP_CODE folder I created two new item, one C# class and one VB class
> to test out if it was working.
>
> However I get the following error when I try to compile (Did I do
> something wrong or is it not allowed?)
>
> /: Build (web): The file 'Test/APP_CODE/test.vb' and
> 'Test/APP_CODE/test2.cs' use a different language, which is not
> allowed since they need to be compiled together.
>
>
> Let me know what I did wrong, THANKS!!
> Evian
>





Lloyd Dupont
  Reply With Quote
Old 01-24-2006, 01:04 AM   #3
Adam Knight
 
Posts: n/a
Default Re: .NET 2.0 VB Code and C# Code mixed
Hi,

By default, the App_Code directory can only contain files of the same
language. However, you may partition the App_Code directory into
subdirectories (each containing files of the same language) in order to
contain multiple languages under the App_Code directory. To do this, you
need to register each subdirectory in the Web.config file for the
application.
<configuration>
<system.web>
<compilation>
<codeSubDirectories>
<add directoryName="Subdirectory"/>
</codeSubDirectories>
</compilation>
</system.web>
</configuration>
Straight from the quick start!!!!Cheers,
Adam

<> wrote in message
news: oups.com...
> Hi,
>
> I was under the impression it was possible to have two files written in
> different langage with the .NET 2.0 Framework?
>
> I have created a new web site, added one APP_CODE folder and under the
> APP_CODE folder I created two new item, one C# class and one VB class
> to test out if it was working.
>
> However I get the following error when I try to compile (Did I do
> something wrong or is it not allowed?)
>
> /: Build (web): The file 'Test/APP_CODE/test.vb' and
> 'Test/APP_CODE/test2.cs' use a different language, which is not
> allowed since they need to be compiled together.
>
>
> Let me know what I did wrong, THANKS!!
> Evian
>





Adam Knight
  Reply With Quote
Old 01-24-2006, 12:51 PM   #4
Evian Spring
 
Posts: n/a
Default Re: .NET 2.0 VB Code and C# Code mixed
Thank you soooooo much!!!!! The files within a sub directory must be
of same lang but other sub directory can be of other langage. This is
great......I tried it and it works like a charm.



Evian Spring
  Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Windows Media Player and ASP.NET (with VB code behind) jaanazam Software 2 08-28-2008 08:26 AM
How To Access HTML elements in code behind??? nedums_b Software 1 02-07-2008 07:15 PM




SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46