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. .NET (Core and Framework)
  4. calling of dll from another dll when both are in same folder

calling of dll from another dll when both are in same folder

Scheduled Pinned Locked Moved .NET (Core and Framework)
helpquestion
3 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.
  • V Offline
    V Offline
    vikas shukla
    wrote on last edited by
    #1

    my first dll is using System; namespace myfirst { public class demo { public string getmessage() { return "Hi!How Are You"; } } } in folder e:\prac and more dll is using System; using myfirst; namespace mysecond { public class demo1 { public string getmessage1() { demo d=new demo(); string str1=d.getmessage(); Console.WriteLine(str1); } } } and now i am using csc /t:library mysecond.cs then i have following error and problem was same.please help me mysecond.cs(2,7): error CS0246: The type or namespace name 'myfirst' could not be found (are you missing a using directive or an assembly reference?)

    L L 2 Replies Last reply
    0
    • V vikas shukla

      my first dll is using System; namespace myfirst { public class demo { public string getmessage() { return "Hi!How Are You"; } } } in folder e:\prac and more dll is using System; using myfirst; namespace mysecond { public class demo1 { public string getmessage1() { demo d=new demo(); string str1=d.getmessage(); Console.WriteLine(str1); } } } and now i am using csc /t:library mysecond.cs then i have following error and problem was same.please help me mysecond.cs(2,7): error CS0246: The type or namespace name 'myfirst' could not be found (are you missing a using directive or an assembly reference?)

      L Offline
      L Offline
      Luc Pattyn
      wrote on last edited by
      #2

      vikas shukla wrote:

      are you missing a using directive or an assembly reference?

      that tells you what is missing. csc.exe has a lot of switches, try "csc /?" to get its help, and discover what "/r" does for you. FYI: csc is part of .NET, hence look in a folder such as C:\Windows\Microsoft.NET\Framework\v2.0.50727 :)

      Luc Pattyn [Forum Guidelines] [My Articles]


      I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages


      1 Reply Last reply
      0
      • V vikas shukla

        my first dll is using System; namespace myfirst { public class demo { public string getmessage() { return "Hi!How Are You"; } } } in folder e:\prac and more dll is using System; using myfirst; namespace mysecond { public class demo1 { public string getmessage1() { demo d=new demo(); string str1=d.getmessage(); Console.WriteLine(str1); } } } and now i am using csc /t:library mysecond.cs then i have following error and problem was same.please help me mysecond.cs(2,7): error CS0246: The type or namespace name 'myfirst' could not be found (are you missing a using directive or an assembly reference?)

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #3

        Just because you have the assemblies in the same folder, C# compiler does not automatically resolve referenced assemblies for you. You have to specify the referenced assemblies using the '/r' switch.

        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