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. How to use Internal , Protected Internal across Assemblies..

How to use Internal , Protected Internal across Assemblies..

Scheduled Pinned Locked Moved C#
tutorial
6 Posts 5 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.
  • A Offline
    A Offline
    a_ravindra
    wrote on last edited by
    #1

    Hi can any body the sample code to declare a as protected Internal , as well as Internal to use across different assemblies.. Assembly1 define class as Protected Internal or Internal define member variables as Protected internal / internal eg. namespace Assembly1 { protected Internal class Assembly1Base { protected internal Member1; internal Member2; } } define anothe class derive from assembly1.Assembly1Base namespace Assembly2 { // inherit or create objects of above class } and access the different members

    W realJSOPR S K 4 Replies Last reply
    0
    • A a_ravindra

      Hi can any body the sample code to declare a as protected Internal , as well as Internal to use across different assemblies.. Assembly1 define class as Protected Internal or Internal define member variables as Protected internal / internal eg. namespace Assembly1 { protected Internal class Assembly1Base { protected internal Member1; internal Member2; } } define anothe class derive from assembly1.Assembly1Base namespace Assembly2 { // inherit or create objects of above class } and access the different members

      W Offline
      W Offline
      WoutL
      wrote on last edited by
      #2

      This is what the documentation says: Internal types or members are accessible only within files in the same assembly.

      Wout Louwers

      1 Reply Last reply
      0
      • A a_ravindra

        Hi can any body the sample code to declare a as protected Internal , as well as Internal to use across different assemblies.. Assembly1 define class as Protected Internal or Internal define member variables as Protected internal / internal eg. namespace Assembly1 { protected Internal class Assembly1Base { protected internal Member1; internal Member2; } } define anothe class derive from assembly1.Assembly1Base namespace Assembly2 { // inherit or create objects of above class } and access the different members

        realJSOPR Offline
        realJSOPR Offline
        realJSOP
        wrote on last edited by
        #3

        You can only use internal classes from files in the the assembly in which they're defined.

        .45 ACP - because shooting twice is just silly
        -----
        "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
        -----
        "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001

        1 Reply Last reply
        0
        • A a_ravindra

          Hi can any body the sample code to declare a as protected Internal , as well as Internal to use across different assemblies.. Assembly1 define class as Protected Internal or Internal define member variables as Protected internal / internal eg. namespace Assembly1 { protected Internal class Assembly1Base { protected internal Member1; internal Member2; } } define anothe class derive from assembly1.Assembly1Base namespace Assembly2 { // inherit or create objects of above class } and access the different members

          S Offline
          S Offline
          Sir Dot Net
          wrote on last edited by
          #4

          http://msdn.microsoft.com/en-us/library/0tke9fxk(VS.80).aspx[^] This is the only way other than using reflection.

          A 1 Reply Last reply
          0
          • S Sir Dot Net

            http://msdn.microsoft.com/en-us/library/0tke9fxk(VS.80).aspx[^] This is the only way other than using reflection.

            A Offline
            A Offline
            a_ravindra
            wrote on last edited by
            #5

            Thanks this was useful..

            1 Reply Last reply
            0
            • A a_ravindra

              Hi can any body the sample code to declare a as protected Internal , as well as Internal to use across different assemblies.. Assembly1 define class as Protected Internal or Internal define member variables as Protected internal / internal eg. namespace Assembly1 { protected Internal class Assembly1Base { protected internal Member1; internal Member2; } } define anothe class derive from assembly1.Assembly1Base namespace Assembly2 { // inherit or create objects of above class } and access the different members

              K Offline
              K Offline
              Karthik Kalyanasundaram
              wrote on last edited by
              #6

              Have a look at InternalsVisibleToAttribute http://msdn.microsoft.com/en-us/library/system.runtime.compilerservices.internalsvisibletoattribute.aspx[^] This may help you. Decorate your Assembly1 with InternalsVisibleTo("Assembly2") and try to use the types in Assembly1 in Assembly2.

              Do more work Make more mistakes Learn more things

              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