D
D
Dmitry2015-08-29 01:08:55
Mono
Dmitry, 2015-08-29 01:08:55

How to fix error in WindowsBase dll of Mono framework on Mac?

Wrote a small program for processing xlsx tables, swears when executed

Unhandled Exception:
System.IO.IOException: Operation not valid when package is read-only
  at System.IO.Packaging.Package.CheckIsReadOnly () [0x0000c] in /private/tmp/source-mono-mac-4.0.0-branch-c5sr4/bockbuild-mono-4.0.0-branch/profiles/mono-mac-xamarin/build-root/mono-4.0.4/mcs/class/WindowsBase/System.IO.Packaging/Package.cs:113 
  at System.IO.Packaging.PackagePart.CreateRelationship (System.Uri targetUri, TargetMode targetMode, System.String relationshipType, System.String id, Boolean loading) [0x00000] in /private/tmp/source-mono-mac-4.0.0-branch-c5sr4/bockbuild-mono-4.0.0-branch/profiles/mono-mac-xamarin/build-root/mono-4.0.4/mcs/class/WindowsBase/System.IO.Packaging/PackagePart.cs:128 
  at System.IO.Packaging.PackagePart.LoadRelationships (System.Collections.Generic.Dictionary`2 relationships, System.IO.Stream stream) [0x0008f] in /private/tmp/source-mono-mac-4.0.0-branch-c5sr4/bockbuild-mono-4.0.0-branch/profiles/mono-mac-xamarin/build-root/mono-4.0.4/mcs/class/WindowsBase/System.IO.Packaging/PackagePart.cs:168 
  at System.IO.Packaging.PackagePart.get_Relationships () [0x00048] in /private/tmp/source-mono-mac-4.0.0-branch-c5sr4/bockbuild-mono-4.0.0-branch/profiles/mono-mac-xamarin/build-root/mono-4.0.4/mcs/class/WindowsBase/System.IO.Packaging/PackagePart.cs:50 
  at System.IO.Packaging.PackagePart.GetRelationships () [0x00016] in /private/tmp/source-mono-mac-4.0.0-branch-c5sr4/bockbuild-mono-4.0.0-branch/profiles/mono-mac-xamarin/build-root/mono-4.0.4/mcs/class/WindowsBase/System.IO.Packaging/PackagePart.cs:192 
  at DocumentFormat.OpenXml.Packaging.PackagePartRelationshipPropertyCollection..ctor (System.IO.Packaging.PackagePart packagePart) [0x00000] in <filename unknown>:0 
  at DocumentFormat.OpenXml.Packaging.OpenXmlPart.Load (DocumentFormat.OpenXml.Packaging.OpenXmlPackage openXmlPackage, DocumentFormat.OpenXml.Packaging.OpenXmlPart parent, System.Uri uriTarget, System.String id, System.Collections.Generic.Dictionary`2 loadedParts) [0x00000] in <filename unknown>:0 
  at DocumentFormat.OpenXml.Packaging.OpenXmlPartContainer.LoadReferencedPartsAndRelationships (DocumentFormat.OpenXml.Packaging.OpenXmlPackage openXmlPackage, DocumentFormat.OpenXml.Packaging.OpenXmlPart sourcePart, DocumentFormat.OpenXml.Packaging.RelationshipCollection relationshipCollection, System.Collections.Generic.Dictionary`2 loadedParts) [0x00000] in <filename unknown>:0 
  at DocumentFormat.OpenXml.Packaging.OpenXmlPackage.Load () [0x00000] in <filename unknown>:0 
[ERROR] FATAL UNHANDLED EXCEPTION: System.IO.IOException: Operation not valid when package is read-only
  at System.IO.Packaging.Package.CheckIsReadOnly () [0x0000c] in /private/tmp/source-mono-mac-4.0.0-branch-c5sr4/bockbuild-mono-4.0.0-branch/profiles/mono-mac-xamarin/build-root/mono-4.0.4/mcs/class/WindowsBase/System.IO.Packaging/Package.cs:113 
  at System.IO.Packaging.PackagePart.CreateRelationship (System.Uri targetUri, TargetMode targetMode, System.String relationshipType, System.String id, Boolean loading) [0x00000] in /private/tmp/source-mono-mac-4.0.0-branch-c5sr4/bockbuild-mono-4.0.0-branch/profiles/mono-mac-xamarin/build-root/mono-4.0.4/mcs/class/WindowsBase/System.IO.Packaging/PackagePart.cs:128 
  at System.IO.Packaging.PackagePart.LoadRelationships (System.Collections.Generic.Dictionary`2 relationships, System.IO.Stream stream) [0x0008f] in /private/tmp/source-mono-mac-4.0.0-branch-c5sr4/bockbuild-mono-4.0.0-branch/profiles/mono-mac-xamarin/build-root/mono-4.0.4/mcs/class/WindowsBase/System.IO.Packaging/PackagePart.cs:168 
  at System.IO.Packaging.PackagePart.get_Relationships () [0x00048] in /private/tmp/source-mono-mac-4.0.0-branch-c5sr4/bockbuild-mono-4.0.0-branch/profiles/mono-mac-xamarin/build-root/mono-4.0.4/mcs/class/WindowsBase/System.IO.Packaging/PackagePart.cs:50 
  at System.IO.Packaging.PackagePart.GetRelationships () [0x00016] in /private/tmp/source-mono-mac-4.0.0-branch-c5sr4/bockbuild-mono-4.0.0-branch/profiles/mono-mac-xamarin/build-root/mono-4.0.4/mcs/class/WindowsBase/System.IO.Packaging/PackagePart.cs:192 
  at DocumentFormat.OpenXml.Packaging.PackagePartRelationshipPropertyCollection..ctor (System.IO.Packaging.PackagePart packagePart) [0x00000] in <filename unknown>:0 
  at DocumentFormat.OpenXml.Packaging.OpenXmlPart.Load (DocumentFormat.OpenXml.Packaging.OpenXmlPackage openXmlPackage, DocumentFormat.OpenXml.Packaging.OpenXmlPart parent, System.Uri uriTarget, System.String id, System.Collections.Generic.Dictionary`2 loadedParts) [0x00000] in <filename unknown>:0 
  at DocumentFormat.OpenXml.Packaging.OpenXmlPartContainer.LoadReferencedPartsAndRelationships (DocumentFormat.OpenXml.Packaging.OpenXmlPackage openXmlPackage, DocumentFormat.OpenXml.Packaging.OpenXmlPart sourcePart, DocumentFormat.OpenXml.Packaging.RelationshipCollection relationshipCollection, System.Collections.Generic.Dictionary`2 loadedParts) [0x00000] in <filename unknown>:0 
  at DocumentFormat.OpenXml.Packaging.OpenXmlPackage.Load () [0x00000] in <filename unknown>:0 

Press any key to continue...

Judging by this topic , the problem lies in the WindowsBase dll, which I fixed with this commit .
Now the question is: how can I fix the same error in myself? I didn’t find a suitable dll-library editor for the poppy, and when I try to put together a dll from the archive downloaded from the git , where the error has already been fixed, the compiler gives a bunch of errors and doesn’t even want to build.
Help, I spent 2 days on this.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
magazovski, 2015-08-29
@17th

# установим утилиты нужные для сборки c помощью Homebrew http://brew.sh
brew install autoconf automake libtool pkg-config
# склонируем гит репозиторий
mkdir ~/mono && cd ~/mono
git clone https://github.com/mono/mono.git .
# конфигурируем
export PREFIX=/usr/local
./autogen.sh --prefix=$PREFIX --disable-nls
# скачаем последний релиз моно - он нужен чтобы самого себя собрать, на мой взгляд - бред 
make get-monolite-latest
# компиляем
make
# устанавливаем
make install

Profit1111

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question