First attempt to load a document fails with Core version and Cache activated
obriankevin11 opened this issue · 14 comments
Hi,
I cloned the repo, set the license key file and launched the core demo project.
STR
When I select a file for the very first time it displays for less than a second and disappears.
If I reselect the file then it shows up correctly and doesn't disappear.
If I relaunch the program, it shows up correctly on first and subsequent openings.
Microsoft Visual Studio Professional 2022 (64-bit)
Version 17.0.4
Tested with browsers, same issue on both:
Brave is up to date Version 1.36.122 Chromium: 99.0.4844.88 (Official Build) (64-bit)
Google Chrome Version 98.0.4758.102 (Official Build) (32-bit)
I commented out the .AddLocalCache("./Cache"); and the issue doesn't happen.
I'm sorry for the delayed response. Thank you for sharing the details about the issue. Unfortunately, I've failed to reproduce it on my end. We'll continue investigating this issue and share the results with you here.
How did you launch your project?
Might you try to check with dotnet run from command-line?
Issue happens when I launch it from IDE in debug mode.
Just tried with
\Demos\ASP.NET Core\src\bin\Debug\netcoreapp3.1>dotnet GroupDocs.Viewer.AspNetCore.dll --urls=http://localhost:8080/
and it works fine.
@obriankevin11 might you paste console log here?
@obriankevin11 not requests log, but text console messages
logs here
Look at text log:
aspnetcore-browser-refresh.js:68 File change detected to css file /Cache/11sample_docx/p1.html. Reloading page...
aspnetcore-browser-refresh.js:68 File change detected to css file /Cache/11sample_docx/p2.html. Reloading page...
aspnetcore-browser-refresh.js:68 File change detected to css file /Cache/11sample_docx/p2.html. Reloading page...
aspnetcore-browser-refresh.js:68 File change detected to css file /Cache/11sample_docx/p1.html. Reloading page...
So your issue is related to AspNet core browser link auto-refresh. It is because of you running your project from Visual Studio, this feature designed specifically for Development to auto-refresh page when you update your Javascript/HTML markup, TS modules. It will not on product, only when you running your project from Visual Studio for development.
If you don't need this feature (useful for development purposes only, when you work under UI scripts/markup), you can disable this feature:
- Open Demos\ASP.NET Core\src\Properties\launchSettings.json
- Add "hotReloadEnabled": false, under "applicationUrl"
So your launchSettings.json will look as:
{
"profiles": {
"GroupDocs.Viewer.AspNetCore": {
"commandName": "Project",
"dotnetRunMessages": "true",
"launchBrowser": true,
"launchUrl": "viewer",
"applicationUrl": "https://localhost:9091;http://localhost:8080",
"hotReloadEnabled": false,
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
}
}
}
- Save your file
- Run project in Visual Stusdio again (CTRL+F5)
ok great, problem solved.
thank you
You are welcome!