473,385 Members | 1,593 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Strong name assemblies

Dear NG,

I am trying to build a strong named library with Visual C++.

-Therefore I am generating a key pair using
sn -k strong_name.snk

-Create a new Project in the Visual Studio: Visual C++ Projects -> .NET ->
Class Library (.NET)
in the main file I add the lines at the beginning of the file

#using <mscorlib.dll>
[assembly:System::Reflection::AssemblyVersion("1.0. 0.0")];
[assembly:System::Reflection::AssemblyKeyFileAttrib ute("strong_name.snk")];

and put the strong_name.snk in the Project Dir (and a copy in the
Debug/Release for testing).

-after compiling I test with
sn -v strong_name.dll

which returns:
"strong_name.dll does not represent a strongly named assembly"

-compiling in the command line using

cl /LD shtrong_name.cpp /clr

and testing again with
sn -v strong_name.dll

returns:
"Assembly 'strong_name.dll' is valid"
So I searched in the compiler and linker options, but I do not really get
the clue, which part of the options prevents my dll to be strong named :-(.

Any ideas?

Thank you very much,
Patrick
Nov 17 '05 #1
3 6084
I solved this Problem now by reading an articel about pre-compiled headers.
I moved the #include<stdafx.h> to the very top and it compiles and could be
verified as a strong named dll.

But here is my next Problem:
Including e.g. <algorithm> , which truly is a subset of ANSI C++ prohibits
to compile a dll with strong names. Are there any hints how I could achieve
this or what am I doing wrong?

Thank you,
Patrick

"Patrick Kowalzick" <Pa***************@cern.ch> wrote in message
news:eN****************@TK2MSFTNGP10.phx.gbl...
Dear NG,

I am trying to build a strong named library with Visual C++.

-Therefore I am generating a key pair using
sn -k strong_name.snk

-Create a new Project in the Visual Studio: Visual C++ Projects -> .NET ->
Class Library (.NET)
in the main file I add the lines at the beginning of the file

#using <mscorlib.dll>
[assembly:System::Reflection::AssemblyVersion("1.0. 0.0")];
[assembly:System::Reflection::AssemblyKeyFileAttrib ute("strong_name.snk")];
and put the strong_name.snk in the Project Dir (and a copy in the
Debug/Release for testing).

-after compiling I test with
sn -v strong_name.dll

which returns:
"strong_name.dll does not represent a strongly named assembly"

-compiling in the command line using

cl /LD shtrong_name.cpp /clr

and testing again with
sn -v strong_name.dll

returns:
"Assembly 'strong_name.dll' is valid"
So I searched in the compiler and linker options, but I do not really get
the clue, which part of the options prevents my dll to be strong named :-(.
Any ideas?

Thank you very much,
Patrick

Nov 17 '05 #2
Can you explain how it "prevents"the signing?

Ronald Laeremans
Visual C++ team

"Patrick Kowalzick" <Pa***************@cern.ch> wrote in message
news:Od**************@TK2MSFTNGP09.phx.gbl...
I solved this Problem now by reading an articel about pre-compiled headers. I moved the #include<stdafx.h> to the very top and it compiles and could be verified as a strong named dll.

But here is my next Problem:
Including e.g. <algorithm> , which truly is a subset of ANSI C++ prohibits
to compile a dll with strong names. Are there any hints how I could achieve this or what am I doing wrong?

Thank you,
Patrick

"Patrick Kowalzick" <Pa***************@cern.ch> wrote in message
news:eN****************@TK2MSFTNGP10.phx.gbl...
Dear NG,

I am trying to build a strong named library with Visual C++.

-Therefore I am generating a key pair using
sn -k strong_name.snk

-Create a new Project in the Visual Studio: Visual C++ Projects -> ..NET -> Class Library (.NET)
in the main file I add the lines at the beginning of the file

#using <mscorlib.dll>
[assembly:System::Reflection::AssemblyVersion("1.0. 0.0")];

[assembly:System::Reflection::AssemblyKeyFileAttrib ute("strong_name.snk")];

and put the strong_name.snk in the Project Dir (and a copy in the
Debug/Release for testing).

-after compiling I test with
sn -v strong_name.dll

which returns:
"strong_name.dll does not represent a strongly named assembly"

-compiling in the command line using

cl /LD shtrong_name.cpp /clr

and testing again with
sn -v strong_name.dll

returns:
"Assembly 'strong_name.dll' is valid"
So I searched in the compiler and linker options, but I do not really get the clue, which part of the options prevents my dll to be strong named

:-(.

Any ideas?

Thank you very much,
Patrick


Nov 17 '05 #3
Hello Ronald,
Can you explain how it "prevents"the signing?
I will try to explain, but I am neither sure expressing me "really" correct
nor have I solid knowledge of the .NET concepts. But there are a few things
I am wondering about, but itmay be off-topic whilst it is not related
directly to the language.

-when <algorithm> is included the "test" sn -v strong_name.dll always
returns that the dll is not a strong named lib.
just commenting out the line with the include results in a strong named dll
(again just sn -k ...).

-when algorithm is included and I change the filename in the line
[assembly:System::Reflection::AssemblyKeyFileAttrib ute("strong_name.snk")];
in a key name what does not exist the program still compiles fine without
any warning.
Without the include the compilers stops with an error message.

I hope my installation of the framework ist correct and I will try to search
today a lit further.
Help -> About shows:
Microsoft Development Envronment 2003 Version 7.1.3088
Microsoft .NET Framework 1.1 Version 1.1.4322

Thx,
Patrick
"Ronald Laeremans [MSFT]" <ro*****@online.microsoft.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
Ronald Laeremans
Visual C++ team

"Patrick Kowalzick" <Pa***************@cern.ch> wrote in message
news:Od**************@TK2MSFTNGP09.phx.gbl...
I solved this Problem now by reading an articel about pre-compiled

headers.
I moved the #include<stdafx.h> to the very top and it compiles and could

be
verified as a strong named dll.

But here is my next Problem:
Including e.g. <algorithm> , which truly is a subset of ANSI C++ prohibits
to compile a dll with strong names. Are there any hints how I could

achieve
this or what am I doing wrong?

Thank you,
Patrick

"Patrick Kowalzick" <Pa***************@cern.ch> wrote in message
news:eN****************@TK2MSFTNGP10.phx.gbl...
Dear NG,

I am trying to build a strong named library with Visual C++.

-Therefore I am generating a key pair using
sn -k strong_name.snk

-Create a new Project in the Visual Studio: Visual C++ Projects ->

.NET -> Class Library (.NET)
in the main file I add the lines at the beginning of the file

#using <mscorlib.dll>
[assembly:System::Reflection::AssemblyVersion("1.0. 0.0")];

[assembly:System::Reflection::AssemblyKeyFileAttrib ute("strong_name.snk")];

and put the strong_name.snk in the Project Dir (and a copy in the
Debug/Release for testing).

-after compiling I test with
sn -v strong_name.dll

which returns:
"strong_name.dll does not represent a strongly named assembly"

-compiling in the command line using

cl /LD shtrong_name.cpp /clr

and testing again with
sn -v strong_name.dll

returns:
"Assembly 'strong_name.dll' is valid"
So I searched in the compiler and linker options, but I do not really get the clue, which part of the options prevents my dll to be strong named

:-(.

Any ideas?

Thank you very much,
Patrick



Nov 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: kfkyle | last post by:
We are currently developing our build process for an ASP.NET application. This application will consist of about 8 assemblies in total. Even though these assemblies will be deployed in a private...
10
by: Tony Jones | last post by:
Can anyone think of a reason why a 3rd party vendor writing .NET components would NOT strong name their assemblies? What harm does adding a strong-name to assembly present - I would think none...
3
by: lanky_tx | last post by:
Hi All, We have an automated build and test environment using NAnt and Nunit. Some of our assemblies are being strong named by modifying the AssemblyInfo.cs and having csc compile it. Some of...
8
by: Tamir Khason | last post by:
Following the code: Assembly myAssembly = Assembly.LoadFrom(FileName); foreach (Type myType in myAssembly.GetTypes()) {Do_whatever()}
4
by: Stefan | last post by:
Hi, I have an application that consists of multiple strong-named assemblies like: App.exe references Utils.dll (for simplicities sake) All assemblies are strong-named, but not GAC'd...
3
by: Mark Keogh | last post by:
Hi, Why is everything some confusng when MS are involved ;-) Anyway, I have my excel export routines working fine, now when I try to build them into my assembly, which has a strong name, I get...
1
by: Tom Stratford | last post by:
Having trouble linking my strong named assemblies together with a vendor provided assembly that is not strong named. Is this possible without giving up my standards for using strong names?
0
by: John Liu | last post by:
Recently I had to do some really nasty work (I consider any IL work nasty) to get a set of (not strong named) 3rd party assemblies to compile with our solution (which is strong named). ...
7
by: Alan T | last post by:
I have create a class library and add it to the reference list in one of the projects. However, when I compile the project and got the error: Assembly generation failed -- Referenced assembly...
6
by: raylopez99 | last post by:
Anybody use Strong Name Signing? I think this is used by default for Resource files, which is one reason perhaps I can't get my resource files to work (somehow the public key is messed up, perhaps...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.