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
>



  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
>



  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.

  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
Forum Jump