Proper filter recording settings for .Net protocol v 11.52



I am trying to record a .net (4.0) client-server application with VuGen and encountering an issue.  The following appears in my script: 


#warning:  Code Generation Error
// Found an undefined object of type System.IO.StreamReader. Assigning it the name reader_1.
// Suggested solution: adding both this type, in assembly mscorlib, Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089, to the filter 
// and/or any other types that return instances of this one.
// Note:  This script will not compile as is.


If I tried to create a custom filter and add the reference to System.IO in the filtering dialog, but it gives me an error. (attached)


I've tried reading through the best practices doc, located here: NET_Protocol_Filter_BestPractices


Any suggestions on how to resolve the needed reference??






  • Hello! It's true, referencing and manipulating mscorlib content is prohibited via filter manager, because any change related to this very basic dll can cause unpredicted crash, hang or anything else.


    I can recommend few things here:


    1. Find where is this StreamReader instance is used later in the script. If you see that the further usage of this instance is required - then you will want to find how is this instance created. For example, it's created and returned by some method, then you will include this method in the filter. If it's impossible to find the origins of this instance, then

    2. You can manually change the filter file (in XML editor) to capture StreamReader object construction and configuring, but this can cause a HUGE increase of the script size with unnecessary calls to the tonns of unrelated StreamReaders used in other parts of application.

    3. The best case - if you see that using this reader instance is not necessary - simply exclude the method from filter. I mean the method that accepts this StreamReader as a parameter.