By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,996 Members | 884 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,996 IT Pros & Developers. It's quick & easy.

Is there a way to sign partial classes in Whidbey?

P: n/a
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
Nov 19 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
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" <Va***@discussions.microsoft.com> wrote in message
news:9A**********************************@microsof t.com...
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


Nov 19 '05 #2

P: n/a
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" <Va***@discussions.microsoft.com> wrote in message
news:9A**********************************@microsof t.com...
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


Nov 19 '05 #3

P: n/a
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" <Va***@discussions.microsoft.com> wrote in message
news:F7**********************************@microsof t.com...
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" <Va***@discussions.microsoft.com> wrote in message
news:9A**********************************@microsof t.com...
>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


Nov 19 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.