Agreed, I'm also sticking to v6 as I spent hours upon hours trying to merge with no success. The equivalent of starting from scratch really so there is no realistic upgrade approach. Getting in touch with some third parties to get a quote on how much it will actually cost to finish a migration like this and based on my own costs it will be significant and not worth the effort.
Is there no migration suggestion to move from Metronic v5 to v6? I spent hours merging and all the new layouts are completely broken. Does this mean going from v6 to v7 of Zero reuqires a completely re-write of all views created with the RAD tool and re-evaluation of all changes made to framework views as well?
Unfortunately not, I still get HTML responses for unhandled exceptions. I simply wrap every mething in a try catch so I can provide my own wrapped response to the clients as I showed in the example.
Do you need to delete the DbBinaryObjectManager
? Since it's a transient dependency I can't fuigure out a way to replace it with a storage version.
Not really prepared to share my client's IP to debug an issue. You can create an application service exactly as described and use an invalid bearer token or even a valid bearer token for a tenant that does not exist (throws and exception too in the middleware somewhere). Anything in the action pipeline that throws and exception seems to result in a 500 with a HTML response, this is very easy to test with PostMan.
For now the mobile app detects the HTML response and parses out the exception... pretty nasty.
[DontWrapResult]
public class MobileAppService : MyAppServiceBase, IMobileAppService
{
[AbpAuthorize]
public async Task<MobileApiOutput> GetStuff()
{
// When the auth token has expired then it never gets here, so can't try/catch and wrap in custom MobileApiOutput.
}
[DisableValidation]
[AbpAuthorize]
public async Task<MobileApiOutput> PostStuff(MobileModel model)
{
// This try block is useless if anything happens in the middleware, you get an HTML "Internal Server Error" page instead.
try
{
// Do stuff...
return new MobileApiOutput() { Success = true };
}
catch (UserFriendlyException ex)
{
return new MobileApiOutput() { Message = ex.Message, Success = false };
}
return new MobileApiOutput() { Message = L("AnErrorOccurred"), Success = false };
}
}
I really just want to catch any internal errors (socket exception being caused by invalid tokens, auth failures etc) so that I can wrap with my own object. Is that not possible?
6.5.0 ASP.NET Core MVC with JQuery
Doesn't seem to be the case.
From my eaxmple, if a required field on InputDto
is not sent, then you get a 500 HTML page response because of the validation exception, [DisableValidation]
does nothing.
Similarly, the getter is always wrapped in { result: [{}], success: true... }
type JSON even though the attribute [DontWrapResult]
is applied and despite the documentation saying it won't wrap it...
[Route("api/[controller]/[action]")]
public class MyController : MyAppControllerBase
{
[HttpGet]
[DontWrapResult]
[AbpAuthorize]
public IActionResult GetSomething()
{
...
return Ok(someData);
}
[HttpPost]
[DisableValidation]
[AbpAuthorize]
public IActionResult CreateSomething([FromBody] InputDto model)
{
return Ok();
}
}
@exInt: to fix the missing customzations issue in the release build you'll need to add the files to the bundle config, seems like someone missed this configuration: https://support.aspnetzero.com/QA/Questions/6282#answer-79e97d62-653d-e621-96cc-39eb621f2e19