Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > .NET 2.0 VB Code and C# Code mixed

Reply
Thread Tools

.NET 2.0 VB Code and C# Code mixed

 
 
evian_spring@canada.com
Guest
Posts: n/a
 
      01-23-2006
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
 
 
 
 
Lloyd Dupont
Guest
Posts: n/a
 
      01-24-2006
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>
<(E-Mail Removed)> wrote in message
news:(E-Mail Removed) 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
 
 
 
 
Adam Knight
Guest
Posts: n/a
 
      01-24-2006
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

<(E-Mail Removed)> wrote in message
news:(E-Mail Removed) 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
 
Evian Spring
Guest
Posts: n/a
 
      01-24-2006
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

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

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Mixed declarations and "code" Keith Thompson C Programming 3 05-08-2011 08:11 AM
mixed declarations and code (and size_t)? Zach C Programming 7 11-15-2010 04:39 PM
Possible BUG in Mixed Code Security Warning? FutureScalper Java 9 07-05-2010 11:04 PM
un-catched Exceptions in mixed C/C++ code wrungel C++ 8 12-18-2007 07:04 PM
Need to call mixed-mode dll from native code. Mike Kamzyuk C++ 1 04-26-2005 01:35 PM



Advertisments