Solved

Create a dll from my project

Posted on 2010-11-23
11
469 Views
Last Modified: 2012-05-10
Hi Experts,

I have written some functions in a C# project and wish to use them in a VB.Net project. To do this I need to create a dll file from my C# project and reference it in my VB.Net code. How do I create the dll file. I have read that you 'Build' the project and a dll is created but when I click Build from the Debug menu I do not seem to be creating the required dll.

How do I create this dll and where is it to be found?
0
Comment
Question by:DColin
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
  • 2
  • +3
11 Comments
 
LVL 5

Expert Comment

by:buraksarica
ID: 34195360
Does the build process return errors? if not, Check your project's output folder, if it's correct, check the project type.
0
 
LVL 44

Expert Comment

by:AndyAinscow
ID: 34195374
I assume you did do this as the very first step - see image.

If you didn't then do that and copy your existing files across to the new project
0010.jpg
0
 
LVL 2

Expert Comment

by:Jogai
ID: 34195396
Go to your project in Visual Studio and choose for "Class Library" under "Output type:" on the application tab.
0
Webinar: Aligning, Automating, Winning

Join Dan Russo, Senior Manager of Operations Intelligence, for an in-depth discussion on how Dealertrack, leading provider of integrated digital solutions for the automotive industry, transformed their DevOps processes to increase collaboration and move with greater velocity.

 
LVL 2

Expert Comment

by:Jogai
ID: 34195402
Go to your project properties in Visual Studio and choose for "Class Library" under "Output type:" on the application tab.
0
 

Author Comment

by:DColin
ID: 34195428
My C# project was created as a Win form. How do I turn it into a Class Library.
0
 
LVL 44

Expert Comment

by:AndyAinscow
ID: 34195451
I'd suggest renaming, creating a new project with the name of the original one then copying the code and resource files across.

You could just try changing the output type BUT there may be other settings you will have to modify as well.

(At a minimum create a new dummy project and check EACH possible setting in your current app and set them to those of the 'class library' type of project)
0
 
LVL 1

Accepted Solution

by:
pankajgharge earned 500 total points
ID: 34195503
Change Output type as a class library in project properties
0
 

Author Comment

by:DColin
ID: 34195550
Once the dll is created and referenced do I have to add anything to my VB.Net code or can I use the dll's functions without any references in the code?
0
 
LVL 44

Expert Comment

by:AndyAinscow
ID: 34195581
As long as the dll is referenced and available you should be able to use it (don't forget the namespace to identify which library the function is in - as you would in C# to qualify the name)
0
 

Author Comment

by:DColin
ID: 34195697
The name of the dll is Moserware.Skills.dll I have coppied it into the Debug folder of my VB.Net project. I add it as a reference via the Browse tab of the add reference dialogue box. But I am unable to use any of the functions in my code I am told the namespace is not declared. When I check the references tab of my VB.Net project's project page I see that Moserware.Skills is listed as a reference name but under path it says <The system cannot find the reference specified>
0
 
LVL 83

Expert Comment

by:CodeCruiser
ID: 34204227
Reference it from the original location. You could have also added a class library project to your existing solution and then used project reference instead of browsing to DLL.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Converting PHP triple des decrypt to c# 9 76
Need help with a query 3 39
Visual Studio 2015 auto inserted code 12 71
Copying from a network share 3 26
Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question