Giter Club home page Giter Club logo

Comments (14)

yartat avatar yartat commented on August 18, 2024 1

Fixed in 84003fc

from mp-mediainfo.

yartat avatar yartat commented on August 18, 2024

Please, describe more information what is OS was used, version MediaInfo.Wrapper. Did you use .NET Core version or full .NET?

from mp-mediainfo.

lynn-orrell avatar lynn-orrell commented on August 18, 2024

Edition: Windows 10 Pro
Version: 1909
OS build: 18363.535

MediaInfo.Wrapper: 19.4.1.0

.NET Framework 4.8

from mp-mediainfo.

ransagy avatar ransagy commented on August 18, 2024

This still seems to happen, But i'm not sure if its the exact same issue; It works when building for x64, but AnyCPU doesn't copy any of the runtime dlls, including libmediainfo etc and the other dependencies.

All machines showing this are on Windows 10. I have a netstandard2.0 library that references the .NET Core version of the wrapper (19.09) and there are two consoles that are targetting NET Framework 4.7.2 referencing this library.

from mp-mediainfo.

yartat avatar yartat commented on August 18, 2024

I created 2 packages: .NET full and .NET standard. .NET standard should use in .NET Core services and applications only. If you run application on .NET Framework 4.8 you should use .NET full package

from mp-mediainfo.

ransagy avatar ransagy commented on August 18, 2024

Not sure i follow. The project that uses this library is a netstandard2.0 one, even if the root that loads it is a .NET Framework based one.

It does work well in runtime, but only if i build for x86/x64 explicitly; it just doesn't copy any of the artifacts when building to AnyCPU. Is that just not supported in general?

I'm not sure why that would be related to which runtime executes the code.

from mp-mediainfo.

yartat avatar yartat commented on August 18, 2024

MediaInfo.Native package contains MediaInfo.Native.targets (you can find it in %USERPROFILE%.nuget\packages\mediainfo.native\19.9.0) file with instructions how to build in 3 cases:

  • When x64 will copy libcrypto-1_1-x64.dll, libcurl.dll (x64), libssl-1_1-x64.dll and MediaInfo.dll (x64) to target folder
  • When x86 will copy libcrypto-1_1.dll, libcurl.dll (x86), libssl-1_1.dll and MediaInfo.dll (x86) to target folder
  • When AnyCPU will create 2 folders x86 and x64 in target folder and will copy native libraries to them

MediaInfo.Wraper library detects what kind of process (x32 or x64) and tries find MediaInfo library in root folder or x86\x64 folder.

from mp-mediainfo.

yartat avatar yartat commented on August 18, 2024

MediaInfo.Core.Native package contains runtimes with structure of folder and libraries well known only for .NET Core runtime

from mp-mediainfo.

ransagy avatar ransagy commented on August 18, 2024

Then it seems unrelated to this issue, I just don't get the x86 and x64 folders in the output.
If it was a Core vs Framework issue, id expect not to get anything even when building for a specific arch.
Should i open a new issue here or on the Native package in your opinion?

from mp-mediainfo.

yartat avatar yartat commented on August 18, 2024

Could you create a simple project with mediainfo.wrapper package only and try build it? If you have same result as in your project can you share it with me?

from mp-mediainfo.

ransagy avatar ransagy commented on August 18, 2024

@yartat sorry for the delay - here is the repro: https://github.com/ransagy/mpMediaInfoBitnessRepro

Run the console project on either Any CPU or x64 and see the difference in outputs.

from mp-mediainfo.

yartat avatar yartat commented on August 18, 2024

I update test project. See https://github.com/yartat/mpMediaInfoBitnessRepro/commit/22aa89c43a9e5001628def18f1f2fac88b921f33

from mp-mediainfo.

LeaFrock avatar LeaFrock commented on August 18, 2024

Now Microsoft recommends NFX projects using PackageReference instead of packages.config. But the MediaInfo.Native.targets reads,

 <ItemGroup Condition=" (Exists('packages.config') Or Exists('packages.$(MSBuildProjectName).config')) And '$(Platform)' == 'x86'">
    <None Include="$(MSBuildThisFileDirectory)native\x86\*">
      <Link>%(Filename)%(Extension)</Link>
      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
      <Visible>False</Visible>
    </None>
  </ItemGroup>

The Condition prevents CopyToOutputDirectory so I have to copy the .dlls (in native/x86) manually and it works well. And I believe I'm not alone so it's worth leaving a comment here.

The following is a very small console sample:

    internal class Program
    {
        private static void Main(string[] args)
        {
            string filePath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Desktop), "test2.mp3");
            var media = new MediaInfoWrapper(filePath, NullLogger.Instance);
            if (media.Success)
            {
                Console.WriteLine(media.Duration.ToString());
            }
            Console.ReadKey();
        }
    }

    internal sealed class NullLogger : MediaInfo.ILogger
    {
        public static readonly NullLogger Instance = new NullLogger();

        public void Log(LogLevel loglevel, string message, params object[] parameters)
        {
            try
            {
                if (parameters?.Length > 0)
                {
                    Console.WriteLine(string.Format(message, parameters));
                }
                else
                {
                    Console.WriteLine(message);
                }
            }
            catch(Exception)
            {
                ;
            }
        }
    }

1668670146168

from mp-mediainfo.

w7rus avatar w7rus commented on August 18, 2024

Using mcr.microsoft.com/dotnet/aspnet:7.0-bullseye-slim or mcr.microsoft.com/dotnet/aspnet:7.0 had same MediaInfo library was not loaded! error.
MediaInfo.Core.Native & MediaInfo.Wrapper.Core are installed for project.

As a temporary solution: manually installing required libraries fixes the problem

RUN apt update &&\
    apt-get install -y libmediainfo0v5 libzen0v5

from mp-mediainfo.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.