Base solution for your next web application
Ends in:
01 DAYS
01 HRS
01 MIN
01 SEC
Open Closed

UploadProfilePicture API stop working after upgrade #10939


User avatar
0
SRTMDEV created

Prerequisites

Please answer the following questions before submitting an issue. YOU MAY DELETE THE PREREQUISITES SECTION.

  • What is your product version? - 11.0.0
  • What is your product type (Angular or MVC)? - Angular
  • What is product framework type (.net framework or .net core)? - .net core

Hello Team,

Currently we have upgarde our ANZ version to latest version 11.1.0 and now we are facing 405 Not Allowed issue while uploading user profile picture. Please check below image for the same:


3 Answer(s)
  • User Avatar
    0
    musa.demir created

    Hi @SRTMDEV

    Can you please share the related part of the log file. It is located in the aspnet-zero-core\aspnet-core\src\[YOURPROJECTNAME].Web.Host\App_Data\Logs directory

  • User Avatar
    0
    SRTMDEV created
    ERROR 2022-03-08 10:47:25,460 [orker] Mvc.ExceptionHandling.AbpExceptionFilter - The type initializer for 'Gdip' threw an exception.
    System.TypeInitializationException: The type initializer for 'Gdip' threw an exception.
     ---> System.PlatformNotSupportedException: System.Drawing.Common is not supported on non-Windows platforms. See https://aka.ms/systemdrawingnonwindows for more information.
       at System.Drawing.LibraryResolver.EnsureRegistered()
       at System.Drawing.SafeNativeMethods.Gdip.PlatformInitialize()
       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, Boolean useEmbeddedColorManagement, Boolean validateImageData)
       at System.Drawing.Image.FromStream(Stream stream, Boolean useEmbeddedColorManagement)
       at System.Drawing.Image.FromStream(Stream stream)
       at project.Web.Helpers.ImageFormatHelper.GetRawImageFormat(Byte[] fileBytes) in /home/devopsadmin/devopsagent/_work/3/s/aspnet-core/src/project.Web.Core/Helpers/ImageFormatHelper.cs:line 13
       at project.Web.Controllers.ProfileControllerBase.UploadProfilePicture(FileDto input) in /home/devopsadmin/devopsagent/_work/3/s/aspnet-core/src/project.Web.Core/Controllers/ProfileControllerBase.cs:line 60
       at lambda_method52801(Closure , Object , Object[] )
       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 ---
       at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)
       at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
       at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeInnerFilterAsync>g__Awaited|13_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
       at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextExceptionFilterAsync>g__Awaited|26_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
    
    ERROR 2022-03-08 10:53:44,830 [orker] Mvc.ExceptionHandling.AbpExceptionFilter - The type initializer for 'Gdip' threw an exception.
    System.TypeInitializationException: The type initializer for 'Gdip' threw an exception.
     ---> System.PlatformNotSupportedException: System.Drawing.Common is not supported on non-Windows platforms. See https://aka.ms/systemdrawingnonwindows for more information.
       at System.Drawing.LibraryResolver.EnsureRegistered()
       at System.Drawing.SafeNativeMethods.Gdip.PlatformInitialize()
       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, Boolean useEmbeddedColorManagement, Boolean validateImageData)
       at System.Drawing.Image.FromStream(Stream stream, Boolean useEmbeddedColorManagement)
       at System.Drawing.Image.FromStream(Stream stream)
       at project.Web.Helpers.ImageFormatHelper.GetRawImageFormat(Byte[] fileBytes) in /home/devopsadmin/devopsagent/_work/3/s/aspnet-core/src/project.Web.Core/Helpers/ImageFormatHelper.cs:line 13
       at project.Web.Controllers.ProfileControllerBase.UploadProfilePicture(FileDto input) in /home/devopsadmin/devopsagent/_work/3/s/aspnet-core/src/project.Web.Core/Controllers/ProfileControllerBase.cs:line 60
       at lambda_method52801(Closure , Object , Object[] )
       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 ---
       at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)
       at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
       at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeInnerFilterAsync>g__Awaited|13_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
       at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextExceptionFilterAsync>g__Awaited|26_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
    
  • User Avatar
    0
    musa.demir created

    Can you please check if adding that runtimeconfig.json soles your problem?

    https://docs.microsoft.com/en-us/dotnet/core/compatibility/core-libraries/6.0/system-drawing-common-windows-only#recommended-action