@ismcagdas can you please help me understand what that means please? What is the definition of Production Environment?
I have changed the launchSettings.json file from Development to Production, as well as set the ASPNET Environment Variable to Production. With those things done, I have debugged the code through Visual Studio, and I have seen a breakpoint on the line that you have indicated be hit, and the href variable be updated to include the min.js
extension, however, what is actually rendered to the HTML on the page is still a .js
extension.
Is there some other code at work here, or some other configuration setting that I need to change in order to make these min.js
extensions be used.
Can anyone help further with this? This would seem like a fairly serious bug, if it isn't a problem of misconfiguration on my part. Thanks
@ryancyq I am not sure I fully understand what you are suggesting, but let me be sure that I follow first...
Currently, within my cshtml file, I have the following:
@section Scripts
{
<script abp-src="/view-resources/Views/Account/Login.js" asp-append-version="true"></script>
}
Once I change the launchSettings.json file to be Production, I can step throug the code and I can see that a src
attribute is attempting to be added using the "correct" min.js, extension, however, what is rendered to the browser is the following:
<script abp-src="/view-resources/Views/Account/Login.js" src="/view-resources/Views/Account/Login.js"></script>
So, I believe I am already doing what you are suggesting, unless I have missed something.
Are there any known issues with the abp-src taghelper? Or is there some settings that I have to enable to make it work.
When running the website out of Visual Studio, I have noticed that when the abp-src taghelper never switches to use the min.js version of a script. I have modified the launchSettings.json file to change the ASPNETCORE_ENVIRONMENT environment variable, and I have stepped through the code to see that it is "trying" to use the min.js version, however, what is rendered to the browser is the following:
<script abp-src="/view-resources/Views/Account/Login.js" src="/view-resources/Views/Account/Login.js"></script>
Here is a screenshot of the breakpoint which I set:
Is there something else that I need to enable this?
Once published to a production server, we are also not seeing the min.js links being rendered to the client. Can you confirm what needs to be enabled on the production server to back this work as well?
Thanks in advance for any help!
@aaron Thank you very much. I am happy to confirm that updating to the latest TimeZoneConverter library (at the time of writing 2.4.2) corrected the problem that I was seeing.
@aaron @ismcagdas thank you both for your help so far.
I can confirm that I am currently using TimeZoneConverter 2.3.1. Is the recommendation to be using 2.4.1? Is it as simple as updating this single package? Or are there other packages that I would also need to update?
Thanks
@ismcagdas Can you provide any additional information in order for me to answer your question? Thanks. I would really like to get to the bottom of this problem.
Naive question...
How would I know that?
Hello,
We are seeing an issue with the default Excel Exporter, for example within the Audit Logs section of the site.
This was working properly, however, now that we have switched to handle multiple timezones, it is causing an exception. Here is what we did...
We added the following code to the Startup.cs class:
Clock.Provider = ClockProviders.Utc;
Now, when we navigate to the Audit Logs section of the site, and click Export to excel, we get "An internal error occurred during your request". Then, digging into the logs we see the following
ERROR 2018-10-19 11:30:38,069 [12 ] Mvc.ExceptionHandling.AbpExceptionFilter - The conversion could not be completed because the supplied DateTime did not have the Kind property set correctly. For example, when the Kind property is DateTimeKind.Local, the source time zone must be TimeZoneInfo.Local. Parameter name: sourceTimeZone System.ArgumentException: The conversion could not be completed because the supplied DateTime did not have the Kind property set correctly. For example, when the Kind property is DateTimeKind.Local, the source time zone must be TimeZoneInfo.Local. Parameter name: sourceTimeZone at System.TimeZoneInfo.ConvertTime(DateTime dateTime, TimeZoneInfo sourceTimeZone, TimeZoneInfo destinationTimeZone, TimeZoneInfoOptions flags, CachedData cachedData) at Abp.Timing.Timezone.TimezoneHelper.Convert(Nullable
1 date, String fromTimeZoneId, String toTimeZoneId) at Abp.Timing.Timezone.TimeZoneConverter.Convert(Nullable
1 date, Nullable1 tenantId, Int64 userId) at xxx.xxx.Auditing.Exporting.AuditLogListExcelExporter.<>c__DisplayClass3_0.<ExportToFile>b__1(AuditLogListDto _) at xxx.xxx.DataExporting.Excel.EpPlus.EpPlusExcelExporterBase.AddObjects[T](ExcelWorksheet sheet, Int32 startRowIndex, IList
1 items, Func2[] propertySelectors) at xxx.xxx.Auditing.Exporting.AuditLogListExcelExporter.<>c__DisplayClass3_0.<ExportToFile>b__0(ExcelPackage excelPackage) at xxx.xxx.DataExporting.Excel.EpPlus.EpPlusExcelExporterBase.CreateExcelPackage(String fileName, Action
1 creator) at xxx.xxx.Auditing.Exporting.AuditLogListExcelExporter.ExportToFile(List`1 auditLogListDtos) at xxx.xxx.Auditing.AuditLogAppService.d__6.MoveNext()--- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at lambda_method(Closure , Object ) at Microsoft.Extensions.Internal.ObjectMethodExecutorAwaitable.Awaiter.GetResult() at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.d__12.MoveNext()
--- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.d__10.MoveNext()
--- End of stack trace from previous location where exception was thrown --- at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Rethrow(ActionExecutedContext context) at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.d__14.MoveNext()
--- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.d__23.MoveNext()
If I debug the Exporter when this is happening, I can see that the Kind
of one of the dates is correctly (or at least I think it is correctly set) to Utc
.
Undoing the code change that was made above, and debugging again when the Exporter is working, I can see that the Kind
of one of the DateTime is set to Unspecified
.
Can you please advice on how to correct this? Having enabled multiple timezones, are there additional code changes that need to be made? If so, where can I find documentation for this?
Thanks
Gary
Thank you for getting back to me!
That information will be very useful, appreciate your time.
Gary