Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Security / November 2004

Tip: Looking for answers? Try searching our database.

Adding key makes solution compile very slow

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Mark - 22 Nov 2004 19:13 GMT
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
Robert Hurlbut - 22 Nov 2004 19:24 GMT
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

> Hello,
> I am adding a strong name to my assemblies in order to work with
[quoted text clipped - 9 lines]
> Thanks,
> Mark
Mark - 22 Nov 2004 20:01 GMT
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

-----

> 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
[quoted text clipped - 20 lines]
> > Thanks,
> > Mark
Robert Hurlbut - 22 Nov 2004 21:07 GMT
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/s
trongNames.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

>I add the keys, and just click "Build" in VS.Net 2003.
>
[quoted text clipped - 39 lines]
>> > Thanks,
>> > Mark
Mark - 23 Nov 2004 04:47 GMT
> How did you add the key to the solution? The best way is to reference the
key in each project's AssemblyInfo file.

This is what I did.

>Could you give a little more information about your changes to try to
pinpoint the differences in compile times?

I'm not sure what else I can say - the only difference was that I added the
strong name key.

Thanks for the article reference. I think it's best for me to read that,
maybe there's something else I am unaware of.

Thanks!
Mark

> Just adding the key shouldn't increase the time, as far as I can tell, by
> that much.
[quoted text clipped - 66 lines]
> >> > Thanks,
> >> > Mark
Nicole Calinoiu - 25 Nov 2004 18:24 GMT
Is your key being used from a key container, a local file, or a file
residing elsewhere on a network?  How deep do your inter-project references
run?  What is the maximum number of other assemblies referenced by any given
project?

>> How did you add the key to the solution? The best way is to reference the
> key in each project's AssemblyInfo file.
[quoted text clipped - 91 lines]
>> >> > Thanks,
>> >> > Mark

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.