Saturday, March 24, 2012
Strong Naming
I have an ASP.NET app.
I wrote some assemblies in VB.NET which my ASP app calls.
I want to Strong Name these assemblies.
Anyone know any good sites that goes throughhow to do this
step by step?
Thanks,
CSure, here's a useful link straight from the horse's mouth:
http://msdn.microsoft.com/library/d...ystrongname.asp
--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net
Hire top-notch developers at http://www.able-consulting.com
"C" <anonymous@.discussions.microsoft.com> wrote in message
news:020001c3a3bb$f526d300$a101280a@.phx.gbl...
> Hi,
> I have an ASP.NET app.
> I wrote some assemblies in VB.NET which my ASP app calls.
> I want to Strong Name these assemblies.
> Anyone know any good sites that goes throughhow to do this
> step by step?
> Thanks,
> C
http://msdn.microsoft.com/library/d...ystrongname.asp
--
Chris Jackson
Software Engineer
Microsoft MVP - Windows XP
Windows XP Associate Expert
--
More people read the newsgroups than read my email.
Reply to the newsgroup for a faster response.
(Control-G using Outlook Express)
--
"C" <anonymous@.discussions.microsoft.com> wrote in message
news:020001c3a3bb$f526d300$a101280a@.phx.gbl...
> Hi,
> I have an ASP.NET app.
> I wrote some assemblies in VB.NET which my ASP app calls.
> I want to Strong Name these assemblies.
> Anyone know any good sites that goes throughhow to do this
> step by step?
> Thanks,
> C
Search for al.exe on your hard drive.
--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net
Hire top-notch developers at http://www.able-consulting.com
"C" <anonymous@.discussions.microsoft.com> wrote in message
news:02a501c3a3c0$dbc03140$a101280a@.phx.gbl...
> Thanks for taht.
> I cane across thsi allright.
> How do I access teh Assembly linker whichj I use to create
> my stong name?
> C
> >--Original Message--
> >Sure, here's a useful link straight from the horse's
> mouth:
> >http://msdn.microsoft.com/library/default.asp?
> url=/library/en-
> us/cpguide/html/cpconassigningassemblystrongname.asp
> >--
> >I hope this helps,
> >Steve C. Orr, MCSD, MVP
> >http://Steve.Orr.net
> >Hire top-notch developers at http://www.able-
> consulting.com
> >"C" <anonymous@.discussions.microsoft.com> wrote in message
> >news:020001c3a3bb$f526d300$a101280a@.phx.gbl...
> >> Hi,
> >>
> >> I have an ASP.NET app.
> >>
> >> I wrote some assemblies in VB.NET which my ASP app
> calls.
> >>
> >> I want to Strong Name these assemblies.
> >>
> >> Anyone know any good sites that goes throughhow to do
> this
> >> step by step?
> >>
> >> Thanks,
> >> C
> >.
Strong Naming an ASP.Net Project
I have a Web Project (UserControls.dll) with some user controls that
is shared by many asp.net web applicattions.
What we do is copy UserControls.dll to all the applications bin
folders an this works correctly.
We want to have this shared code in the GAC.
Wit other non-web projects we create a snk file, add it to the project
and compile. Later we register this dll manually in the GAC.
I have been trying to do this with a web project , and all the time I
get an error saying that it cannot read the snk file.
Is it possible to strong name the generated dll of a web project?
Thanks in Advance.
ManuelYes it is, but with ASP.NET there are two places where a binary is built.
You may have to put the strong name in the temporary directory where things
are built:
c:\documents and
settings\<userName>\VSWebCache\<machineName>\<applicationName
--
Chris Jackson
Software Engineer
Microsoft MVP - Windows Client
Windows XP Associate Expert
--
More people read the newsgroups than read my email.
Reply to the newsgroup for a faster response.
(Control-G using Outlook Express)
--
"Manuel Lopez" <mcpollo@.terra.es> wrote in message
news:cd080612.0312010830.45b95557@.posting.google.c om...
> Hello,
> I have a Web Project (UserControls.dll) with some user controls that
> is shared by many asp.net web applicattions.
> What we do is copy UserControls.dll to all the applications bin
> folders an this works correctly.
> We want to have this shared code in the GAC.
> Wit other non-web projects we create a snk file, add it to the project
> and compile. Later we register this dll manually in the GAC.
> I have been trying to do this with a web project , and all the time I
> get an error saying that it cannot read the snk file.
> Is it possible to strong name the generated dll of a web project?
> Thanks in Advance.
> Manuel
Hello Chris,
Thanks for the reply.
Our problem is that we cannot compile our web project with
the user controls when we add a snk file and reference it
from Assembly file.
It seems as if you cannot use then with web projects.
>--Original Message--
>Yes it is, but with ASP.NET there are two places where a
binary is built.
>You may have to put the strong name in the temporary
directory where things
>are built:
>c:\documents and
>settings\<userName>\VSWebCache\<machineName>\<applicationN
ame>
>
>--
>Chris Jackson
>Software Engineer
>Microsoft MVP - Windows Client
>Windows XP Associate Expert
>--
>More people read the newsgroups than read my email.
>Reply to the newsgroup for a faster response.
>(Control-G using Outlook Express)
>--
>"Manuel Lopez" <mcpollo@.terra.es> wrote in message
>news:cd080612.0312010830.45b95557@.posting.google.c om...
>> Hello,
>>
>> I have a Web Project (UserControls.dll) with some user
controls that
>> is shared by many asp.net web applicattions.
>>
>> What we do is copy UserControls.dll to all the
applications bin
>> folders an this works correctly.
>>
>> We want to have this shared code in the GAC.
>>
>> Wit other non-web projects we create a snk file, add it
to the project
>> and compile. Later we register this dll manually in the
GAC.
>>
>> I have been trying to do this with a web project , and
all the time I
>> get an error saying that it cannot read the snk file.
>>
>> Is it possible to strong name the generated dll of a
web project?
>>
>> Thanks in Advance.
>>
>> Manuel
>
>.
I may be missing what you are asking here. Are you trying to compile the
project you are strong naming and failing? If that is the case, then you
need to move the SNK file. The error that is generated should tell you the
directory it is searching in and failing to find it. Have you compiled and
strong named an assembly, and having trouble referencing it? You should
definitely be able to reference a strong named file - that also works. You
just need to make sure it is in the search path. What is the error that you
are seeing?
--
Chris Jackson
Software Engineer
Microsoft MVP - Windows Client
Windows XP Associate Expert
--
More people read the newsgroups than read my email.
Reply to the newsgroup for a faster response.
(Control-G using Outlook Express)
--
"Manuel Lopez" <anonymous@.discussions.microsoft.com> wrote in message
news:0ae201c3b833$8a338160$a501280a@.phx.gbl...
> Hello Chris,
> Thanks for the reply.
> Our problem is that we cannot compile our web project with
> the user controls when we add a snk file and reference it
> from Assembly file.
> It seems as if you cannot use then with web projects.
>
> >--Original Message--
> >Yes it is, but with ASP.NET there are two places where a
> binary is built.
> >You may have to put the strong name in the temporary
> directory where things
> >are built:
> >c:\documents and
> >settings\<userName>\VSWebCache\<machineName>\<applicationN
> ame>
> >--
> >Chris Jackson
> >Software Engineer
> >Microsoft MVP - Windows Client
> >Windows XP Associate Expert
> >--
> >More people read the newsgroups than read my email.
> >Reply to the newsgroup for a faster response.
> >(Control-G using Outlook Express)
> >--
> >"Manuel Lopez" <mcpollo@.terra.es> wrote in message
> >news:cd080612.0312010830.45b95557@.posting.google.c om...
> >> Hello,
> >>
> >> I have a Web Project (UserControls.dll) with some user
> controls that
> >> is shared by many asp.net web applicattions.
> >>
> >> What we do is copy UserControls.dll to all the
> applications bin
> >> folders an this works correctly.
> >>
> >> We want to have this shared code in the GAC.
> >>
> >> Wit other non-web projects we create a snk file, add it
> to the project
> >> and compile. Later we register this dll manually in the
> GAC.
> >>
> >> I have been trying to do this with a web project , and
> all the time I
> >> get an error saying that it cannot read the snk file.
> >>
> >> Is it possible to strong name the generated dll of a
> web project?
> >>
> >> Thanks in Advance.
> >>
> >> Manuel
> >.
Hello Again Chris,
My problem is that i cant generate the strong name "web"
project.
The snk file is the at the same level of of vbproj file,
and in assembly i have :
<Assembly: AssemblyKeyFile("..\..\Keys.snk")>
I have tried copying the snk file to the bin directory,
changing the path and it just doesnt work for a "Web"
project.
Maybe you just cant strong name a "Web" through Visual
Studio.
Thanks
>--Original Message--
>I may be missing what you are asking here. Are you trying
to compile the
>project you are strong naming and failing? If that is the
case, then you
>need to move the SNK file. The error that is generated
should tell you the
>directory it is searching in and failing to find it. Have
you compiled and
>strong named an assembly, and having trouble referencing
it? You should
>definitely be able to reference a strong named file -
that also works. You
>just need to make sure it is in the search path. What is
the error that you
>are seeing?
>--
>Chris Jackson
>Software Engineer
>Microsoft MVP - Windows Client
>Windows XP Associate Expert
>--
>More people read the newsgroups than read my email.
>Reply to the newsgroup for a faster response.
>(Control-G using Outlook Express)
>--
>"Manuel Lopez" <anonymous@.discussions.microsoft.com>
wrote in message
>news:0ae201c3b833$8a338160$a501280a@.phx.gbl...
>> Hello Chris,
>>
>> Thanks for the reply.
>>
>> Our problem is that we cannot compile our web project
with
>> the user controls when we add a snk file and reference
it
>> from Assembly file.
>>
>> It seems as if you cannot use then with web projects.
>>
>>
>> >--Original Message--
>> >Yes it is, but with ASP.NET there are two places where
a
>> binary is built.
>> >You may have to put the strong name in the temporary
>> directory where things
>> >are built:
>>> >c:\documents and
>>
>settings\<userName>\VSWebCache\<machineName>\<applicationN
>> ame>
>>>> >--
>> >Chris Jackson
>> >Software Engineer
>> >Microsoft MVP - Windows Client
>> >Windows XP Associate Expert
>> >--
>> >More people read the newsgroups than read my email.
>> >Reply to the newsgroup for a faster response.
>> >(Control-G using Outlook Express)
>> >--
>>> >"Manuel Lopez" <mcpollo@.terra.es> wrote in message
>> >news:cd080612.0312010830.45b95557@.posting.google.c om...
>> >> Hello,
>> >>
>> >> I have a Web Project (UserControls.dll) with some
user
>> controls that
>> >> is shared by many asp.net web applicattions.
>> >>
>> >> What we do is copy UserControls.dll to all the
>> applications bin
>> >> folders an this works correctly.
>> >>
>> >> We want to have this shared code in the GAC.
>> >>
>> >> Wit other non-web projects we create a snk file, add
it
>> to the project
>> >> and compile. Later we register this dll manually in
the
>> GAC.
>> >>
>> >> I have been trying to do this with a web project ,
and
>> all the time I
>> >> get an error saying that it cannot read the snk file.
>> >>
>> >> Is it possible to strong name the generated dll of a
>> web project?
>> >>
>> >> Thanks in Advance.
>> >>
>> >> Manuel
>>>> >.
>>
>.
You can strong name it, you just have to manually drag the SNK file to the
VSWebCache folder (as indicated in my first post). VS.NET does not provide
the mechanisms, though the error message should help you locate the proper
directory. The folder in inetpub is NOT where it goes. I have done it
before, I just don't have any on this machine to give you the exact
location, but I promise you that it works.
--
Chris Jackson
Software Engineer
Microsoft MVP - Windows Client
Windows XP Associate Expert
--
More people read the newsgroups than read my email.
Reply to the newsgroup for a faster response.
(Control-G using Outlook Express)
--
"Manuel Lopez" <anonymous@.discussions.microsoft.com> wrote in message
news:afa901c3b8b6$b56a0a10$a601280a@.phx.gbl...
Hello Again Chris,
My problem is that i cant generate the strong name "web"
project.
The snk file is the at the same level of of vbproj file,
and in assembly i have :
<Assembly: AssemblyKeyFile("..\..\Keys.snk")
I have tried copying the snk file to the bin directory,
changing the path and it just doesnt work for a "Web"
project.
Maybe you just cant strong name a "Web" through Visual
Studio.
Thanks
>--Original Message--
>I may be missing what you are asking here. Are you trying
to compile the
>project you are strong naming and failing? If that is the
case, then you
>need to move the SNK file. The error that is generated
should tell you the
>directory it is searching in and failing to find it. Have
you compiled and
>strong named an assembly, and having trouble referencing
it? You should
>definitely be able to reference a strong named file -
that also works. You
>just need to make sure it is in the search path. What is
the error that you
>are seeing?
>--
>Chris Jackson
>Software Engineer
>Microsoft MVP - Windows Client
>Windows XP Associate Expert
>--
>More people read the newsgroups than read my email.
>Reply to the newsgroup for a faster response.
>(Control-G using Outlook Express)
>--
>"Manuel Lopez" <anonymous@.discussions.microsoft.com>
wrote in message
>news:0ae201c3b833$8a338160$a501280a@.phx.gbl...
>> Hello Chris,
>>
>> Thanks for the reply.
>>
>> Our problem is that we cannot compile our web project
with
>> the user controls when we add a snk file and reference
it
>> from Assembly file.
>>
>> It seems as if you cannot use then with web projects.
>>
>>
>> >--Original Message--
>> >Yes it is, but with ASP.NET there are two places where
a
>> binary is built.
>> >You may have to put the strong name in the temporary
>> directory where things
>> >are built:
>>> >c:\documents and
>>
>settings\<userName>\VSWebCache\<machineName>\<applicationN
>> ame>
>>>> >--
>> >Chris Jackson
>> >Software Engineer
>> >Microsoft MVP - Windows Client
>> >Windows XP Associate Expert
>> >--
>> >More people read the newsgroups than read my email.
>> >Reply to the newsgroup for a faster response.
>> >(Control-G using Outlook Express)
>> >--
>>> >"Manuel Lopez" <mcpollo@.terra.es> wrote in message
>> >news:cd080612.0312010830.45b95557@.posting.google.c om...
>> >> Hello,
>> >>
>> >> I have a Web Project (UserControls.dll) with some
user
>> controls that
>> >> is shared by many asp.net web applicattions.
>> >>
>> >> What we do is copy UserControls.dll to all the
>> applications bin
>> >> folders an this works correctly.
>> >>
>> >> We want to have this shared code in the GAC.
>> >>
>> >> Wit other non-web projects we create a snk file, add
it
>> to the project
>> >> and compile. Later we register this dll manually in
the
>> GAC.
>> >>
>> >> I have been trying to do this with a web project ,
and
>> all the time I
>> >> get an error saying that it cannot read the snk file.
>> >>
>> >> Is it possible to strong name the generated dll of a
>> web project?
>> >>
>> >> Thanks in Advance.
>> >>
>> >> Manuel
>>>> >.
>>
>.
I guess I should point out, for the sake of completeness, that this may not
be the best idea. The reason I have strong named ASP.NET assemblies is
basically just to see if it can be done. (Well, FXCop was barking...)
However, note that the model for ASP.NET is not *complete* compilation, but
rather compilation of the code behind, followed by JIT compilation of the
declarative ASPX page. So, your derived forms won't actually exist in the
strong named assembly. What you should consider is developing a class
library of classes that derive from the UserControl class to provide the
basic functionality that you need, and then provide declarative pages whose
code behind inherits from this. This just occurred to me, so I figured I
would add this appendix...
--
Chris Jackson
Software Engineer
Microsoft MVP - Windows Client
Windows XP Associate Expert
--
More people read the newsgroups than read my email.
Reply to the newsgroup for a faster response.
(Control-G using Outlook Express)
--
"Chris Jackson" <chrisjATmvpsDOTorgNOSPAM> wrote in message
news:%23RN%23aIPuDHA.3256@.TK2MSFTNGP11.phx.gbl...
> You can strong name it, you just have to manually drag the SNK file to the
> VSWebCache folder (as indicated in my first post). VS.NET does not provide
> the mechanisms, though the error message should help you locate the proper
> directory. The folder in inetpub is NOT where it goes. I have done it
> before, I just don't have any on this machine to give you the exact
> location, but I promise you that it works.
> --
> Chris Jackson
> Software Engineer
> Microsoft MVP - Windows Client
> Windows XP Associate Expert
> --
> More people read the newsgroups than read my email.
> Reply to the newsgroup for a faster response.
> (Control-G using Outlook Express)
> --
> "Manuel Lopez" <anonymous@.discussions.microsoft.com> wrote in message
> news:afa901c3b8b6$b56a0a10$a601280a@.phx.gbl...
> Hello Again Chris,
> My problem is that i cant generate the strong name "web"
> project.
> The snk file is the at the same level of of vbproj file,
> and in assembly i have :
> <Assembly: AssemblyKeyFile("..\..\Keys.snk")>
> I have tried copying the snk file to the bin directory,
> changing the path and it just doesnt work for a "Web"
> project.
> Maybe you just cant strong name a "Web" through Visual
> Studio.
> Thanks
> >--Original Message--
> >I may be missing what you are asking here. Are you trying
> to compile the
> >project you are strong naming and failing? If that is the
> case, then you
> >need to move the SNK file. The error that is generated
> should tell you the
> >directory it is searching in and failing to find it. Have
> you compiled and
> >strong named an assembly, and having trouble referencing
> it? You should
> >definitely be able to reference a strong named file -
> that also works. You
> >just need to make sure it is in the search path. What is
> the error that you
> >are seeing?
> >--
> >Chris Jackson
> >Software Engineer
> >Microsoft MVP - Windows Client
> >Windows XP Associate Expert
> >--
> >More people read the newsgroups than read my email.
> >Reply to the newsgroup for a faster response.
> >(Control-G using Outlook Express)
> >--
> >"Manuel Lopez" <anonymous@.discussions.microsoft.com>
> wrote in message
> >news:0ae201c3b833$8a338160$a501280a@.phx.gbl...
> >> Hello Chris,
> >>
> >> Thanks for the reply.
> >>
> >> Our problem is that we cannot compile our web project
> with
> >> the user controls when we add a snk file and reference
> it
> >> from Assembly file.
> >>
> >> It seems as if you cannot use then with web projects.
> >>
> >>
> >> >--Original Message--
> >> >Yes it is, but with ASP.NET there are two places where
> a
> >> binary is built.
> >> >You may have to put the strong name in the temporary
> >> directory where things
> >> >are built:
> >> >> >c:\documents and
> >>
> >settings\<userName>\VSWebCache\<machineName>\<applicationN
> >> ame>
> >> >> >> >--
> >> >Chris Jackson
> >> >Software Engineer
> >> >Microsoft MVP - Windows Client
> >> >Windows XP Associate Expert
> >> >--
> >> >More people read the newsgroups than read my email.
> >> >Reply to the newsgroup for a faster response.
> >> >(Control-G using Outlook Express)
> >> >--
> >> >> >"Manuel Lopez" <mcpollo@.terra.es> wrote in message
> >> >news:cd080612.0312010830.45b95557@.posting.google.c om...
> >> >> Hello,
> >> >>
> >> >> I have a Web Project (UserControls.dll) with some
> user
> >> controls that
> >> >> is shared by many asp.net web applicattions.
> >> >>
> >> >> What we do is copy UserControls.dll to all the
> >> applications bin
> >> >> folders an this works correctly.
> >> >>
> >> >> We want to have this shared code in the GAC.
> >> >>
> >> >> Wit other non-web projects we create a snk file, add
> it
> >> to the project
> >> >> and compile. Later we register this dll manually in
> the
> >> GAC.
> >> >>
> >> >> I have been trying to do this with a web project ,
> and
> >> all the time I
> >> >> get an error saying that it cannot read the snk file.
> >> >>
> >> >> Is it possible to strong name the generated dll of a
> >> web project?
> >> >>
> >> >> Thanks in Advance.
> >> >>
> >> >> Manuel
> >> >> >> >.
> >> >.
Strong Naming a dll and registering in GAC
I am working with Microsoft Configuration Application Blocks and whenever I
create a new app and have to use it, I have to reference it and it makes a
local copy in the bin directory.
so if i created 4 apps then there are local copies of these blocks...
I tried to use GACUtil to register these dlls but it gives me an error
saying that its not having a strong name, i tried sn tool but unsuccessful.
I have tried to strong name a dll but the way i did it was in an app where I
first created a strong name and then referenced it in the app before
compiling the dll and then used GAC to register it...
but this is some external dll...
I mean is my thought process right or I am totally off base...
Please advice,
Stephenstephen,
You cannot install an assembly in the GAC without a strong name so you need
to solve this problem first.
After that, you can put copies of strong named, GAC-ed assemblies in a
single folder and reference these from your various apps; you can turn off
the copy local feature, and the copy in the GAC will be automatically used.
Hope that helps,
Peter
--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com
"stephen" wrote:
Quote:
Originally Posted by
>
Hi,
>
I am working with Microsoft Configuration Application Blocks and whenever I
create a new app and have to use it, I have to reference it and it makes a
local copy in the bin directory.
so if i created 4 apps then there are local copies of these blocks...
>
I tried to use GACUtil to register these dlls but it gives me an error
saying that its not having a strong name, i tried sn tool but unsuccessful.
I have tried to strong name a dll but the way i did it was in an app where I
first created a strong name and then referenced it in the app before
compiling the dll and then used GAC to register it...
but this is some external dll...
>
I mean is my thought process right or I am totally off base...
Please advice,
Stephen
>
>
>
Strong naming assembly in an vb aspx project
in my assemblyinfo.vb I have:
<Assembly: AssemblyKeyFileAttribute("StrongNameKey.snk")>
I get the error "Error creating assembly manifest: Error reading key
file 'StrongNameKey.snk' -- The system cannot find the file
specified."
?
/MHi,
The placement of key depends on what mode are you compiling your vb project
with i.e. Debug or Release.
This is a VB issue cause the build directory for VB.NET assemblies is not
the same as the output directory, which usually is \bin (relative to the
project). If the solution configuration is in the default Debug mode, the
output directory is \obj\Debug. If in Release mode, it's \obj\Release. This
is where the strong
name key file must be placed.
HTH,
Piyush
<job@.bla.com> wrote in message
news:2hkd12t1gb8ic7v3tsmrc2eehdou99okpq@.
4ax.com...
> I put my StrongNameKey.snk in my root foler.
> in my assemblyinfo.vb I have:
> <Assembly: AssemblyKeyFileAttribute("StrongNameKey.snk")>
> I get the error "Error creating assembly manifest: Error reading key
> file 'StrongNameKey.snk' -- The system cannot find the file
> specified."
> ?
> /M
Hmm. my project is a web project and I only have a bin output folder.
Even in my unittest class project in the same solution, I have the
same error. Strange.
On Tue, 14 Mar 2006 10:07:02 -0500, "Piyush Daiya"
<pdaiya@.primeassociates.com> wrote:
>Hi,
>The placement of key depends on what mode are you compiling your vb project
>with i.e. Debug or Release.
>This is a VB issue cause the build directory for VB.NET assemblies is not
>the same as the output directory, which usually is \bin (relative to the
>project). If the solution configuration is in the default Debug mode, the
>output directory is \obj\Debug. If in Release mode, it's \obj\Release. Thi
s
>is where the strong
>name key file must be placed.
>HTH,
>Piyush
><job@.bla.com> wrote in message
> news:2hkd12t1gb8ic7v3tsmrc2eehdou99okpq@.
4ax.com...
>
Strong naming assembly in an vb aspx project
in my assemblyinfo.vb I have:
<Assembly: AssemblyKeyFileAttribute("StrongNameKey.snk")
I get the error "Error creating assembly manifest: Error reading key
file 'StrongNameKey.snk' -- The system cannot find the file
specified."
?
/MHi,
The placement of key depends on what mode are you compiling your vb project
with i.e. Debug or Release.
This is a VB issue cause the build directory for VB.NET assemblies is not
the same as the output directory, which usually is \bin (relative to the
project). If the solution configuration is in the default Debug mode, the
output directory is \obj\Debug. If in Release mode, it's \obj\Release. This
is where the strong
name key file must be placed.
HTH,
Piyush
<job@.bla.com> wrote in message
news:2hkd12t1gb8ic7v3tsmrc2eehdou99okpq@.4ax.com...
> I put my StrongNameKey.snk in my root foler.
> in my assemblyinfo.vb I have:
> <Assembly: AssemblyKeyFileAttribute("StrongNameKey.snk")>
> I get the error "Error creating assembly manifest: Error reading key
> file 'StrongNameKey.snk' -- The system cannot find the file
> specified."
> ?
> /M
Hmm. my project is a web project and I only have a bin output folder.
Even in my unittest class project in the same solution, I have the
same error. Strange.
On Tue, 14 Mar 2006 10:07:02 -0500, "Piyush Daiya"
<pdaiya@.primeassociates.com> wrote:
>Hi,
>The placement of key depends on what mode are you compiling your vb project
>with i.e. Debug or Release.
>This is a VB issue cause the build directory for VB.NET assemblies is not
>the same as the output directory, which usually is \bin (relative to the
>project). If the solution configuration is in the default Debug mode, the
>output directory is \obj\Debug. If in Release mode, it's \obj\Release. This
>is where the strong
>name key file must be placed.
>HTH,
>Piyush
><job@.bla.com> wrote in message
>news:2hkd12t1gb8ic7v3tsmrc2eehdou99okpq@.4ax.com...
>> I put my StrongNameKey.snk in my root foler.
>>
>> in my assemblyinfo.vb I have:
>> <Assembly: AssemblyKeyFileAttribute("StrongNameKey.snk")>
>>
>> I get the error "Error creating assembly manifest: Error reading key
>> file 'StrongNameKey.snk' -- The system cannot find the file
>> specified."
>>
>> ?
>>
>> /M
Thursday, March 22, 2012
strong naming assembly
Here is what I have done:
called sn -k Tesstkey.snk
placed this code in my class:
using System.Reflection;
[assembly:AssemblyKeyFileAttribute("TestKey.snk")]
I am getting an error saying it cannot read the key file
First, Where should that .snk file go?
Second, What could cause that error?
DerrickHi,
You can give absolute path also for the .snk file.
I believe VS.NET IDE looks for the .snk file in the devenv.exe folder
itself.
"Derrick" <Derrick_no_spam@.geostrategies.ca> wrote in message
news:9LfOc.137615$ek5.83297@.pd7tw2no...
I am attempting trying to create an assembly with strong name
Here is what I have done:
called sn -k Tesstkey.snk
placed this code in my class:
using System.Reflection;
[assembly:AssemblyKeyFileAttribute("TestKey.snk")]
I am getting an error saying it cannot read the key file
First, Where should that .snk file go?
Second, What could cause that error?
Derrick
Hi Derrick,
As for the making stong-named asembly issue, I think you Shiva's suggestion
that use the full absolutte path of the key file is reasonable. Since
you're using the relative path of the file(haven't specify the full path),
I'm not sure whether the problem is cause by this. Anyway, please have a
try and if you have anyother findings, please also feel free to post here.
Thanks.
Regards,
Steven Cheng
Microsoft Online Support
Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx
Derrick,
You can use a relative path for this, but it should be relative to the
compiled assembly, not the project file. For example, if you keep the key
file in the project root folder and your assemblies get compiled to <project
root>\bin\debug or <project root>\bin\release, then your relative path must
point up two directories. e.g.:
[assembly: AssemblyKeyFile(@."..\..\TestKey.snk")]
HTH,
Nicole
"Derrick" <Derrick_no_spam@.geostrategies.ca> wrote in message
news:9LfOc.137615$ek5.83297@.pd7tw2no...
>I am attempting trying to create an assembly with strong name
> Here is what I have done:
> called sn -k Tesstkey.snk
> placed this code in my class:
> using System.Reflection;
> [assembly:AssemblyKeyFileAttribute("TestKey.snk")]
> I am getting an error saying it cannot read the key file
> First, Where should that .snk file go?
> Second, What could cause that error?
> Derrick
>
>
>
Thanks for the help.
physical path wouldn't work because I have to move the projects between
machines. I used Nicole's suggestion to use the relative path of
"..\..\file.snk", and that worked. I had the file in the \bin\release\
folder, so that should have worked, but I can work with the relative path
approach.
Derrick
"Steven Cheng[MSFT]" <v-schang@.online.microsoft.com> wrote in message
news:Ic7VahfdEHA.2932@.cpmsftngxa10.phx.gbl...
> Hi Derrick,
> As for the making stong-named asembly issue, I think you Shiva's
suggestion
> that use the full absolutte path of the key file is reasonable. Since
> you're using the relative path of the file(haven't specify the full path),
> I'm not sure whether the problem is cause by this. Anyway, please have a
> try and if you have anyother findings, please also feel free to post here.
> Thanks.
> Regards,
> Steven Cheng
> Microsoft Online Support
> Get Secure! www.microsoft.com/security
> (This posting is provided "AS IS", with no warranties, and confers no
> rights.)
> Get Preview at ASP.NET whidbey
> http://msdn.microsoft.com/asp.net/whidbey/default.aspx
>
Thanks, Nicole
That worked
Derrick
"Nicole Calinoiu" <nicolec@.somewhere.net> wrote in message
news:OJjcaIkdEHA.3704@.TK2MSFTNGP09.phx.gbl...
> Derrick,
> You can use a relative path for this, but it should be relative to the
> compiled assembly, not the project file. For example, if you keep the key
> file in the project root folder and your assemblies get compiled to
<project
> root>\bin\debug or <project root>\bin\release, then your relative path
must
> point up two directories. e.g.:
> [assembly: AssemblyKeyFile(@."..\..\TestKey.snk")]
> HTH,
> Nicole
>
> "Derrick" <Derrick_no_spam@.geostrategies.ca> wrote in message
> news:9LfOc.137615$ek5.83297@.pd7tw2no...
>
strong naming assembly
Here is what I have done:
called sn -k Tesstkey.snk
placed this code in my class:
using System.Reflection;
[assembly:AssemblyKeyFileAttribute("TestKey.snk")]
I am getting an error saying it cannot read the key file
First, Where should that .snk file go?
Second, What could cause that error?
DerrickHi,
You can give absolute path also for the .snk file.
I believe VS.NET IDE looks for the .snk file in the devenv.exe folder
itself.
"Derrick" <Derrick_no_spam@.geostrategies.ca> wrote in message
news:9LfOc.137615$ek5.83297@.pd7tw2no...
I am attempting trying to create an assembly with strong name
Here is what I have done:
called sn -k Tesstkey.snk
placed this code in my class:
using System.Reflection;
[assembly:AssemblyKeyFileAttribute("TestKey.snk")]
I am getting an error saying it cannot read the key file
First, Where should that .snk file go?
Second, What could cause that error?
Derrick
Hi Derrick,
As for the making stong-named asembly issue, I think you Shiva's suggestion
that use the full absolutte path of the key file is reasonable. Since
you're using the relative path of the file(haven't specify the full path),
I'm not sure whether the problem is cause by this. Anyway, please have a
try and if you have anyother findings, please also feel free to post here.
Thanks.
Regards,
Steven Cheng
Microsoft Online Support
Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx
Derrick,
You can use a relative path for this, but it should be relative to the
compiled assembly, not the project file. For example, if you keep the key
file in the project root folder and your assemblies get compiled to <project
root>\bin\debug or <project root>\bin\release, then your relative path must
point up two directories. e.g.:
[assembly: AssemblyKeyFile(@."..\..\TestKey.snk")]
HTH,
Nicole
"Derrick" <Derrick_no_spam@.geostrategies.ca> wrote in message
news:9LfOc.137615$ek5.83297@.pd7tw2no...
>I am attempting trying to create an assembly with strong name
> Here is what I have done:
> called sn -k Tesstkey.snk
> placed this code in my class:
> using System.Reflection;
> [assembly:AssemblyKeyFileAttribute("TestKey.snk")]
> I am getting an error saying it cannot read the key file
> First, Where should that .snk file go?
> Second, What could cause that error?
> Derrick
>
Thanks for the help.
physical path wouldn't work because I have to move the projects between
machines. I used Nicole's suggestion to use the relative path of
"..\..\file.snk", and that worked. I had the file in the \bin\release\
folder, so that should have worked, but I can work with the relative path
approach.
Derrick
"Steven Cheng[MSFT]" <v-schang@.online.microsoft.com> wrote in message
news:Ic7VahfdEHA.2932@.cpmsftngxa10.phx.gbl...
> Hi Derrick,
> As for the making stong-named asembly issue, I think you Shiva's
suggestion
> that use the full absolutte path of the key file is reasonable. Since
> you're using the relative path of the file(haven't specify the full path),
> I'm not sure whether the problem is cause by this. Anyway, please have a
> try and if you have anyother findings, please also feel free to post here.
> Thanks.
> Regards,
> Steven Cheng
> Microsoft Online Support
> Get Secure! www.microsoft.com/security
> (This posting is provided "AS IS", with no warranties, and confers no
> rights.)
> Get Preview at ASP.NET whidbey
> http://msdn.microsoft.com/asp.net/whidbey/default.aspx
Thanks, Nicole
That worked
Derrick
"Nicole Calinoiu" <nicolec@.somewhere.net> wrote in message
news:OJjcaIkdEHA.3704@.TK2MSFTNGP09.phx.gbl...
> Derrick,
> You can use a relative path for this, but it should be relative to the
> compiled assembly, not the project file. For example, if you keep the key
> file in the project root folder and your assemblies get compiled to
<project
> root>\bin\debug or <project root>\bin\release, then your relative path
must
> point up two directories. e.g.:
> [assembly: AssemblyKeyFile(@."..\..\TestKey.snk")]
> HTH,
> Nicole
>
> "Derrick" <Derrick_no_spam@.geostrategies.ca> wrote in message
> news:9LfOc.137615$ek5.83297@.pd7tw2no...
> >I am attempting trying to create an assembly with strong name
> > Here is what I have done:
> > called sn -k Tesstkey.snk
> > placed this code in my class:
> > using System.Reflection;
> > [assembly:AssemblyKeyFileAttribute("TestKey.snk")]
> > I am getting an error saying it cannot read the key file
> > First, Where should that .snk file go?
> > Second, What could cause that error?
> > Derrick