Hi,

For every testcase which fails, could you create a bug report on
http://bugzilla.xamarin.com, attach the testcase and assign it to "
a...@xamarin.com". 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.

Thanks!
Alan

On 9 February 2012 13:03, CikaPero1 <cika.pe...@gmail.com> wrote:

> Hi,
>
> Does anyone know why the code below throws an exception?
>
> The code below works with MS Visual Studio but simply won't work with Mono
> 2.8.
>
> using System;
> using System.IO;
> using System.IO.Packaging;
> using System.Text;
> using System.Xml;
>
> namespace ConsoleApplication
> {
>    class Program
>    {
>        static void Main(string[] args)
>        {
>            using (Package Package = Package.Open("out.zip",
> FileMode.Create))
>            {
>                Uri partUri = new Uri("/_rels/.rels", UriKind.Relative);
>                PackagePart packagePart = Package.CreatePart(partUri,
> "application/vnd.openxmlformats-package.relationships+xml");
>
>                using (Stream str = packagePart.GetStream())
>                {
>                    using (var writer = new XmlTextWriter(str, new
> UTF8Encoding(false)))
>                    {
>                        writer.WriteStartDocument(true);
>                        writer.WriteStartElement("Relationships");
>                        writer.WriteAttributeString("xmlns",
> "http://schemas.openxmlformats.org/package/2006/relationships";);
>                        writer.WriteStartElement("Relationship");
>                        writer.WriteAttributeString("Type",
> "
> http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties
> ");
>                        writer.WriteEndElement();
>                        writer.WriteEndElement();
>                    }
>                }
>            }
>        }
>    }
> }
>
> Strangely, it works when I change some strings:
> a) "/_rels/.rels" -> "/rels/.rels"
> b) or "xmlns" -> "x"
> c) or "http://schemas.openxmlformats.org/package/2006/relationships"; ->
> "http://schemas.openxmlformats.org/package/2007/relationships";
> d) or "http://schemas.openxmlformats.org/package/2006/relationships"; ->
> "http://schemas.openxmlformats.org/package/2007/relationships"; and
> "
> http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties
> "
> ->
> "
> http://schemas.openxmlformats.org/package/2007/relationships/metadata/core-properties
> "
>
> This will bring me to insanity!
>
> Thanks for any help,
> Cika Pero
>
> --
> View this message in context:
> http://mono.1490590.n4.nabble.com/System-IO-Packaging-throws-NullReferenceExeption-tp4372735p4372735.html
> Sent from the Mono - Dev mailing list archive at Nabble.com.
> _______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list@lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list
>
_______________________________________________
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list

Reply via email to