You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have created one .Net Core Console App for reading Bluetooth messages and i have referenced Widows.winmd for using BluetoothLEAdvertisementWatcher (Windows.Devices.Bluetooth.Advertisement.BluetoothLEAdvertisementWatcher). I am getting this "System.TypeLoadException: Could not find Windows Runtime type 'Windows.Devices.Bluetooth.Advertisement.BluetoothLEAdvertisementWatcher'" error while running docker container.
Dockerfile:
FROM microsoft/dotnet:2.0-runtime-nanoserver-1709 AS base
WORKDIR /app
FROM microsoft/dotnet:2.0-sdk-nanoserver-1709 AS build
WORKDIR /src
COPY *.sln ./
COPY ConsoleApp1/ConsoleApp1.csproj ConsoleApp1/
RUN dotnet restore
COPY . .
WORKDIR /src/ConsoleApp1
RUN dotnet build -c Release -o /app
FROM build AS publish
RUN dotnet publish -c Release -o /app
FROM base AS final
WORKDIR /app
COPY --from=publish /app .
ENTRYPOINT ["dotnet", "ConsoleApp1.dll"]
The text was updated successfully, but these errors were encountered:
@summoncse - Since this issue is specific to .NET Core, would you please move the issue to the https://github.com/dotnet/dotnet-docker repo? It would also be useful if you could include what the csproj looks like. I am wondering if this is related to Nano Server? Does the app run within the sdk image?
I have created one .Net Core Console App for reading Bluetooth messages and i have referenced Widows.winmd for using BluetoothLEAdvertisementWatcher (Windows.Devices.Bluetooth.Advertisement.BluetoothLEAdvertisementWatcher). I am getting this "System.TypeLoadException: Could not find Windows Runtime type 'Windows.Devices.Bluetooth.Advertisement.BluetoothLEAdvertisementWatcher'" error while running docker container.
Dockerfile:
FROM microsoft/dotnet:2.0-runtime-nanoserver-1709 AS base
WORKDIR /app
FROM microsoft/dotnet:2.0-sdk-nanoserver-1709 AS build
WORKDIR /src
COPY *.sln ./
COPY ConsoleApp1/ConsoleApp1.csproj ConsoleApp1/
RUN dotnet restore
COPY . .
WORKDIR /src/ConsoleApp1
RUN dotnet build -c Release -o /app
FROM build AS publish
RUN dotnet publish -c Release -o /app
FROM base AS final
WORKDIR /app
COPY --from=publish /app .
ENTRYPOINT ["dotnet", "ConsoleApp1.dll"]
The text was updated successfully, but these errors were encountered: