Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>The exception is being raised because you are passing <code>Resources.Maps</code> into StreamWriter. StreamWriter is handling this as a string and assuming it is file path for the stream. But the file path is empty so it is throwing an exception.</p> <p>To fix out the StreamWriter line you could specify a local temporary file instead of <code>Resources.Maps</code> or use <code>StringWriter</code> with the default constructor e.g. <code>new StringWriter()</code>.</p> <p>If you are writing .resx files then <code>ResXResourceWriter</code> is the class you need. It will also handle your stream writing too. See <a href="http://msdn.microsoft.com/en-us/library/system.resources.resxresourcewriter.aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/system.resources.resxresourcewriter.aspx</a> and <a href="http://msdn.microsoft.com/en-us/library/ekyft91f.aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/ekyft91f.aspx</a>. The second page has examples on how to use the class but breifly you would call something like this:</p> <pre><code>XmlSerializer serializer = new XmlSerializer(typeof(MapTiles)); using (StringWriter stringWriter = new StringWriter()) { serializer.Serialize(stringWriter, tempGroup); using (ResXResourceWriter resourceWriter = new ResXResourceWriter("~/App_GlobalResources/some_file.resx")) { resourceWriter.AddResource("Maps", stringWriter.ToString()); } } </code></pre> <p>If you want to write out an assembly that has a dynamically created resource in it the you can emit a new assembly. In that case have a look here <a href="http://msdn.microsoft.com/en-us/library/8ye65dh0.aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/8ye65dh0.aspx</a>.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload