Hi,<div><br></div><div>For every testcase which fails, could you create a bug report on <a href="http://bugzilla.xamarin.com">http://bugzilla.xamarin.com</a>, attach the testcase and assign it to "<a href="mailto:alan@xamarin.com">alan@xamarin.com</a>". I will look at them when I get a chance and fix the underlying issues where possible. If you could also attach the resulting 'out.zip' created from the microsoft framework, that would make it faster for me to ensure things are generated correctly.</div>
<div><br></div><div>Thanks!</div><div>Alan</div><div><br><div class="gmail_quote">On 9 February 2012 13:03, CikaPero1 <span dir="ltr"><<a href="mailto:cika.pero1@gmail.com">cika.pero1@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
Does anyone know why the code below throws an exception?<br>
<br>
The code below works with MS Visual Studio but simply won't work with Mono<br>
2.8.<br>
<br>
using System;<br>
using System.IO;<br>
using System.IO.Packaging;<br>
using System.Text;<br>
using System.Xml;<br>
<br>
namespace ConsoleApplication<br>
{<br>
    class Program<br>
    {<br>
        static void Main(string[] args)<br>
        {<br>
            using (Package Package = Package.Open("out.zip",<br>
FileMode.Create))<br>
            {<br>
                Uri partUri = new Uri("/_rels/.rels", UriKind.Relative);<br>
                PackagePart packagePart = Package.CreatePart(partUri,<br>
"application/vnd.openxmlformats-package.relationships+xml");<br>
<br>
                using (Stream str = packagePart.GetStream())<br>
                {<br>
                    using (var writer = new XmlTextWriter(str, new<br>
UTF8Encoding(false)))<br>
                    {<br>
                        writer.WriteStartDocument(true);<br>
                        writer.WriteStartElement("Relationships");<br>
                        writer.WriteAttributeString("xmlns",<br>
"<a href="http://schemas.openxmlformats.org/package/2006/relationships" target="_blank">http://schemas.openxmlformats.org/package/2006/relationships</a>");<br>
                        writer.WriteStartElement("Relationship");<br>
                        writer.WriteAttributeString("Type",<br>
"<a href="http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties" target="_blank">http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties</a>");<br>
                        writer.WriteEndElement();<br>
                        writer.WriteEndElement();<br>
                    }<br>
                }<br>
            }<br>
        }<br>
    }<br>
}<br>
<br>
Strangely, it works when I change some strings:<br>
a) "/_rels/.rels" -> "/rels/.rels"<br>
b) or "xmlns" -> "x"<br>
c) or "<a href="http://schemas.openxmlformats.org/package/2006/relationships" target="_blank">http://schemas.openxmlformats.org/package/2006/relationships</a>" -><br>
"<a href="http://schemas.openxmlformats.org/package/2007/relationships" target="_blank">http://schemas.openxmlformats.org/package/2007/relationships</a>"<br>
d) or "<a href="http://schemas.openxmlformats.org/package/2006/relationships" target="_blank">http://schemas.openxmlformats.org/package/2006/relationships</a>" -><br>
"<a href="http://schemas.openxmlformats.org/package/2007/relationships" target="_blank">http://schemas.openxmlformats.org/package/2007/relationships</a>" and<br>
"<a href="http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties" target="_blank">http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties</a>"<br>
-><br>
"<a href="http://schemas.openxmlformats.org/package/2007/relationships/metadata/core-properties" target="_blank">http://schemas.openxmlformats.org/package/2007/relationships/metadata/core-properties</a>"<br>
<br>
This will bring me to insanity!<br>
<br>
Thanks for any help,<br>
Cika Pero<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
View this message in context: <a href="http://mono.1490590.n4.nabble.com/System-IO-Packaging-throws-NullReferenceExeption-tp4372735p4372735.html" target="_blank">http://mono.1490590.n4.nabble.com/System-IO-Packaging-throws-NullReferenceExeption-tp4372735p4372735.html</a><br>

Sent from the Mono - Dev mailing list archive at Nabble.com.<br>
_______________________________________________<br>
Mono-devel-list mailing list<br>
<a href="mailto:Mono-devel-list@lists.ximian.com">Mono-devel-list@lists.ximian.com</a><br>
<a href="http://lists.ximian.com/mailman/listinfo/mono-devel-list" target="_blank">http://lists.ximian.com/mailman/listinfo/mono-devel-list</a><br>
</font></span></blockquote></div><br></div>