.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

PaletteUtils.cs in VB.net project

6 REPLIES 6
Reply
Message 1 of 7
Anonymous
402 Views, 6 Replies

PaletteUtils.cs in VB.net project

Hi Everyone,

I am going to guess that this is something really simple, however I am
not getting it yet and my searches have thus far been unsuccessful at
finding the solution. I am creating a palette in AutoCAD 2009 using VS
2005. My project is a vb.net project, however I have added
paletteutils.cs to it. What I am failing to do, however, is have access
to the functions within the c# file. I have tried importing the
namespace in the class without success. I have also tried creating an
object for the class PaletteUtils, but it does not appear in the object
browser.

I have not posted any code, so my question is: Is it possible to have
the c# code file in my project, and if so, what do I have to do to call
the methods contained in the utility?

Thank you for any insight you may provide.
6 REPLIES 6
Message 2 of 7
norman.yuan
in reply to: Anonymous

I am not sure what is PaletteUtil.cs and what it does. But it is apprarently a C# source code, as you said.

With Visual Studio 2005/8, you cannot mix VB.NET source code and C# source code in the same project. You need to place the PaletteUtil.cs in a C# project and compile it into a DLL, and then set reference to this dll in your VB.NET project. That is, you can have a sulotion that contained multiple projects, each project can be in C# or VB.NET, but not mix them in the same project.

Norman Yuan

Drive CAD With Code

EESignature

Message 3 of 7
chiefbraincloud
in reply to: Anonymous

Or, you could just run it through a translator...
Dave O.                                                                  Sig-Logos32.png
Message 4 of 7
chiefbraincloud
in reply to: Anonymous

Or, you could just run it through a translator...
Dave O.                                                                  Sig-Logos32.png
Message 5 of 7
Anonymous
in reply to: Anonymous

chiefbraincloud wrote:
> Or, you could just run it through a translator...

I used the translator at codeproject, however it was not without issue
in the conversion. I have taken Norman's advice and compiled the c#
code in it's own dll and have referenced that in my vb.net project. I
believe that should resolve my situation. I was just unsure if someone
else had experienced this as well.
Message 6 of 7
Anonymous
in reply to: Anonymous

You can't mix languages in a project, but you can add multiple projects to a
visual studio solution and each project can be a different language.
--
Bobby C. Jones
http://bobbycjones.spaces.live.com

"Tim J" wrote in message
news:6181700@discussion.autodesk.com...
Hi Everyone,

I am going to guess that this is something really simple, however I am
not getting it yet and my searches have thus far been unsuccessful at
finding the solution. I am creating a palette in AutoCAD 2009 using VS
2005. My project is a vb.net project, however I have added
paletteutils.cs to it. What I am failing to do, however, is have access
to the functions within the c# file. I have tried importing the
namespace in the class without success. I have also tried creating an
object for the class PaletteUtils, but it does not appear in the object
browser.

I have not posted any code, so my question is: Is it possible to have
the c# code file in my project, and if so, what do I have to do to call
the methods contained in the utility?

Thank you for any insight you may provide.
Message 7 of 7
Anonymous
in reply to: Anonymous

Bobby C. Jones wrote:
> You can't mix languages in a project, but you can add multiple projects to a
> visual studio solution and each project can be a different language.

Thank you to everyone for your help. This has been the first situation
where I have needed to incorporate a module written in c# with any
project that I have developed.

Thanks again.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost