Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Is there a way to sign partial classes in Whidbey?

Reply
Thread Tools

Is there a way to sign partial classes in Whidbey?

 
 
=?Utf-8?B?VmFkaW0=?=
Guest
Posts: n/a
 
      01-12-2005
I want to make strong name for may apllication assemblies, but I don't know
where and how can I do it in Whidbey.

Help me please
 
Reply With Quote
 
 
 
 
Juan T. Llibre
Guest
Posts: n/a
 
      01-12-2005
Check out this link ( copy and paste it )
in the Whidbey documentation:

ms-help://MS.VSCC.v80/MS.MSDNQTR.v80.en/MS.MSDN.v80/MS.VisualStudio.v80.en/dv_fxadvance/html/2c30799a-a826-46b4-a25d-c584027a6c67.htm

Essentially, there are two ways to sign an assembly with a strong name:

1. Using the Assembly Linker (Al.exe) provided by the .NET Framework SDK.

2. Using assembly attributes to insert the strong name information in your
code.

You can use either the AssemblyKeyFileAttribute
or the AssemblyKeyNameAttribute, depending on
where the key file to be used is located.

You must have a cryptographic key pair
to sign an assembly with a strong name.

This public and private cryptographic key pair is used
during compilation to create a strong-named assembly.

You can create a key pair using the Strong Name tool (Sn.exe).
Key pair files usually have an .snk extension.

To get info about creating a cryptographic key pair, see :

ms-help://MS.VSCC.v80/MS.MSDNQTR.v80.en/MS.MSDN.v80/MS.VisualStudio.v80.en/dv_fxadvance/html/05026813-f3bd-4d7c-9e0b-fc588eb3d114.htm

in your Whidbey documentation



Juan T. Llibre
ASP.NET MVP
===========
"Vadim" <> wrote in message
news:9A17F649-8D93-431C-A4C6-...
>I want to make strong name for may apllication assemblies, but I don't know
> where and how can I do it in Whidbey.
>
> Help me please




 
Reply With Quote
 
 
 
 
=?Utf-8?B?VmFkaW0=?=
Guest
Posts: n/a
 
      01-13-2005
Hi, Juan!

Have you tried to do it yourself in Whidbey project ?

Including in my code like this

using System;
using System.IO;
using System.Data;
using System.Data.SqlClient;
using System.Xml;
using System.Xml.Xsl;
using Microsoft.ApplicationBlocks.Data;
using System.Reflection;

[assembly: AssemblyKeyFileAttribute(@"..\..\sn.snk")]

public partial class Log_aspx
{
.......

(key file lies in root of project folder)

I have an error:
"Error 1 S1548: Cryptographic failure while signing assembly
'c:\WINDOWS\Microsoft.NET\Framework\v2.0.40607\Tem porary ASP.NET
Files\stockexchangew\ae722549\e2e2fb71\virkegir.dl l' -- 'Error reading key
file '..\..\sn.snk' -- The system cannot find the file specified. "
"Error 2 Warning as Error: Use command line option '/keyfile' or appropriate
project settings instead of
'AssemblyKeyFileAttribute' F:\StockExchange\Log.aspx.cs 10 11

What should I do?

"Juan T. Llibre" wrote:

> Check out this link ( copy and paste it )
> in the Whidbey documentation:
>
> ms-help://MS.VSCC.v80/MS.MSDNQTR.v80.en/MS.MSDN.v80/MS.VisualStudio.v80.en/dv_fxadvance/html/2c30799a-a826-46b4-a25d-c584027a6c67.htm
>
> Essentially, there are two ways to sign an assembly with a strong name:
>
> 1. Using the Assembly Linker (Al.exe) provided by the .NET Framework SDK.
>
> 2. Using assembly attributes to insert the strong name information in your
> code.
>
> You can use either the AssemblyKeyFileAttribute
> or the AssemblyKeyNameAttribute, depending on
> where the key file to be used is located.
>
> You must have a cryptographic key pair
> to sign an assembly with a strong name.
>
> This public and private cryptographic key pair is used
> during compilation to create a strong-named assembly.
>
> You can create a key pair using the Strong Name tool (Sn.exe).
> Key pair files usually have an .snk extension.
>
> To get info about creating a cryptographic key pair, see :
>
> ms-help://MS.VSCC.v80/MS.MSDNQTR.v80.en/MS.MSDN.v80/MS.VisualStudio.v80.en/dv_fxadvance/html/05026813-f3bd-4d7c-9e0b-fc588eb3d114.htm
>
> in your Whidbey documentation
>
>
>
> Juan T. Llibre
> ASP.NET MVP
> ===========
> "Vadim" <> wrote in message
> news:9A17F649-8D93-431C-A4C6-...
> >I want to make strong name for may apllication assemblies, but I don't know
> > where and how can I do it in Whidbey.
> >
> > Help me please

>
>
>
>

 
Reply With Quote
 
Juan T. Llibre
Guest
Posts: n/a
 
      01-13-2005
Hi, Vadim.

re Error 1:
Check your .snk directory path.

Re Error 2:
You need to set the AssemblyKeyFile attribute:
[assembly: AssemblyKeyFile(".\\keyFile.snk")]

Additionally : Are you also setting the DelaySignAttribute ?
[assembly: AssemblyDelaySign(true)]
[assembly: AssemblyKeyFile(".\\keyFile.snk")]
or
[assembly: AssemblyDelaySign(false)]
[assembly: AssemblyKeyFile(".\\keyFile.snk")]

What I would recommend is that you
send this question to the C# newsgroup :
microsoft.public.dotnet.languages.csharp

You're far more likely to get specialized expert help there.




Juan T. Llibre
ASP.NET MVP
===========
"Vadim" <> wrote in message
news:F7DF0A5F-64DE-42D9-A652-...
> Hi, Juan!
>
> Have you tried to do it yourself in Whidbey project ?
>
> Including in my code like this
>
> using System;
> using System.IO;
> using System.Data;
> using System.Data.SqlClient;
> using System.Xml;
> using System.Xml.Xsl;
> using Microsoft.ApplicationBlocks.Data;
> using System.Reflection;
>
> [assembly: AssemblyKeyFileAttribute(@"..\..\sn.snk")]
>
> public partial class Log_aspx
> {
> ......
>
> (key file lies in root of project folder)
>
> I have an error:
> "Error 1 S1548: Cryptographic failure while signing assembly
> 'c:\WINDOWS\Microsoft.NET\Framework\v2.0.40607\Tem porary ASP.NET
> Files\stockexchangew\ae722549\e2e2fb71\virkegir.dl l' -- 'Error reading key
> file '..\..\sn.snk' -- The system cannot find the file specified. "
> "Error 2 Warning as Error: Use command line option '/keyfile' or
> appropriate
> project settings instead of
> 'AssemblyKeyFileAttribute' F:\StockExchange\Log.aspx.cs 10 11
>
> What should I do?
>
> "Juan T. Llibre" wrote:
>
>> Check out this link ( copy and paste it )
>> in the Whidbey documentation:
>>
>> ms-help://MS.VSCC.v80/MS.MSDNQTR.v80.en/MS.MSDN.v80/MS.VisualStudio.v80.en/dv_fxadvance/html/2c30799a-a826-46b4-a25d-c584027a6c67.htm
>>
>> Essentially, there are two ways to sign an assembly with a strong name:
>>
>> 1. Using the Assembly Linker (Al.exe) provided by the .NET Framework SDK.
>>
>> 2. Using assembly attributes to insert the strong name information in
>> your
>> code.
>>
>> You can use either the AssemblyKeyFileAttribute
>> or the AssemblyKeyNameAttribute, depending on
>> where the key file to be used is located.
>>
>> You must have a cryptographic key pair
>> to sign an assembly with a strong name.
>>
>> This public and private cryptographic key pair is used
>> during compilation to create a strong-named assembly.
>>
>> You can create a key pair using the Strong Name tool (Sn.exe).
>> Key pair files usually have an .snk extension.
>>
>> To get info about creating a cryptographic key pair, see :
>>
>> ms-help://MS.VSCC.v80/MS.MSDNQTR.v80.en/MS.MSDN.v80/MS.VisualStudio.v80.en/dv_fxadvance/html/05026813-f3bd-4d7c-9e0b-fc588eb3d114.htm
>>
>> in your Whidbey documentation
>>
>>
>>
>> Juan T. Llibre
>> ASP.NET MVP
>> ===========
>> "Vadim" <> wrote in message
>> news:9A17F649-8D93-431C-A4C6-...
>> >I want to make strong name for may apllication assemblies, but I don't
>> >know
>> > where and how can I do it in Whidbey.
>> >
>> > Help me please

>>
>>
>>
>>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Partial 1.0 - Partial classes for Python Thomas Heller Python 13 02-08-2007 08:12 PM
Re: Partial 1.0 - Partial classes for Python J. Clifford Dyer Python 0 02-08-2007 05:29 PM
Automatic sign-up and sign-in across different domains without cookies? Jimmy ASP .Net 1 11-21-2006 04:41 PM
Why? Partial Class within a Partial class Billy ASP .Net 2 02-01-2006 09:10 AM
J sign instead of ? sign Harold Potter esq. Computer Support 5 04-16-2005 02:19 PM



Advertisments