<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://www.infopathdev.com:443/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Browser Forms</title><link>https://www.infopathdev.com:443/forums/40.aspx</link><description>For browser form specific questions</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Re: Log4Net in Infopath form code...</title><link>https://www.infopathdev.com:443/forums/thread/49085.aspx</link><pubDate>Sun, 15 Nov 2009 14:58:24 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:49085</guid><dc:creator>Karsten Brocksieper</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/49085.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=40&amp;PostID=49085</wfw:commentRss><description>&lt;p&gt;Hi Patrick,&lt;/p&gt;
&lt;p&gt;... to tell the truth --- I don´t understand what you mean. In my experience it is not allowed to declare a member variable in the form code regardless of &amp;#39;private&amp;#39; or &amp;#39;public&amp;#39;. If you declare such a variable for example:&lt;/p&gt;
&lt;p&gt;&lt;font face="courier new,courier"&gt;private (or public)&amp;nbsp;Log4Net log4net;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;you can´t upload the form in the &amp;#39;Central administration&amp;#39; in SharePoint cause SharePoint shows an error message while you want upload such a form...&lt;/p&gt;
&lt;p&gt;In the meantime I have found the reason why you can´t store the &amp;#39;Log4Net&amp;#39; object in FormState. It´s because the &amp;#39;Log4Net&amp;#39; object is not serializable and as FormState implements IDictionary --- it is essential that every variable which you want to store in FormState must be serializable...&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;</description></item><item><title>Re: Log4Net in Infopath form code...</title><link>https://www.infopathdev.com:443/forums/thread/49070.aspx</link><pubDate>Sun, 15 Nov 2009 11:46:22 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:49070</guid><dc:creator>Patrick Halstead</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/49070.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=40&amp;PostID=49070</wfw:commentRss><description>&lt;p&gt;Why are you adding it to the FormState? That&amp;#39;s what is causing the error. Can you declare a variable in your code and add it to that instead? Something public should work. Not sure why private won&amp;#39;t work (please explain where you read that).&lt;/p&gt;</description></item><item><title>Log4Net in Infopath form code...</title><link>https://www.infopathdev.com:443/forums/thread/49066.aspx</link><pubDate>Sat, 14 Nov 2009 14:42:57 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:49066</guid><dc:creator>Karsten Brocksieper</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/49066.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=40&amp;PostID=49066</wfw:commentRss><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;I would like to use the free logging component &amp;quot;Log4Net&amp;quot; (&lt;a title="http://logging.apache.org/log4net/index.html" href="http://logging.apache.org/log4net/index.html"&gt;http://logging.apache.org/log4net/index.html&lt;/a&gt;) in my own web enabled forms. As I know that I can´t use private member variables in my code I would like to initialize the Log4Net object with a formstate variable.&lt;/p&gt;
&lt;p&gt;But unfortunately if I used the following code:&lt;/p&gt;&lt;font size="2"&gt;
&lt;p&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;private&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;Log4Net&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; log4Net{&lt;br /&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;&amp;nbsp; get&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; {&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;return&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; (&lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;Log4Net&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;)FormState[&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;log4Net&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;];}&lt;br /&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;&amp;nbsp; set&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; {FormState[&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;log4Net&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;] = &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;value&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;;}&lt;br /&gt;}&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;... and in the &amp;quot;&lt;strong&gt;FormEvents_Loading&lt;/strong&gt;&amp;quot;&lt;/font&gt;&lt;/p&gt;&lt;font size="2"&gt;&lt;font size="2"&gt;
&lt;p&gt;FormState.Add(&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;log4Net&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;,&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;new&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;Log4Net&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;());&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;I get a &amp;quot;System.Runtime.Serialization.SerializationException&amp;quot;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;Can anyone help me with the correct initializing of the log4Net variable...&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;Thank you very much.&lt;/p&gt;&lt;/font&gt;&lt;/font&gt;</description></item></channel></rss>