Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Can I use C# code in a VB project?

Reply
Thread Tools

Can I use C# code in a VB project?

 
 
Diego F.
Guest
Posts: n/a
 
      05-19-2005
Is it possible to use directly C# code into a VB project?

If not, is there any tool to convert from C# to VB.NET?

--
Regards,

Diego F.


 
Reply With Quote
 
 
 
 
Mark Rae
Guest
Posts: n/a
 
      05-19-2005
"Diego F." <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...

> Is it possible to use directly C# code into a VB project?


Not currently...

> If not, is there any tool to convert from C# to VB.NET?


Several - Google it.


 
Reply With Quote
 
 
 
 
Juan T. Llibre
Guest
Posts: n/a
 
      05-19-2005
re:
> Is it possible to use directly C# code into a VB project?


No. Only one language per project is permitted.

You can, however, VB project(s) and C# project(s) in a single solution.

You can also do a command-line compilation of one of your projects
and add a reference to that assembly ( those assemblies ) in your other project.

re:
> If not, is there any tool to convert from C# to VB.NET?


This free online resource works pretty good :
http://www.developerfusion.com/utili...btocsharp.aspx
Notice that you can go both ways.

If you prefer a desktop program,
the free SharpDevelop editor has a nifty conversion feature :

http://www.icsharpcode.net/OpenSource/SD/

It will *only* translate *.vb and *.cs files, though.



Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Español
Ven, y hablemos de ASP.NET...
======================

"Diego F." <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Is it possible to use directly C# code into a VB project?
>
> If not, is there any tool to convert from C# to VB.NET?
>
> --
> Regards,
>
> Diego F.
>



 
Reply With Quote
 
Kevin Spencer
Guest
Posts: n/a
 
      05-19-2005
Hi Diego,

> Is it possible to use directly C# code into a VB project?


With Visual Studio.Net 2005 only, you can do this, not with previous
versions.

> If not, is there any tool to convert from C# to VB.NET?


Not any good ones.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Sometimes you eat the elephant.
Sometimes the elephant eats you.

"Diego F." <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Is it possible to use directly C# code into a VB project?
>
> If not, is there any tool to convert from C# to VB.NET?
>
> --
> Regards,
>
> Diego F.
>



 
Reply With Quote
 
=?Utf-8?B?RGF2aWQgQW50b24=?=
Guest
Posts: n/a
 
      05-19-2005
We sell Instant VB, a C# to VB.NET converter. Download the Demo Edition at
www.instantvb.com.

It's the only high-quality C# to VB.NET converter that:
1. Converts entire projects.
2. Converts ASP.NET pages.
3. Has a fully-supported demo.

David Anton
www.tangiblesoftwaresolutions.com
Home of the Instant C# VB.NET to C# converter
and the Instant VB C# to VB.NET converter

"Diego F." wrote:

> Is it possible to use directly C# code into a VB project?
>
> If not, is there any tool to convert from C# to VB.NET?
>
> --
> Regards,
>
> Diego F.
>
>
>

 
Reply With Quote
 
=?Utf-8?B?RGF2aWQgQW50b24=?=
Guest
Posts: n/a
 
      05-19-2005
"Not any good ones."
Before making such a blanket statement, try ours - Instant VB at
www.instantvb.com.

David Anton
www.tangiblesoftwaresolutions.com
Home of the Instant C# VB.NET to C# converter
and the Instant VB C# to VB.NET converter

"Kevin Spencer" wrote:

> Hi Diego,
>
> > Is it possible to use directly C# code into a VB project?

>
> With Visual Studio.Net 2005 only, you can do this, not with previous
> versions.
>
> > If not, is there any tool to convert from C# to VB.NET?

>
> Not any good ones.
>
> --
> HTH,
>
> Kevin Spencer
> Microsoft MVP
> ..Net Developer
> Sometimes you eat the elephant.
> Sometimes the elephant eats you.
>
> "Diego F." <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > Is it possible to use directly C# code into a VB project?
> >
> > If not, is there any tool to convert from C# to VB.NET?
> >
> > --
> > Regards,
> >
> > Diego F.
> >

>
>
>

 
Reply With Quote
 
Diego F.
Guest
Posts: n/a
 
      05-19-2005
I'm using VS 2005 beta1. I add files, but it doesn't recognize the namespace
in VB classes.

In fact it is a complete project and I could generate the dll, but then I
have problems running in a network project. It runs locally, but when moving
to the server it throws security exceptions.

--

Regards,

Diego F.

"Kevin Spencer" <(E-Mail Removed)> escribió en el mensaje
news:(E-Mail Removed)...
> Hi Diego,
>
>> Is it possible to use directly C# code into a VB project?

