I updated to “ASP.NET Core & Angular” v6.1.0, and trying it on development envirement. The core and Angular parts work fine, but the Public site seems something wrong.
I set both "web.Host" and "web.public" as startup projects. When I start the solution with chrome, the public site screen is ugly, looks like some themes or style sheets are not loaded. I click the "Login" on screen. it redirect me to localhost:4200. After I login with my own credential, it redirects me back to localhost:45776 showing my username on screen, which is correct, but the screen is frozed there.
I tried to start with microsoft edge. The public site screen is still ugly, This time I can't login with my own credential. I tried to use the built-in (admin/123qwe), it then asked me to change password.
Is it something wrong in your code, or on my side? Please advise.
Thanks,
17 Answer(s)
-
0
Hi @fguo
Have you created bundles before running the public project ?
-
0
I have no idea about "create bundles". Can you explain more?
For preiours version (v5.0) I just run public project as I described above.
-
0
Hi, can you check if there is any errors in the browser console.
as mentioned by @ismcagdas, you can run
npm run create-bundles
for your public website project. -
0
There is no package.json in * .Web.Public folder. Here is the error while running npm run create-bundles:
npm ERR! path ...Web.Public\package.json npm ERR! code ENOENT npm ERR! errno -4058 npm ERR! syscall open npm ERR! enoent ENOENT: no such file or directory, open '...Web.Public\package.json' npm ERR! enoent This is related to npm not being able to find a file. npm ERR! enoent
-
0
Check:
- browser console for JavaScript errors, and
- *.Web.Public/App_Data/Logs.txt for server errors.
-
0
I tried it with Edge and Chrome and get different errors as screen shot here:
I checked Web.Public/App_Data/Logs.txt. There is no "ERROR", but some "INFO" looks like error 404. Here are several lines for excample.
INFO 2018-11-05 12:48:42,937 [16 ] soft.AspNetCore.Hosting.Internal.WebHost - Request starting HTTP/1.1 GET http://localhost:45776/lib/fancyBox/source/jquery.fancybox.css
INFO 2018-11-05 12:48:42,940 [12 ] soft.AspNetCore.Hosting.Internal.WebHost - Request starting HTTP/1.1 GET http://localhost:45776/lib/owl.carousel/dist/assets/owl.carousel.css
INFO 2018-11-05 12:48:42,944 [26 ] soft.AspNetCore.Hosting.Internal.WebHost - Request starting HTTP/1.1 GET http://localhost:45776/Common/_Bundles/common-styles.css
INFO 2018-11-05 12:48:42,950 [12 ] soft.AspNetCore.Hosting.Internal.WebHost - Request finished in 13.0063ms 404 INFO 2018-11-05 12:48:42,950 [26 ] soft.AspNetCore.Hosting.Internal.WebHost - Request finished in 6.0922ms 404 INFO 2018-11-05 12:48:42,950 [16 ] soft.AspNetCore.Hosting.Internal.WebHost - Request finished in 13.0096ms 404 -
0
-
0
Thank you for direction. I installed it and updated Bundles exactly as your above picture. However, it still runs with error:
-
0
did you restore the packages in wwwroot\lib ? I think the public site is before Yarn/npm was used but you can right click on bower.json in vs solution explorer
-
0
Oh, I missed it. Just restored packages on Dependencies/Bower. The page style looks good now. BUT, while logout from the public page, I get a popup with "InternalServerError". After I click "Ok" on that popup, the page directs to Localhost:4200 with blank page. I checked the log.txt, there are two "WARN":
WARN 2018-11-08 15:42:47,803 [19 ] naries.DictionaryBasedLocalizationSource - Can not find 'Left' in localization source 'MyProject'! WARN 2018-11-08 15:42:47,803 [19 ] naries.DictionaryBasedLocalizationSource - Can not find 'Right' in localization source 'MyProject'!
-
0
is the log.txt from public project?
warning should not cause internal server error, can you check the log.txt in web.host project?
-
0
Yes. The above WARNs was from the log.txt in public project.
I checked the log.txt in web.host project, but there is no "ERROR" during that peroid of time.
-
0
are the urls in appsettings.json correct for each project and does the javascript console show any error ?
-
0
-
0
the url of your logout api call seems wrong.
/undefined/api/TokenAuth
-
0
That is my question. I didn't modify any API code. Why does it call http://localhost:4200/undefined/api/TokenAuth? What is it suppostly? Is it a bug of ANZ v6.2.1? Can you reproduce this error on your side?
-
0
Hi @fguo
Could you create an issue here https://github.com/aspnetzero/aspnet-zero-core/issues/new. There might be a bug.