Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Class Library DLL with no functions

Class Library DLL with no functions

Scheduled Pinned Locked Moved C#
csharphelpquestion
7 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • U Offline
    U Offline
    uNsignedINT
    wrote on last edited by
    #1

    Hello all! I'm a rookie at C# and i'm wondering why the hell does a new class library project with one function added by me generates a DLL with no functions??? I'm I being very dumb here??? The project only have two classes: AssenblyInfo.cs and Class1.cs Class1.cs defines a class with one function. all compiles well but no functions on the DLL!!!!!! Help!!!!:confused:

    M 1 Reply Last reply
    0
    • U uNsignedINT

      Hello all! I'm a rookie at C# and i'm wondering why the hell does a new class library project with one function added by me generates a DLL with no functions??? I'm I being very dumb here??? The project only have two classes: AssenblyInfo.cs and Class1.cs Class1.cs defines a class with one function. all compiles well but no functions on the DLL!!!!!! Help!!!!:confused:

      M Offline
      M Offline
      malharone
      wrote on last edited by
      #2

      What does the Class1.cs look like and how do you know it has no functions? If you have something like below, "Main" is to be called on Class1 .. eg, Class1.Main(...) . public class Class1 { public static void Main(string[] args) { } } - Malhar

      U 1 Reply Last reply
      0
      • M malharone

        What does the Class1.cs look like and how do you know it has no functions? If you have something like below, "Main" is to be called on Class1 .. eg, Class1.Main(...) . public class Class1 { public static void Main(string[] args) { } } - Malhar

        U Offline
        U Offline
        uNsignedINT
        wrote on last edited by
        #3

        Hello!!! Thanks for answering. When I create a new Class Library C# project it comes with 2 classes: AssemblyInfo.cs and Class1.cs I have only added GetInt() to Class1. I know that the DLL exports nothing by opening it and I can see that it has no exported functions. :( This is what I have: namespace MyProject { public class Class1 { public Class1{} public int GetInt(){return 100;} } }

        M 1 Reply Last reply
        0
        • U uNsignedINT

          Hello!!! Thanks for answering. When I create a new Class Library C# project it comes with 2 classes: AssemblyInfo.cs and Class1.cs I have only added GetInt() to Class1. I know that the DLL exports nothing by opening it and I can see that it has no exported functions. :( This is what I have: namespace MyProject { public class Class1 { public Class1{} public int GetInt(){return 100;} } }

          M Offline
          M Offline
          malharone
          wrote on last edited by
          #4

          uNsignedINT wrote:

          with 2 classes: AssemblyInfo.cs and Class1.cs

          AssemblyInfo is not a class.

          uNsignedINT wrote:

          DLL exports nothing by opening it and I can see that it has no exported functions

          How do you open it? In order for you to access GetInt() method, you must first create an object of type Class1. E.g. Class1 myObject = new Class1(); myObject.GetInt(); //This will return '100'

          U 1 Reply Last reply
          0
          • M malharone

            uNsignedINT wrote:

            with 2 classes: AssemblyInfo.cs and Class1.cs

            AssemblyInfo is not a class.

            uNsignedINT wrote:

            DLL exports nothing by opening it and I can see that it has no exported functions

            How do you open it? In order for you to access GetInt() method, you must first create an object of type Class1. E.g. Class1 myObject = new Class1(); myObject.GetInt(); //This will return '100'

            U Offline
            U Offline
            uNsignedINT
            wrote on last edited by
            #5

            Yes your right :) I meant 2 files :) AssemblyInfo.cs and Class1.cs I open the DLL with the Dependency Walker just by double cliking on the DLL. It shows me all the dependant dll's and the the functions that exports. How would you do a DLL in C# that is supposed to be used by another application? Thanks!

            U D 2 Replies Last reply
            0
            • U uNsignedINT

              Yes your right :) I meant 2 files :) AssemblyInfo.cs and Class1.cs I open the DLL with the Dependency Walker just by double cliking on the DLL. It shows me all the dependant dll's and the the functions that exports. How would you do a DLL in C# that is supposed to be used by another application? Thanks!

              U Offline
              U Offline
              uNsignedINT
              wrote on last edited by
              #6

              Hello All! Somenthing must have go wrong with my project. I've created a new one with more functions and all was good. I really can't tell what was the problem but now everything is ok. thanks a lot for your help and patience! Cumps!

              1 Reply Last reply
              0
              • U uNsignedINT

                Yes your right :) I meant 2 files :) AssemblyInfo.cs and Class1.cs I open the DLL with the Dependency Walker just by double cliking on the DLL. It shows me all the dependant dll's and the the functions that exports. How would you do a DLL in C# that is supposed to be used by another application? Thanks!

                D Offline
                D Offline
                Dave Kreskowiak
                wrote on last edited by
                #7

                uNsignedINT wrote:

                How would you do a DLL in C# that is supposed to be used by another application?

                Expose the classes and methods to COM in your C# project. By default, this doesn't happen, and is why you can't see anything in Dependancy Walker. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups