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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C#
  4. Namespace problem (no strong name)

Namespace problem (no strong name)

Scheduled Pinned Locked Moved C#
csharpdatabasedata-structureshelptutorial
5 Posts 2 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.
  • N Offline
    N Offline
    Nigel Mackay
    wrote on last edited by
    #1

    My app has a number of projects in it. They all use the same namespace (ClientServerTimesheet). I need to print some grids, so I have added Printing.DataGridViewPrintProvider to the solution, without changing its namespace. In the client part I have added a reference to it and I can print. But I have a problem with the height of the first row and so I want to look at the array of row heights. I have a project Globals, with a class Lookup. Lookup contains a public static array of float rowHeights. In DataGridViewPrintProvider I have added a reference to Globals. In DataGridViewPrintProvider I use the line global::ClientServerTimesheet.Lookup.rowHeights[row.Index] = GridView.Rows[row.Index].RowHeight(g); but it won't build, saying that Globals does not have a strong name. I supect that what I actually need is to qualify the above line better, or do I really need to create a strong name for Globals? Not sure how to do that with C# 2008 Express

    P 1 Reply Last reply
    0
    • N Nigel Mackay

      My app has a number of projects in it. They all use the same namespace (ClientServerTimesheet). I need to print some grids, so I have added Printing.DataGridViewPrintProvider to the solution, without changing its namespace. In the client part I have added a reference to it and I can print. But I have a problem with the height of the first row and so I want to look at the array of row heights. I have a project Globals, with a class Lookup. Lookup contains a public static array of float rowHeights. In DataGridViewPrintProvider I have added a reference to Globals. In DataGridViewPrintProvider I use the line global::ClientServerTimesheet.Lookup.rowHeights[row.Index] = GridView.Rows[row.Index].RowHeight(g); but it won't build, saying that Globals does not have a strong name. I supect that what I actually need is to qualify the above line better, or do I really need to create a strong name for Globals? Not sure how to do that with C# 2008 Express

      P Offline
      P Offline
      PIEBALDconsult
      wrote on last edited by
      #2

      What Exception are you getting? Nothing you've said would seem to indicate a problem. I've never found a need for global:: and I don't think it's required here. Are you somehow confusing it with your Globals project?

      N 1 Reply Last reply
      0
      • P PIEBALDconsult

        What Exception are you getting? Nothing you've said would seem to indicate a problem. I've never found a need for global:: and I don't think it's required here. Are you somehow confusing it with your Globals project?

        N Offline
        N Offline
        Nigel Mackay
        wrote on last edited by
        #3

        I just put the global in to see if it helped. No exception - compile error: Assembly generation failed -- Referenced assembly 'Globals' does not have a strong name : Printing.DataGridViewPrint But Code Completion worked when entering the line. And other places in my code I can access variables and constants in Lookup (although I don't need the ClientServerTimesheet. as they are in the same namespace.) I renamed he project that contains Lookup to SolutionGlobals as well as its Assembly Name and the compile error follows the change.!! If I comment out the line code compiles and runs. I checked the Build Order and Dependencies. Printer.DataGrisViewPrintProvider is only dependant on SolutionGlobals (Lookup) which is compiled first, and only the client is dependant on it, and client is compiled later in the order.

        P 1 Reply Last reply
        0
        • N Nigel Mackay

          I just put the global in to see if it helped. No exception - compile error: Assembly generation failed -- Referenced assembly 'Globals' does not have a strong name : Printing.DataGridViewPrint But Code Completion worked when entering the line. And other places in my code I can access variables and constants in Lookup (although I don't need the ClientServerTimesheet. as they are in the same namespace.) I renamed he project that contains Lookup to SolutionGlobals as well as its Assembly Name and the compile error follows the change.!! If I comment out the line code compiles and runs. I checked the Build Order and Dependencies. Printer.DataGrisViewPrintProvider is only dependant on SolutionGlobals (Lookup) which is compiled first, and only the client is dependant on it, and client is compiled later in the order.

          P Offline
          P Offline
          PIEBALDconsult
          wrote on last edited by
          #4

          Hmmm, well there are situations where an assembly needs a strong name. And as I recall, a strong-named assembly must refer to only strong-named assemblies. So, basically, if any of your assemblies will be strong-named they all must be. I use one strong name file thingy for all the projects in my solutions and that takes care of it.

          N 1 Reply Last reply
          0
          • P PIEBALDconsult

            Hmmm, well there are situations where an assembly needs a strong name. And as I recall, a strong-named assembly must refer to only strong-named assemblies. So, basically, if any of your assemblies will be strong-named they all must be. I use one strong name file thingy for all the projects in my solutions and that takes care of it.

            N Offline
            N Offline
            Nigel Mackay
            wrote on last edited by
            #5

            After giving all 17 projects a strong name it now compiles!!

            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