Microsoft Information Protection SDK 1.6 Solution Containerization Error (Using C# Package)

%3CLINGO-SUB%20id%3D%22lingo-sub-1372874%22%20slang%3D%22en-US%22%3EMicrosoft%20Information%20Protection%20SDK%201.6%20Solution%20Containerization%20Error%20(Using%20C%23%20Package)%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1372874%22%20slang%3D%22en-US%22%3E%3CP%3ENeed%20to%20containerize%20the%20Solution%20Build%20on%20Microsoft%20Information%20Protection%20SDK%201.6%20in%20linux%20Container%20Architecture.%20Always%20receiving%20common%20error%20of%20dllNotFound.%3C%2FP%3E%3CP%3EError%20Received%20while%20executing%20MIP%20Initialization%3A%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-csharp%22%3E%3CCODE%3EMIP.Initialize(MipComponent.File)%3B%3C%2FCODE%3E%3C%2FPRE%3E%3CPRE%20class%3D%22lia-code-sample%20language-bash%22%3E%3CCODE%3EUnable%20to%20load%20shared%20library%20'kernel32.dll'%20or%20one%20of%20its%20dependencies.%20In%20order%20to%20help%20diagnose%20loading%20problems%2C%20consider%20setting%20the%20LD_DEBUG%20environment%20variable%3A%20libkernel32.dll%3A%20cannot%20open%20shared%20object%20file%3A%20No%20such%20file%20or%20directory%0A%20%20%20at%20Microsoft.InformationProtection.Utils.UnsafeKernel32NativeMethods.LoadLibrary(String%20dllToLoad)%0A%20%20%20at%20Microsoft.InformationProtection.Utils.Loader.LoadDlls(String%20dllFolder%2C%20String%20dllName%2C%20String%5B%5D%20dllDependencies)%0A%20%20%20at%20Microsoft.InformationProtection.MIP.Initialize(MipComponent%20mipComponent%2C%20String%20path)%0A%20%20%20at%20MIPSolution.Program.Main(String%5B%5D%20args)%20in%20%2Fsrc%2FProgram.cs%3Aline%2055%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EDockerfile%20to%20Execute%20the%20Application%3A%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-applescript%22%3E%3CCODE%3EFROM%20mcr.microsoft.com%2Fdotnet%2Fcore%2Fruntime%3A3.1-buster-slim%20AS%20base%0AWORKDIR%20%2Fapp%0A%0AFROM%20mcr.microsoft.com%2Fdotnet%2Fcore%2Fsdk%3A3.1-buster%20AS%20build%0A%0A%23%20install%20System.Drawing%20native%20dependencies%0ARUN%20apt-get%20update%20%5C%0A%20%20%20%20%26amp%3B%26amp%3B%20apt-get%20install%20-y%20--allow-unauthenticated%20%5C%0A%20%20%20%20%20%20%20%20libc6-dev%20%5C%0A%20%20%20%20%20%20%20%20libgdiplus%20%5C%0A%20%20%20%20%20%20%20%20libx11-dev%20%5C%0A%20%20%20%20%20%26amp%3B%26amp%3B%20rm%20-rf%20%2Fvar%2Flib%2Fapt%2Flists%2F*%0A%0AWORKDIR%20%2Fsrc%0ACOPY%20%5B%22MIPSolution.csproj%22%2C%20%22.%2F%22%5D%0ARUN%20dotnet%20restore%20%22MIPSolution.csproj%22%0ACOPY%20.%20.%0AWORKDIR%20%22%2Fsrc%2F%22%0ARUN%20dotnet%20build%20%22MIPSolution.csproj%22%20-c%20Release%20-o%20%2Fapp%2Fbuild%0A%0AFROM%20build%20AS%20publish%0ARUN%20dotnet%20publish%20%22MIPSolution.csproj%22%20-c%20Release%20-o%20%2Fapp%2Fpublish%0A%0AFROM%20base%20AS%20final%0AWORKDIR%20%2Fapp%0ACOPY%20--from%3Dpublish%20%2Fapp%2Fpublish%20.%0A%23%20RUN%20dotnet%20--info%0ARUN%20echo%20%22Build%20number%3A%20%24buildno%22%0AENTRYPOINT%20%5B%22dotnet%22%2C%20%22MIPSolution.dll%22%5D%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAll%20suggestions%20to%20make%20this%20application%20working%20will%20be%20very%20helpful.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1387230%22%20slang%3D%22en-US%22%3ERe%3A%20Microsoft%20Information%20Protection%20SDK%201.6%20Solution%20Containerization%20Error%20(Using%20C%23%20Package)%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1387230%22%20slang%3D%22en-US%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F616921%22%20target%3D%22_blank%22%3E%40imdevesh%3C%2FA%3E%2C%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThe%20MIP%20SDK%20.NET%20wrapper%20isn't%20supported%20on%20Linux%20platforms%20today.%20We%20hope%20to%20enable%20this%20in%20the%20future.%20We're%20working%20on%20fixing%20the%20NuGet%20package%20so%20it%20won't%20install%20on%20these%20platforms.%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2068904%22%20slang%3D%22en-US%22%3ERe%3A%20Microsoft%20Information%20Protection%20SDK%201.6%20Solution%20Containerization%20Error%20(Using%20C%23%20Package)%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2068904%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F3319%22%20target%3D%22_blank%22%3E%40Tom%20Moser%3C%2FA%3E%26nbsp%3B%3CBR%20%2F%3E%3CBR%20%2F%3EWhat%20the%20status%20with%20the%20SDK%20v1.8%3C%2FP%3E%3CP%3ECan%20you%20comment%20on%20it%20please!!!%3C%2FP%3E%3C%2FLINGO-BODY%3E
New Contributor

Need to containerize the Solution Build on Microsoft Information Protection SDK 1.6 in linux Container Architecture. Always receiving common error of dllNotFound.

Error Received while executing MIP Initialization:

MIP.Initialize(MipComponent.File);
Unable to load shared library 'kernel32.dll' or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: libkernel32.dll: cannot open shared object file: No such file or directory
   at Microsoft.InformationProtection.Utils.UnsafeKernel32NativeMethods.LoadLibrary(String dllToLoad)
   at Microsoft.InformationProtection.Utils.Loader.LoadDlls(String dllFolder, String dllName, String[] dllDependencies)
   at Microsoft.InformationProtection.MIP.Initialize(MipComponent mipComponent, String path)
   at MIPSolution.Program.Main(String[] args) in /src/Program.cs:line 55

 

Dockerfile to Execute the Application:

FROM mcr.microsoft.com/dotnet/core/runtime:3.1-buster-slim AS base
WORKDIR /app

FROM mcr.microsoft.com/dotnet/core/sdk:3.1-buster AS build

# install System.Drawing native dependencies
RUN apt-get update \
    && apt-get install -y --allow-unauthenticated \
        libc6-dev \
        libgdiplus \
        libx11-dev \
     && rm -rf /var/lib/apt/lists/*

WORKDIR /src
COPY ["MIPSolution.csproj", "./"]
RUN dotnet restore "MIPSolution.csproj"
COPY . .
WORKDIR "/src/"
RUN dotnet build "MIPSolution.csproj" -c Release -o /app/build

FROM build AS publish
RUN dotnet publish "MIPSolution.csproj" -c Release -o /app/publish

FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
# RUN dotnet --info
RUN echo "Build number: $buildno"
ENTRYPOINT ["dotnet", "MIPSolution.dll"]

 

All suggestions to make this application working will be very helpful.

 

Thanks

2 Replies

Hi @imdevesh

 

The MIP SDK .NET wrapper isn't supported on Linux platforms today. We hope to enable this in the future. We're working on fixing the NuGet package so it won't install on these platforms. 

@Tom Moser 

What the status with the SDK v1.8

Can you comment on it please!!!