Re: Adding key makes solution compile very slow
From: Robert Hurlbut (robert_at_nospam.securedevelop.net)
Date: 11/22/04
- Next message: Erick Daniel Tinajero: "Using private keys to sign hash"
- Previous message: Joe Kaplan \(MVP - ADSI\): "Re: security exception for aspx page"
- In reply to: Mark: "Re: Adding key makes solution compile very slow"
- Next in thread: Mark: "Re: Adding key makes solution compile very slow"
- Reply: Mark: "Re: Adding key makes solution compile very slow"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Date: Mon, 22 Nov 2004 16:07:42 -0500
Just adding the key shouldn't increase the time, as far as I can tell, by
that much.
How did you add the key to the solution? The best way is to reference the
key in each project's AssemblyInfo file.
(This assumes the location of the key is in the folder directly above the
project file)
For C#:
[assembly: AssemblyKeyFile(@"..\..\..\WhateverName.snk")]
For VB:
<Assembly: AssemblyKeyFile("..\..\..\WhateverName.snk")>
I have never seen a marked difference in compile times using this method.
Ideally, you want to use something like delay signing instead of using the
private/public key directly, though. For more information, check out this
article:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnnetsec/html/strongNames.asp.
Could you give a little more information about your changes to try to
pinpoint the differences in compile times?
Robert Hurlbut
http://www.securedevelop.net
http://weblogs.asp.net/rhurlbut
"Mark" <Mark@discussions.microsoft.com> wrote in message
news:95900129-85A0-4805-9AFF-C03C537E9787@microsoft.com...
>I add the keys, and just click "Build" in VS.Net 2003.
>
> I'm not using any build scripts yet; I'm not using any pre or post build
> events (at least none that I'm aware of given that I'm only using VS.Net's
> build); I'm not registering anything new with the GAC.
>
> I simply add a single key for the solution, have all 10 projects reference
> that key, and now the Rebuilds in VS go from 15 seconds to 3 minutes.
>
> Thanks for any insight,
> Mark
>
> -----
>
> "Robert Hurlbut" wrote:
>
>> I am assuming that you mean you are now using pre- and post-build events
>> to
>> unregister and remove the components from the GAC and add them back to
>> the
>> GAC and reregister? If you are doing that, unfortunately, there is no way
>> around the timing issues as it does take time for each component to go
>> through those steps. Can you give a little more information about the
>> steps
>> you are taking?
>>
>> Robert Hurlbut
>> http://www.securedevelop.net
>> http://weblogs.asp.net/rhurlbut
>>
>> "Mark" <Mark@discussions.microsoft.com> wrote in message
>> news:81F6C5EF-B09D-48E9-ABE0-06F7E235ABB3@microsoft.com...
>> > Hello,
>> > I am adding a strong name to my assemblies in order to work with
>> > Enterprise
>> > Services' Transactions.
>> > When I add the strong name (with sn.exe -k), my compile time for a
>> > Rebuild
>> > goes from 15 seconds to 3 minutes. This is for 1 solution with 11
>> > projects.
>> >
>> > Does anyone know if this is normal, or if there's an option to make it
>> > go
>> > quicker?
>> >
>> > Thanks,
>> > Mark
>>
>>
>>
- Next message: Erick Daniel Tinajero: "Using private keys to sign hash"
- Previous message: Joe Kaplan \(MVP - ADSI\): "Re: security exception for aspx page"
- In reply to: Mark: "Re: Adding key makes solution compile very slow"
- Next in thread: Mark: "Re: Adding key makes solution compile very slow"
- Reply: Mark: "Re: Adding key makes solution compile very slow"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]