Docker Linux - application not working

0
0

Hi

Apologize for the long post. Just trying to set the context.

Hopefully, someone can help me. I have created a simple  WiseJ application with very little code. It’s mostly for screen design.

I am using Visual Studio 2022 and the project works fine in Debug mode, as expected. I then publish to a folder using Release Mode, Net7.0, and Portable.

I test it manually, but by executing the LauncherTool.exe I can navigate to http://localhost:5000. – Screenshot provided.

My Docker file:

FROM mcr.microsoft.com/dotnet/aspnet:7.0 AS Base
WORKDIR /app
COPY . ./
EXPOSE 80
EXPOSE 443
ENTRYPOINT [“dotnet”, “LauncherTool.dll”]
The docker image is built successfully.
I then create the container using Docker Desktop. The container was created and started successfully. Screenshot provided. II have mapped the port 5000.
when I go to the browser I get the following exception.

The type initializer for ‘Wisej.Web.Control’ threw an exception.

at Wisej.Web.Control.get_DefaultMargin() at Wisej.Web.Control..ctor() at Wisej.Web.ScrollableControl..ctor() at Wisej.Web.ContainerControl..ctor() at Wisej.Web.Page..ctor() at LauncherTool.SQLEditor..ctor() in D:\Development\LauncherTool\LauncherTool\SQLEditor.cs:line 10 at LauncherTool.Program.Main() in D:\Development\LauncherTool\LauncherTool\Program.cs:line 18 at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor) at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr) — End of stack trace from previous location — at Wisej.Web.Application.Start() at Wisej.Core.ResponseManager.b__29_0() at Wisej.Core.IWisejSynchronizedImplementation.Lock(IWisejSynchronized target, Action action) at Wisej.Core.ResponseManager.OnLoad(Session session, Object message) at System.Dynamic.UpdateDelegates.UpdateAndExecuteVoid3[T0,T1,T2](CallSite site, T0 arg0, T1 arg1, T2 arg2) at Wisej.Core.ResponseManager.ProcessRequest(ServiceType service, Object message)

For the life of me, I cannot figure out what I am doing wrong.
program.cs
using System;
using System.Collections.Specialized;
using Wisej.Web;
    namespace LauncherTool
    {
        internal static class Program
        {
            /// <summary>
            /// The main entry point for the application.
            /// </summary>
            static void Main( )
            {
                Application.MainPage = new SQLEditor();
            }
        }
    }
SQLEditor.cs
using System;
using Wisej.Web;
using Wisej.Ext.BootstrapIcons;
using Wisej.Core;
namespace LauncherTool
{
    public partial class SQLEditor : Page
    {
        public SQLEditor()
        {
            InitializeComponent();
        }
    }
}
I am using a Community Edition for now.
I have tried this using both Linux and windows docker engines. I get the same exception message.
thanks
Paresh

 

 

 

  • You must to post comments
0
0

Hi,

Thank you so much! It’s working now. I encountered an issue with my Linux Docker builder, which required me to uninstall and reinstall it. After updating my Dockerfile with your suggested modifications, everything is functioning correctly.

Initially, I tried implementing your changes on a Docker-Windows container, but I couldn’t find the apt-get application, and the NuGet packages were missing some of the libraries I needed. However, after reinstalling Docker and switching to the Docker-Linux builder, everything works perfectly.

Cheers!

 

  • You must to post comments
0
0

Hi Paresh,

The issue your having is due to the fact that the LibGdiPlus library is not installed.
Please modify your Dockerfile like the example below:

FROM mcr.microsoft.com/dotnet/aspnet:7.0 AS Base
RUN apt-get update && apt-get install -y apt-utils
RUN apt-get install -y libfontconfig1
RUN apt-get install -y libgdiplus

#Install ms fonts.
RUN sed -i’.bak’ ‘s/$/ contrib/’ /etc/apt/sources.list
RUN apt-get update; apt-get install -y ttf-mscorefonts-installer fontconfig

WORKDIR /app
COPY . ./
EXPOSE 80
EXPOSE 443
ENTRYPOINT [“dotnet”, “LauncherTool.dll”]
HTH,
Alaa
  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.