My angular 7 , .net core project is getting error "Cannot GET /" on first running of project.
After server started when i just save any of my angular 7 files in editor, the browser reloads and working fine, but on initial starting its getting error.
There are no Errors found on client side or server side.
Did anyone came across such a problem?
“Cannot GET / ” after initial running of project
I have encounter this issue everytime when I run ASP.Net Core and Angular template. It's because when we run ASP.Net Core server it will run 2 port 1 port for ASP.Net Core server and 1 port for Angular.
The Angular port will have to build and bundle everything so it may take time to bootstrap angular app and sometime we will have time out issue lead to “Cannot GET / ” after initial running of project. So my recommend is you navigate to ClientApp folder run
ng serve
and wait until everything is done build then you can run ASP.Net Core using visual studio by ctrl + f5
Related
i have a problem when i deploy my blazor app (self-contained or framework-dependent) to a private server.
App works properly on visual studio debug mode, i can process crud operations even on remote server.
However when i deploy the app, i get http 500 error and i cant find any additional information. None of the pages are opening.
I checked the _Host.cshtml and Startup.cs files. The app doesn't have complex pages or packages for now, only use asp net core identity with ef core.
Where should i look into first, what could you suggest?
https://i.stack.imgur.com/yN50q.png
Finally i find the solution.
When i deploy the app on azure, it says there is a error about mysqlconnector, and i delete ServerVersion.AutoDetect (Pomelo package), set the version by hand in Startup.cs and it works. But i don't know why it works.
After I deploy my MVC Application on server i got this error , and this is first time that my project do this during deployment . My Application locally is working and in previous time i deployed and it was working also but i deployed again after updates to show this error , also this error appears for any old working version before updates
I'm writing an ASP.NET Web Forms project in Visual Studio 2013, but am having trouble moving it to my computer's IIS 7. Although the project launches successfully from Visual Studio and works properly, launching the version I put on IIS gives an HTTP 500 error: "localhost is currently unable to handle this request."
Here is my process:
Use the File System method of Visual Studio's Publish tool to publish the project to a folder on my computer.
Access IIS' Default Web Site, and set the Physical Path to the folder I published the application to.
If the project works from Visual Studio, why wouldn't it work in IIS?
I had a double entry for in my web.config, and it was causing the same issue: 500 error with no other clue.
The problem was I was submitting a Web Form Application instead of a regular Web Site. The former has additional files in it that makes it not work properly in IIS (at least, I've never been able to make it work).
Thankfully, making a blank Web Site in Visual Studio and copying the web pages over from the Web Forms application was a simple matter, and I got it working easily.
I had an entry made in the web.config
which caused this error...remove the line fixed this issue. so probably any error in web.config makes the browser to not load the server and hence the issue
I create a MVC 6 Web API project that is running as expected from Visual Studio, when I'm however deploying to production I'm getting a
An error occured while starting the application
error.
I did the following on the production machine
Installed ASP.NET 5 from https://get.asp.net
Made sure that the production environment is running the same dnx version
that the application was published with
Installed HttpPlatformHandler 1.2
Set the application pool .NET CLR Version to No Managed Code
Pointed the root location to the wwwroot folder
Is there anything else that I'm missing?
When you run into 500 errors, remember that ASP.NET 5 application can be self hosted,
Open a command prompt
Browse to the application directory
Type in web.cmd
I had some reference problems within my application that was listed in my command prompt which I subsequently fixed and everything worked as expected.
500 can be thrown by different failures. Take a look on http://docs.asp.net/en/latest/publishing/iis.html what u've missed in your configuration.
And you should call it ASP.NET Core 1
I've googled and searched stackoverflow, the following were not helpful
RESTFul service works in IIS Express / VS2013 but not on IIS Server
- the hot fix when run says "The update is not applicable to your computer."
Different result in IIS express and IIS
- not running dotnetnuke or webmatrix
running Win7Pro, with IIS7.5 Have VS2013Pro udpate 3 installed, had VS14CTP installed but is now uninstalled.
Create a new project, chose Web Application, MVC+WebApi, have WebApi 2.2 installed via nuget.
Make no changes to app, hit F5, app starts in chrome, see default ASP.NET site with a link to home and api. Clicking the Api link takes you to a help page describing the api calls available.
Publish site to file system, create new IIS website, point site to published folder, add defaultAppPool user to folder. browse to site from within IIS Manager. Site displayes but no styles are displayed. Setup site as machinename:80 also tried machinename:50102. Not using SSL or any authentication.
In chrome console there are 3 errors (this does not happen in IISExpress)
Uncaught SyntaxError: Unexpected token < modernizr:1
Uncaught SyntaxError: Unexpected token < jquery:1
Uncaught SyntaxError: Unexpected token < bootstrap:1
Trying to navigate to the api link, just refreshes the page, the help page is not displayed.
Using fiddler to try to hit one of the services in IIS Express works as expected. Using fiddler to try to hit any of the servcies returns the default home page.
Please recall no changes made to code, just the default mvc+webapi solution created.
Checked application_start(), it contains
GlobalConfiguration.Configure(WebApiConfig.Register); as the second line.
Any help would be appreciated.
It basically comes down to how you created the solution. In visual studio 2013 Professional, File->New Project -> Visual C# -> Web -> ASP.NET Web Application Click OK. In the pop up under "Add folders and core refrences for:" MVC is checked and greyed out, you cannot un-select it. Check "Web API" check box, click ok. All will work fine while working in VS. However once published as release. Point IIS at published folder, if needed, navigate to page. Page loads but has errors as described above.
To avoid this, do not check the "Web API" check box when creating the new project. Add Web API to the solution after creating it, not during the creation.
VS version 12.0.31101.0 Update 4
.NET version 4.5.52747