AWS-EC2 [SOLVED]: System.IO.FileNotFoundException: Could not load file or assembly System.Xml.Linq

AWS-EC2 [SOLVED]: System.IO.FileNotFoundException: Could not load file or assembly System.Xml.Linq

Home Forums Amazon Web Services AWS EC2 AWS-EC2 [SOLVED]: System.IO.FileNotFoundException: Could not load file or assembly System.Xml.Linq

Tagged: , , ,

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #246938

    Cloudy Point
    Keymaster

    QuestionQuestion

    I have a mono project that runs fine on my computer (running Ubuntu 16.04), but when I upload it on Ubuntu in AWS, it throws this exception:

    System.TypeInitializationException: The type initializer for ‘Amazon.AWSConfigs’ threw an exception. —> System.IO.FileNotFoundException: Could not load file or assembly ‘System.Xml.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089’ or one of its dependencies.

    On the Ubuntu server, I’ve installed mono using sudo apt-get install mono-runtime. I assume this didn’t install the DLL for System.Xml.Linq.

    Note the error isn’t about the assembly reference, it’s about the actual assembly DLL file missing. Using strace mono ParamStoreTest.exe shows that it tries to search for the DLL but can’t find it:

    open("/usr/lib/System.Xml.Linq.dll", O_RDONLY) = -1 ENOENT (No such file or directory)
    

    #246939

    Cloudy Point
    Keymaster

    Accepted AnswerAnswer

    After running dpkg -S System.Xml.Linq to find out which package installs it, I ran sudo apt-get install libmono-system-xml-linq4.0-cil on the EC2 machine. This fixed the issue.

    Source: https://stackoverflow.com/questions/47857082/system-io-filenotfoundexception-could-not-load-file-or-assembly-system-xml-linq
    Author: sashoalm
    Creative Commons License
    This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.