Many thanks for the replies.
I've attached the exception-stack (ExceptionStack.txt) from when the
problem occurs.
It's just constructing the XmlSerializer, with the provided type:
... = new XmlSerializer(typeof(SpreadsheetPrintSettings));
I've attached the class for the Type SpreadsheetPrintSettings. As you
can see, it's fairly simple. The class isn't neat (I didn't write it).
:-)
So, it hasn't even got to parsing, it's just building the initial DLL.
IMPORTANT:
1. We only see this problem when running our application from
zero-deploy (ie. IEExec.exe).
2. It's random. Sometimes the call works, sometimes it doesn't.
Unfortunately, at the moment, I can't repeat it in any consistent way
that I can attempt to debug. The same user can start the binary once,
and it works. That same user then starts the same binary again (from
the same hosting URL), and it can fail.
ANALYSIS:
We're convinced the bug is something to do with zero-deploy. I need to
know, when does XmlSerializer decide to build the .DLL? Is it always
done on-the-fly, or, only the first time? If it detects that the
underlying binaries haven't changed, does it just reuse the previous DLL
it built? If it detects/re-uses previously built DLLs, we suspect there
is a corruption that can happen (which is what we're seeing).
If it doesn't use the previously built DLLs, I'm stumped.
Sean
Kevin Yu [MSFT] wrote:
Hi Sean,
First of all, I would like to confirm my understanding of your issue. From
your description, I understand that you're receiving a FileNotFound
exception when doing XmlSerialization. If there is any misunderstanding,
please feel free to let me know.
I think it's very hard to say if it is a bug before reproducing it. I
haven't run into this before. So could you please post some of your code
here. And do you know which line of code throws the exception? I would be
glad to look into it if I can get a repro. Thanks for your cooperation!
Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."
Top Level Exception:
System.TypeInitializationException: The type initializer for "Summit.Framework.View.SprPrintSettingsSeriali zer" threw an exception. ---> System.IO.FileNotFoundException: File or assembly name qxm483sa.dll, or one of its dependencies, was not found.
File name: "qxm483sa.dll"
at System.Reflection.Assembly.nLoad(AssemblyName fileName, String codeBase, Boolean isStringized, Evidence assemblySecurity, Boolean throwOnFileNotFound, Assembly locationHint, StackCrawlMark& stackMark)
at System.Reflection.Assembly.InternalLoad(AssemblyNa me assemblyRef, Boolean stringized, Evidence assemblySecurity, StackCrawlMark& stackMark)
at System.Reflection.Assembly.Load(AssemblyName assemblyRef, Evidence assemblySecurity)
at System.CodeDom.Compiler.CompilerResults.get_Compil edAssembly()
at System.CodeDom.Compiler.CompilerResults.get_Compil edAssembly()
at System.Xml.Serialization.Compiler.Compile()
at System.Xml.Serialization.TempAssembly..ctor(XmlMap ping[] xmlMappings)
at System.Xml.Serialization.XmlSerializer..ctor(Type type, String defaultNamespace)
at System.Xml.Serialization.XmlSerializer..ctor(Type type)
at Summit.Framework.View.SprPrintSettingsSerializer.. ctor()
at Summit.Framework.View.SprPrintSettingsSerializer.. cctor()
/// <summary>
/// A class to store the page settings to be used for printing.
/// </summary>
public class SpreadsheetPrintSettings
{
/// <summary>
/// constructor
/// </summary>
public SpreadsheetPrintSettings() {}
private Orientation _pageOrientation;
/// <summary>
/// Landscape or Portrait
/// </summary>
public Orientation PageOrientation
{
get { return _pageOrientation; }
set {_pageOrientation = value; }
}
private bool _scaling;
/// <summary>
/// Indicate if the spreadsheet should be reduced to fit in page(s).
/// </summary>
public bool Scaling
{
get { return _scaling; }
set { _scaling = value; }
}
private int _fitToPage;
/// <summary>
/// If spreadsheet should be reduced to fit in page(s), then how many page(s)?
/// </summary>
public int FitToPage
{
get { return _fitToPage; }
set { _fitToPage = value; }
}
private decimal _topMargin;
/// <summary>
/// Top margin
/// </summary>
public decimal TopMargin
{
get { return _topMargin; }
set { _topMargin = value; }
}
private decimal _bottomMargin;
/// <summary>
/// Bottom margin
/// </summary>
public decimal BottomMargin
{
get { return _bottomMargin; }
set { _bottomMargin = value; }
}
private decimal _leftMargin;
/// <summary>
/// Left margin
/// </summary>
public decimal LeftMargin
{
get { return _leftMargin; }
set { _leftMargin = value; }
}
private decimal _rightMargin;
/// <summary>
/// Right margin
/// </summary>
public decimal RightMargin
{
get { return _rightMargin; }
set { _rightMargin = value; }
}
private string _headerText;
/// <summary>
/// Header
/// </summary>
public string HeaderText
{
get { return _headerText; }
set { _headerText = value; }
}
private bool _headerAutoMargin;
/// <summary>
/// Indicate if the spreadsheet should calculate the amount of space
/// to be used for the header
/// </summary>
public bool HeaderAutoMargin
{
get { return _headerAutoMargin; }
set { _headerAutoMargin = value; }
}
private decimal _headerMargin;
/// <summary>
/// If spreadsheet should not calculate the amount of space for
/// the header, this is to set how much.
/// </summary>
public decimal HeaderMargin
{
get { return _headerMargin; }
set { _headerMargin = value; }
}
private string _headerAlignment;
/// <summary>
/// Alignment of the header
/// </summary>
public string HeaderAlignment
{
get { return _headerAlignment; }
set { _headerAlignment = value; }
}
private FontData _headerFont = new FontData();
/// <summary>
/// Font of the header
/// </summary>
public FontData HeaderFont
{
get { return _headerFont; }
set { _headerFont = value; }
}
private string _footerText;
/// <summary>
/// Footer
/// </summary>
public string FooterText
{
get { return _footerText; }
set { _footerText = value; }
}
private bool _footerAutoMargin;
/// <summary>
/// Indicate if the spreadsheet should calculate the amount of space
/// to be used for the footer.
/// </summary>
public bool FooterAutoMargin
{
get { return _footerAutoMargin; }
set { _footerAutoMargin = value; }
}
private decimal _footerMargin;
/// <summary>
/// If spreadsheet should not calculate the amount of space for
/// the footer, this is to set how much.
/// </summary>
public decimal FooterMargin
{
get { return _footerMargin; }
set { _footerMargin = value; }
}
private string _footerAlignment;
/// <summary>
/// Alignment of the footer
/// </summary>
public string FooterAlignment
{
get { return _footerAlignment; }
set { _footerAlignment = value; }
}
private FontData _footerFont = new FontData();
/// <summary>
/// Font of the footer
/// </summary>
public FontData FooterFont
{
get { return _footerFont; }
set { _footerFont = value;
}
}
}