hey-red / Mime

.NET wrapper for libmagic
MIT License
84 stars 22 forks source link

linux-musl-x64 is missing from runtimeTargets #37

Closed oleg-sviridov closed 4 years ago

oleg-sviridov commented 4 years ago

Hello, I am trying to make your library work on Alpine container and I see that you have recently updated runtimes to support linux-musl-x64 in MIME 3.2.0 . However I still get errors like "HeyRed.Mime.MagicException : Could not find any valid magic files!" in my Alpine container. I have noticed that my project.assets.json still looks like this:

      "Mime/3.2.0": {
        "type": "package",
        "dependencies": {
          "MimeTypesMap": "1.0.8"
        },
        "compile": {
          "lib/netstandard2.0/Mime.dll": {}
        },
        "runtime": {
          "lib/netstandard2.0/Mime.dll": {}
        },
        "build": {
          "build/Mime.targets": {}
        },
        "runtimeTargets": {
          "runtimes/linux-x64/native/libmagic-1.so": {
            "assetType": "native",
            "rid": "linux-x64"
          },
          "runtimes/linux-x64/native/magic.mgc": {
            "assetType": "native",
            "rid": "linux-x64"
          },
          "runtimes/osx-x64/native/libmagic-1.dylib": {
            "assetType": "native",
            "rid": "osx-x64"
          },
          "runtimes/osx-x64/native/magic.mgc": {
            "assetType": "native",
            "rid": "osx-x64"
          },
          "runtimes/win-x64/native/libgnurx-0.dll": {
            "assetType": "native",
            "rid": "win-x64"
          },
          "runtimes/win-x64/native/libmagic-1.dll": {
            "assetType": "native",
            "rid": "win-x64"
          },
          "runtimes/win-x64/native/magic.mgc": {
            "assetType": "native",
            "rid": "win-x64"
          }
        }
      }

I am not very familiar with runtimes and nuget packages, but can it be the issue that "linux-musl-x64" is still missing from "runtimeTargets" or I should look at somewhere else? Thanks

hey-red commented 4 years ago

It problem with magic.mgc. This file should be copied into your app directory while publishing See https://github.com/hey-red/Mime/issues/36#issuecomment-690187800

hey-red commented 4 years ago

Oh, I did't include this runtime! Wait for new package.

hey-red commented 4 years ago

Done https://www.nuget.org/packages/Mime/3.2.1 Let me know if that helped.

oleg-sviridov commented 4 years ago

Now it works fine, thanks a lot!