>
> With Visual Studio.Net 2005 only, you can do this, not with previous
> versions.
>
>> If not, is there any tool to convert from C# to VB.NET?

>
> Not any good ones.
>
> --
> HTH,
>
> Kevin Spencer
> Microsoft MVP
> .Net Developer
> Sometimes you eat the elephant.
> Sometimes the elephant eats you.
>
> "Diego F." <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> Is it possible to use directly C# code into a VB project?
>>
>> If not, is there any tool to convert from C# to VB.NET?
>>
>> --
>> Regards,
>>
>> Diego F.
>>

>
>



 
Reply With Quote
 
Kevin Spencer
Guest
Posts: n/a
 
      05-19-2005
You're right, David. I'm guilty of making an assumption. I should have said
"not any good ones that I know of." And now I'm not so sure. Your app may
indeed be capable of doing a very good direct translation. I wouldn't use
such a thing, as there are optimizations that can be performed when porting,
but these are not absolutely necessary, and it may well prove quite useful
to many developers.

Thanks for keeping me straight!

--

Kevin Spencer
Microsoft MVP
..Net Developer
Sometimes you eat the elephant.
Sometimes the elephant eats you.

"David Anton" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> "Not any good ones."
> Before making such a blanket statement, try ours - Instant VB at
> www.instantvb.com.
>
> David Anton
> www.tangiblesoftwaresolutions.com
> Home of the Instant C# VB.NET to C# converter
> and the Instant VB C# to VB.NET converter
>
> "Kevin Spencer" wrote:
>
>> Hi Diego,
>>
>> > Is it possible to use directly C# code into a VB project?

>>
>> With Visual Studio.Net 2005 only, you can do this, not with previous
>> versions.
>>
>> > If not, is there any tool to convert from C# to VB.NET?

>>
>> Not any good ones.
>>
>> --
>> HTH,
>>
>> Kevin Spencer
>> Microsoft MVP
>> ..Net Developer
>> Sometimes you eat the elephant.
>> Sometimes the elephant eats you.
>>
>> "Diego F." <(E-Mail Removed)> wrote in message
>> news:(E-Mail Removed)...
>> > Is it possible to use directly C# code into a VB project?
>> >
>> > If not, is there any tool to convert from C# to VB.NET?
>> >
>> > --
>> > Regards,
>> >
>> > Diego F.
>> >

>>
>>
>>



 
Reply With Quote
 
Kevin Spencer
Guest
Posts: n/a
 
      05-19-2005
Hi Diego,

I did cover the security exception you described in my reply to your other
thread about the exception. that is a simple Assembly Trust issue.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Sometimes you eat the elephant.
Sometimes the elephant eats you.

"Diego F." <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> I'm using VS 2005 beta1. I add files, but it doesn't recognize the
> namespace in VB classes.
>
> In fact it is a complete project and I could generate the dll, but then I
> have problems running in a network project. It runs locally, but when
> moving to the server it throws security exceptions.
>
> --
>
> Regards,
>
> Diego F.
>
> "Kevin Spencer" <(E-Mail Removed)> escribió en el mensaje
> news:(E-Mail Removed)...
>> Hi Diego,
>>
>>> Is it possible to use directly C# code into a VB project?

>>
>> With Visual Studio.Net 2005 only, you can do this, not with previous
>> versions.
>>
>>> If not, is there any tool to convert from C# to VB.NET?

>>
>> Not any good ones.
>>
>> --
>> HTH,
>>
>> Kevin Spencer
>> Microsoft MVP
>> .Net Developer
>> Sometimes you eat the elephant.
>> Sometimes the elephant eats you.
>>
>> "Diego F." <(E-Mail Removed)> wrote in message
>> news:(E-Mail Removed)...
>>> Is it possible to use directly C# code into a VB project?
>>>
>>> If not, is there any tool to convert from C# to VB.NET?
>>>
>>> --
>>> Regards,
>>>
>>> Diego F.
>>>

>>
>>

>
>



 
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
ASP.NET 2.0: To use or not to use code behind? pedestrian via DotNetMonster.com ASP .Net 5 09-28-2006 06:19 AM
Use aspx.vb Code to Javascript Code laxmilal Menaria via DotNetMonster.com ASP .Net 4 05-13-2005 05:42 AM
Help with use of code.InteractiveInterpreter for multiline code rick_muller@yahoo.com Python 2 12-03-2004 05:06 PM
use client side code to trigger the load of page must use GET Protocol? Matt ASP General 1 01-18-2004 04:09 AM
For what use LABELS (left of the code) in Visual Basic Code? Andreas Klemt ASP .Net 3 01-14-2004 02:26 PM



Advertisments