Link to home
Start Free TrialLog in
Avatar of davoman
davomanFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Need to add a class for an add in i'm writing

Hi there

I'm writing an add in and wanted to know if there was a way in the code i can add a class file in and put it in the project folder

i choose

regards
Avatar of Mystify
Mystify

if you right click on your project in the solution explorer and say add existing, browse to your class file and add it. It should copy that file into your projects folder and thus be added.

Avatar of davoman

ASKER

no sorry i mean doing it in code

Ie when the add in runs as part of it i want a class file to be brought in , in a specific  folder

regards
i dont believe you can do this because you need to have the reference of this file at runtime due to the JIT compiler.
Avatar of davoman

ASKER

buts an add in that is adding a file into another project which is being worked on at the time, I can add all the class code through a builder i just need to be able to add the file
Do you want to add the sourcecode to your project or the compiled assembly to be used by your software ?
Avatar of davoman

ASKER

Basically I have created an add in that constructs a whole load of code depending on the developers requirements.

for example

Imports SYSTEM.Data.SQLclient
Public Class  Test

    PRivate _number as integer

Public Propertye number() as integer
      Return _number
........

end Property

This code is built up in a string builder from a form where the developer has put in what they want to be as part of a class.

Then the developer says ok and at the moment all the code is written to a class file  that the developer has already created. What I am looking for is the code iwhich I can use to add the class file in and then write the output i have in the string builder. In other words so the developer does not have to add the class file

regards

END Class
So that i understand you right, you need an example for write your stingbuilder content into an existing file. Should all content of the old class file be
overwritten ? In which environment runs your addin VS2003 or VS2005 ?
Avatar of davoman

ASKER

its 2005

no sorr,y all i need is to be able to create the .vb file (I can do it fine with an eisting file)

"Then the developer says ok and at the moment all the code is written to a class file  that the developer has already created. "

I simply need to know how to create the physical .vb file in code so i then can write to it

regards
ASKER CERTIFIED SOLUTION
Avatar of melmers
melmers
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial