Namespace problem (no strong name)
-
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 lineglobal::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 -
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 lineglobal::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 ExpressWhat 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? -
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?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. -
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.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.
-
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.
After giving all 17 projects a strong name it now compiles!!