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. Assembly Path

Assembly Path

Scheduled Pinned Locked Moved C#
questioncsharphelp
9 Posts 4 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.
  • C Offline
    C Offline
    Christiaan Laubscher
    wrote on last edited by
    #1

    Hello I have a plug in that I wrote. It is located under : C:\Program Files\Plugs\t01\OutlookAddIn1.dll The following code (1) returns the following result (2) (1) using System.Reflection Assembly assr = Assembly.GetExecutingAssembly(); (2) ...\Assembly\blah blah How do I retrieve the path as specified in [A] using C#? Any help would be greatly appreciated.

    ChristiaanS

    L L N 3 Replies Last reply
    0
    • C Christiaan Laubscher

      Hello I have a plug in that I wrote. It is located under : C:\Program Files\Plugs\t01\OutlookAddIn1.dll The following code (1) returns the following result (2) (1) using System.Reflection Assembly assr = Assembly.GetExecutingAssembly(); (2) ...\Assembly\blah blah How do I retrieve the path as specified in [A] using C#? Any help would be greatly appreciated.

      ChristiaanS

      L Offline
      L Offline
      leppie
      wrote on last edited by
      #2

      typeof(ATypeInOutlookAddinAssembly).Assembly

      xacc.ide - now with TabsToSpaces support
      IronScheme - 1.0 beta 1 - out now!
      ((lambda (x) `((lambda (x) ,x) ',x)) '`((lambda (x) ,x) ',x))

      C 1 Reply Last reply
      0
      • L leppie

        typeof(ATypeInOutlookAddinAssembly).Assembly

        xacc.ide - now with TabsToSpaces support
        IronScheme - 1.0 beta 1 - out now!
        ((lambda (x) `((lambda (x) ,x) ',x)) '`((lambda (x) ,x) ',x))

        C Offline
        C Offline
        Christiaan Laubscher
        wrote on last edited by
        #3

        I have already tried that. It is the same as I mentioned since you are returning an assembly. Maybe I am not implementing it right? Thanks for the help so far.

        ChristiaanS

        1 Reply Last reply
        0
        • C Christiaan Laubscher

          Hello I have a plug in that I wrote. It is located under : C:\Program Files\Plugs\t01\OutlookAddIn1.dll The following code (1) returns the following result (2) (1) using System.Reflection Assembly assr = Assembly.GetExecutingAssembly(); (2) ...\Assembly\blah blah How do I retrieve the path as specified in [A] using C#? Any help would be greatly appreciated.

          ChristiaanS

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

          Assembly.Location?

          Luc Pattyn [Forum Guidelines] [My Articles]


          Fixturized forever. :confused:


          C 1 Reply Last reply
          0
          • L Luc Pattyn

            Assembly.Location?

            Luc Pattyn [Forum Guidelines] [My Articles]


            Fixturized forever. :confused:


            C Offline
            C Offline
            Christiaan Laubscher
            wrote on last edited by
            #5

            Hi Luc I have a path from which I deploy my plug in: 1) c:\Doc and Settings\blah\My Projects\blah\ 2) Then I have the path inProgram Files to where the plug in "resides" 3) Then finally I have the UNC - Location(Located c:\Doc and Settings\ How do I find out where the second location (2) is programmatically?

            ChristiaanS

            L 1 Reply Last reply
            0
            • C Christiaan Laubscher

              Hi Luc I have a path from which I deploy my plug in: 1) c:\Doc and Settings\blah\My Projects\blah\ 2) Then I have the path inProgram Files to where the plug in "resides" 3) Then finally I have the UNC - Location(Located c:\Doc and Settings\ How do I find out where the second location (2) is programmatically?

              ChristiaanS

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

              In order to use something that is external to your app you need some convention. These are the most common ones: 1. a strict convention: you decide once and for all where things will reside, make sure they get there, and your app goes and looks there. Such convention might (and often should) be based on the special folders supported by Environment.GetFolderPath And the convention might include an indirection, as in: a specific registry entry will tell you the exact path to be used. 2. a listed convention: you provide a mechanism for specifying and searching one or more candidate locations. The Windows PATH environment variable is a typical example. If you don't apply any convention all that is left is a full search. Why not install plug-ins in a subfolder of the app's folder, hence for app MyApp, installed in C:\Program Files\MyApp, put the plug-ins in C:\Program Files\MyApp\plugins; so your app should simply scan the relative path "plugins" to find them all. :)

              Luc Pattyn [Forum Guidelines] [My Articles]


              Fixturized forever. :confused:


              1 Reply Last reply
              0
              • C Christiaan Laubscher

                Hello I have a plug in that I wrote. It is located under : C:\Program Files\Plugs\t01\OutlookAddIn1.dll The following code (1) returns the following result (2) (1) using System.Reflection Assembly assr = Assembly.GetExecutingAssembly(); (2) ...\Assembly\blah blah How do I retrieve the path as specified in [A] using C#? Any help would be greatly appreciated.

                ChristiaanS

                N Offline
                N Offline
                nelsonpaixao
                wrote on last edited by
                #7

                try Application.StartupPath you will get ...\debug\bin i usually place the resources i dont want embeded in that directory, and using application.startup i can run them in any computer (resources embeded are read only so when i want to add resources that will be edited a place there) i hope that is what you want :(

                nelsonpaixao@yahoo.com.br trying to help & get help

                C 1 Reply Last reply
                0
                • N nelsonpaixao

                  try Application.StartupPath you will get ...\debug\bin i usually place the resources i dont want embeded in that directory, and using application.startup i can run them in any computer (resources embeded are read only so when i want to add resources that will be edited a place there) i hope that is what you want :(

                  nelsonpaixao@yahoo.com.br trying to help & get help

                  C Offline
                  C Offline
                  Christiaan Laubscher
                  wrote on last edited by
                  #8

                  Hi nelsonpaixao This returns the location of the executing program. Since this is a plug - in that runs on ms outlook; the path of outlook.exe is not what I am searching for. Close, but not quite what I am looking for. :(

                  ChristiaanS

                  L 1 Reply Last reply
                  0
                  • C Christiaan Laubscher

                    Hi nelsonpaixao This returns the location of the executing program. Since this is a plug - in that runs on ms outlook; the path of outlook.exe is not what I am searching for. Close, but not quite what I am looking for. :(

                    ChristiaanS

                    L Offline
                    L Offline
                    leppie
                    wrote on last edited by
                    #9

                    Maybe you need to look at the CodeBase property. IIRC that is the location it loaded from.

                    xacc.ide - now with TabsToSpaces support
                    IronScheme - 1.0 beta 1 - out now!
                    ((lambda (x) `((lambda (x) ,x) ',x)) '`((lambda (x) ,x) ',x))

                    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