I published the application in Azure Linux App Service ( Not Docker or Linux VM). I am getting the below error and as a result of this I am not able to change the profile picture.
2020-03-05 10:00:48,468 [22 ] e.Diagnostics.ExceptionHandlerMiddleware - An unhandled exception has occurred while executing the request. System.IO.FileNotFoundException: Could not find file: Common\Images\default-profile-picture.png File name: 'Common\Images\default-profile-picture.png'
I checked in the root directory : The file is present.
17 Answer(s)
-
0
Hi @rajamannar
Does that work on your local computer (Windows) ?
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image) -
0
Yes. It works on my local computer
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image) -
0
Hi,
These are steps to follow to re-create the issue.
- Create an Azure App Service and choose .NET Core 3.1 ( LTS ) and it defaults to Linux version.
- Then deploy to the newly created App Service from Visual Studio or CI.
- As soonn as login the default picture for the admin account will empty
- Check in the logs, there will be an error related to this
- Additionally you will also find the libgdiplus erro as well. That can be fixed. I have already answered in a separate thread.
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image) -
0
Hi,
Could you share the exact error message about libgdiplus ?
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image) -
0
2020-03-05 10:02:10,464 [25 ] Mvc.ExceptionHandling.AbpExceptionFilter - The type initializer for 'Gdip' threw an exception. System.TypeInitializationException: The type initializer for 'Gdip' threw an exception. ---> System.DllNotFoundException: Unable to load shared library 'libgdiplus' or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: liblibgdiplus: cannot open shared object file: No such file or directory at System.Drawing.SafeNativeMethods.Gdip.GdiplusStartup(IntPtr& token, StartupInput& input, StartupOutput& output) at System.Drawing.SafeNativeMethods.Gdip..cctor() --- End of inner exception stack trace --- at System.Drawing.SafeNativeMethods.Gdip.GdipLoadImageFromDelegate_linux(StreamGetHeaderDelegate getHeader, StreamGetBytesDelegate getBytes, StreamPutBytesDelegate putBytes, StreamSeekDelegate doSeek, StreamCloseDelegate close, StreamSizeDelegate size, IntPtr& image) at System.Drawing.Image.InitializeFromStream(Stream stream) at System.Drawing.Image.LoadFromStream(Stream stream, Boolean keepAlive) at System.Drawing.Image.FromStream(Stream stream)
at lambda_method(Closure , Object , Object[] ) at Microsoft.Extensions.Internal.ObjectMethodExecutor.Execute(Object target, Object[] parameters) at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.SyncObjectResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeActionMethodAsync() at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeNextActionFilterAsync() --- End of stack trace from previous location where exception was thrown ---
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image) -
0
hi rajamannar
You have solved the problem, right?
Finally I fixed the problem of missing libgdiplus issue in Azure Linux App Service .
https://support.aspnetzero.com/QA/Questions/8629
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image) -
0
Thanks @maliming :)
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image) -
0
Hi,
This problem still exists. Even after installing libgdiplus.
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image) -
0
-
0
@rajamannar
Did you contact with Azure about this ? It seems like the libgdiplus installation must be done in a different way. I think they can help you about this.
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image) -
0
Ok. I will make contact with them. Once I get a reply. I will update here.
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image) -
0
Thanks @rajamannar
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image) -
0
Hi,
I plan to switch an existing app on azure app service windows to azure app service linux. Did you solved this issue ?
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image) -
0
This problem still exists. I followed all the recommendations.
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image) -
0
Tks for your feedback, @rajamannar.
@ismcagdas : have you has more information about this limitation on azure app service with linux ? And do you know about other impacts on linux ?
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image) -
0
I am not able open the image clipping tool.
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image) -
0
hi @rajamannar
In zero 8.4 we replaced EPPlus with NPOI. You can download a demo and try again.
The core of the problem is to use
System.Drawing.Commonin linux.How to use NPOI on Linux.
Since NPOI uses
System.Drawing.Common, you must installlibgdiplusandlibc6on Linux system.Ubuntu 16.04 and above
apt-get install libgdiplus libc6-dev ln -s /usr/lib/libgdiplus.so /usr/lib/gdiplus.dllRUN apt-get update \ && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ libgdiplus \ && rm -rf /var/lib/apt/lists/* \ && ln -sf /usr/lib/libgdiplus.so /usr/lib/gdiplus.dllhttps://www.hanselman.com/blog/HowDoYouUseSystemDrawingInNETCore.aspx
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image)
