.NET 2.0 VB Code and C# Code mixed

Discussion in 'ASP .Net' started by evian_spring@canada.com, Jan 23, 2006.

  1. Guest

    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
    , Jan 23, 2006
    #1
    1. Advertising

  2. Lloyd Dupont Guest

    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:...
    > 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, Jan 24, 2006
    #2
    1. Advertising

  3. Adam Knight Guest

    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:...
    > 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, Jan 24, 2006
    #3
  4. Evian Spring Guest

    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, Jan 24, 2006
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. joe

    ASP.Net and FrontPage mixed

    joe, Jun 26, 2003, in forum: ASP .Net
    Replies:
    2
    Views:
    1,000
  2. =?Utf-8?B?TWFzcHI=?=

    Mixed ASP and ASP.NET Site Session Timeout

    =?Utf-8?B?TWFzcHI=?=, Aug 8, 2006, in forum: ASP .Net
    Replies:
    6
    Views:
    3,003
    Sleeping Bear
    Aug 31, 2006
  3. Ken
    Replies:
    2
    Views:
    324
  4. Zach
    Replies:
    7
    Views:
    2,118
    Keith Thompson
    Nov 15, 2010
  5. Keith Thompson

    Mixed declarations and "code"

    Keith Thompson, May 5, 2011, in forum: C Programming
    Replies:
    3
    Views:
    268
Loading...

Share This Page