Closed WenningQiu closed 7 months ago
When using ILRepack, do we need to list all assemblies at all reference levels that need to be repacked? or do we just list the top-level dependencies and ILRepack will automatically include the indirectly referenced ones? I think the answer might be the former based on my experience, and that can easily result in some assemblies being missed during repacking.
@deniszykov Thanks for the information. Perhaps some libraries are not friendly with ILRepack (case 1 or case 2 might exist somewhere).
I’d debug the app with first-chance exceptions enabled, I’m sure there’s an exception you’re not seeing. You can also subscribe to AppDomain.CurrentDomain.FirstChanceException and log them all
I have time to get back to this after wrapping up other issues.
@KirillOsenkov, I tried what you suggested but no FCE was caught.
Can you reduce the list of repacked dlls one by one until the bug stops reproducing? This way we can narrow it down to which dll causes the issue.
@KirillOsenkov, The error stops after I remove all DLLs and leave only the EXE.
but can you add one .dll at a time and see which dll makes the error return?
The one that makes the error return is my DLL (the one in red box below) which I have complete source code. I guess repacking somehow causes data compression to fail, which results in a bad request.
The root cause of 400 Bad Request is that the request message gets compressed twice due to GZipEncodingBehavior being added twice to the endpoint. I need to adjust the application code and configuration file as the full type name of GZipEncodingBehavior is changed after repacking.
Thanks for figuring this out! We do have some command-line options to strip attributes etc.
I have a WCF client application that I run ILRepack on to eliminate its dependency assemblies. The ILpacked program works fine on all endpoints except for it gets 400 (Bad Request) response on gzipped endpoints (ones that use GZip encoding).
Below are the messages of working (without ILRepack) and failure (with ILRepack) cases. The only difference I can tell is the content-length header and the message body.
I guess the root cause is some dependency assemblies are missed in the ILRepacked program, but honestly in this case it is not clear to me what missing assembly could cause the observed behavior.
When using ILRepack, do we need to list all assemblies at all reference levels that need to be repacked? or do we just list the top-level dependencies and ILRepack will automatically include the indirectly referenced ones? I think the answer might be the former based on my experience, and that can easily result in some assemblies being missed during repacking.
BTW, below is the dependency assemblies of my application: