Re: Auto-updating GAC; loading from GAC vs. server
- From: NormD <mach2@xxxxxxxxxxxxxxxx>
- Date: Fri, 8 Dec 2006 11:38:02 -0800
Ok, Walter! I'm impressed. Thank you very much for all your efforts! I will
pass this on to someone who knows a lot more about what they're doing to test.
Re the two comments you made at the end, I'm assuming the assembly (form
dll) is in the GAC because it was a few minutes previous as part of the first
uses. But we can test between sessions with gacutil, as you suggest (we use
this utility for several things so it is something I DO know something about!)
Re time difference between the client and server, how far apart are we
talking about? I mean, they can't be IDENTICAL to the ms or even second, but
we do use a time server to update/synch time several times a day. And
between tests a few minutes apart, how much can the clocks drift? Does it
matter which is ahead of the other, client or server, and how much difference
matters? It would be east to set the client time + or - re the server time
if needed for a test.
Thanks for your help!
NormD
"Walter Wang [MSFT]" wrote:
Hi,.
I've done some test:
1) Using Visual Studio 2003, create a simple class library named
ClassLibrary1, create a strong name for it. Upload it on my Win2003 server
as http://chnwawang01/assemblies/ClassLibrary1.dll
2) Create a winform application named WindowsApplication1, in its
app.config:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity
name="ClassLibrary1"
publickKeyToken="a262c3f18cefb654"
></assemblyIdentity>
<codeBase version="1.0.0.0"
href="http://chnwawang01/assemblies/ClassLibrary1.dll" ></codeBase>
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
3) In WindowsApplication1, use following code to load the class library:
private void button1_Click(object sender, System.EventArgs e)
{
Assembly a = Assembly.Load("ClassLibrary1");
}
4) Start Fiddler (http://www.fiddlertool.com/fiddler/), run the
WindowsApplication1, the first pair of http request and response headers
are:
=============
GET /assemblies/ClassLibrary1.dll HTTP/1.0
Accept: */*
UA-CPU: x86
Cookie:
.ASPXANONYMOUS=ROSd0kA_xwEkAAAANzMyZGE5ZTktODcyZC00NmY1LWIzMmEtZjZhODg3NGFlO
TM4WJ6Y2L4p0-zZDDq4P_jtFvjaWmI1
User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.2; .NET CLR
1.1.4322; .NET CLR 2.0.50727; InfoPath.1)
Host: chnwawang01
Proxy-Connection: Keep-Alive
HTTP/1.1 200 OK
Content-Length: 16384
Content-Type: application/x-msdownload
Last-Modified: Fri, 08 Dec 2006 05:59:59 GMT
Accept-Ranges: bytes
ETag: "3d4148188e1ac71:995"
Server: Microsoft-IIS/6.0
MicrosoftOfficeWebServer: 5.0_Pub
X-Powered-By: ASP.NET
Date: Fri, 08 Dec 2006 06:30:53 GMT
Connection: close
=============
5) Keep the application running, click the button several more times, you
will notice no new http request is issued.
6) Shutdown the application, start it again; click the button, you will
notice following pair of http request and response headers in Fiddler:
=============
GET /assemblies/ClassLibrary1.dll HTTP/1.0
Accept: */*
UA-CPU: x86
Cookie:
.ASPXANONYMOUS=ROSd0kA_xwEkAAAANzMyZGE5ZTktODcyZC00NmY1LWIzMmEtZjZhODg3NGFlO
TM4WJ6Y2L4p0-zZDDq4P_jtFvjaWmI1
If-Modified-Since: Fri, 08 Dec 2006 05:59:59 GMT
If-None-Match: "3d4148188e1ac71:995"
User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.2; .NET CLR
1.1.4322; .NET CLR 2.0.50727; InfoPath.1)
Host: chnwawang01
Proxy-Connection: Keep-Alive
HTTP/1.1 304 Not Modified
Last-Modified: Fri, 08 Dec 2006 05:59:59 GMT
Accept-Ranges: bytes
ETag: "3d4148188e1ac71:995"
Server: Microsoft-IIS/6.0
MicrosoftOfficeWebServer: 5.0_Pub
X-Powered-By: ASP.NET
Date: Fri, 08 Dec 2006 06:31:25 GMT
Connection: close
=============
You will notice that the request headers contain:
If-Modified-Since: Fri, 08 Dec 2006 05:59:59 GMT
If-None-Match: "3d4148188e1ac71:995"
It's called conditional-GET in HTTP protocol, which means, only get the
resource (the document with specified etag) if it's modified after the
specified date.
In my test, since the assembly on the server is not updated, server simply
returns status code 304 Not Modified, and the entity body is empty.
There's two possibilities that might cause the application re-download the
assembly upon application startup:
1) The assembly doesn't exist in download cache; you could use gacutil.exe
/ldl to verify it.
2) The date time on client and the web server doesn't match, which might
cause the server think the resource is modified and transmits it again.
Would you please use Fiddler on your side to test your application and post
the headers here? Also, if necessary, please use a simple test application
to verify if it works correctly.
Regards,
Walter Wang (wawang@xxxxxxxxxxxxxxxxxxxx, remove 'online.')
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
- Follow-Ups:
- Re: Auto-updating GAC; loading from GAC vs. server
- From: Walter Wang [MSFT]
- Re: Auto-updating GAC; loading from GAC vs. server
- References:
- Re: Auto-updating GAC; loading from GAC vs. server
- From: Gabriel Lozano-Morán
- Re: Auto-updating GAC; loading from GAC vs. server
- From: Gabriel Lozano-Morán
- Re: Auto-updating GAC; loading from GAC vs. server
- From: NormD
- Re: Auto-updating GAC; loading from GAC vs. server
- From: Walter Wang [MSFT]
- Re: Auto-updating GAC; loading from GAC vs. server
- From: NormD
- Re: Auto-updating GAC; loading from GAC vs. server
- From: Walter Wang [MSFT]
- Re: Auto-updating GAC; loading from GAC vs. server
- Prev by Date: Re: Reflection to detemine collection or implement of IEnumerable
- Next by Date: Debugging .net libraries in both the GAC and local folder
- Previous by thread: Re: Auto-updating GAC; loading from GAC vs. server
- Next by thread: Re: Auto-updating GAC; loading from GAC vs. server
- Index(es):