I have a asp.net application in which I used HTTP controllers (ApiController) as below
[Route("api/dashboard/{id}")]
[HttpGet]
public DataTable getDashboardDetails(int ID)
{
}
Both my web application and controllers are within same application. We have modified our website from HTTP to HTTPS.
Now, when I try to call the above api route as
https://website.com/api/dashboard/123
it throws
404 - File or directory not found
Error
Please help to get the api called. Its working in localhost.
Have you checked the ISS and visual studio configuration ?
Sometimes it need to be restarted to get this changes.
Related
Been using Visual Studio 2019 & ASP.Net. Got all my endpoints working during the development. When deployed on IIS, all my endpoints return 404. While looking at the logs, I get a "404 0 2" error.
I can browse to all pages fine, just the end points not working. I have tried adding various things to my Web.Config all with the same result.
Is a 2019 Server with the latest version of IIS.
Any help is appreciated. Guessing something is setup wrong on IIS?
The endpoints are done in using a controller, sample code below:
[Route("~/api/students/getyear/{yearid}")]
public async Task<ActionResult<IEnumerable<Student>>> GetYear(int yearid)
{
return await _context.Student.Where(x => x.yearid == yearid).ToListAsync();
}
Called by using
app.UseEndpoints(endpoints =>
{
endpoints.MapControllers();
});
When debugging it, I can reach it from "https://localhost:5001/api/students/getyear/0" and when trying on my IIS using "intranet.domain.co.uk/studentnotices/api/students/getyear/0" I get the 404 error
I publish the code to the release folder and copy it to my IIS. Have also tried publishing directly to the IIS but same result
The win32-staus has already indicated that "The system cannot find the file specified."
So I think your IIS is trying to execute the URL from physical path.
It might because your static file handler is taking over the request instead of asp.net extensionless handler.
Please install IIS asp.net extension feature in turn windows features on or off. For .net core ,application, please ensure asp.net core web hosting bundle has been installed.
I have an old site (ASP.net) that I want to publish with azure app service.
I created an app service with RuntimeStack=ASP.Net v3.5 and deployed successfuly.
App Service details:
But I have a problem with the start page:
I want the default page to be a static file (index.html). I tried to add the index.html in "Default documents":
but without success. I get 403 error:
What am I doing wrong?
I have developed a C# asp.net web forms application which uses ASP.net Identity to allow users register and login with their Facebook account.
The issue is this
The login process works perfectly in IIS express when debugging in
Visual Studio 2013
The login process works perfectly when deployed to a test Win 2008 Server
running in a VM on my development box
When I deploy to a Win 2008 Server instance running in Amazon EC2 I get a 404 - File or directory not found server error for the URL
http://www.thedomain.com/signin-facebook?code=AQCQmWqP7.......
The facebook OAuth Settings have had the redirect URL www.thedomain.com added
Absolutely no errors logged that might provide a clue as to what is happening and Fiddler has not provided any helpful information either.
Would really appreciate your thoughts and comments if you have encountered similar.
Figured it out - at last
Turned out not to be related to the AWS platform and in truth I am not quite sure why it worked locally and not in production.
In any case
www.yourdomain.com/signin-facebook is the default CallBackPath in the FacebookAuthenticationOptions Properties
public void ConfigureAuth(IAppBuilder app)
{
app.UseFacebookAuthentication(new FacebookAuthenticationOptions
{
AppId = "111111",
AppSecret = "dfadfafafaf",
CallbackPath = new PathString("/Default")
});
}
Setting a value for the CallBackPath property in the Start.Auth.cs file resolved the issue.
Good day!
I'm writing a very simple asp mvc 4 app which is a simple static site.
When i send a request from the site to app - I get the following error on my first attempt:
The resource cannot be found.
Description: HTTP 404. The resource you are looking for
(or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly.
Requested URL: /EmailSendApp/login.aspx
On my second attempt, i click "send" and my app works well!
Why is it not working the first time?
Thank you!
It is Intranet site and i use Windows authorization.
It is ASP MVC application with Windows authorization.
In MVC application we cannot write .aspx extension in browser url.In mvc application viewpage extension is .cshtml so please remove .aspx extension in browser url.
Your requested url could be like this http:localhost/EmailSendApp/login
so your request is sent to login method which is present in EmailSendApp controller
I'm creating my first FubuMVC application. I've got a physical folder Demo and a route that should handle the "/demo" url. For some reason, when I try to debug it in Visual Studio, it issues a permanent redirect to "/demo/", and then returns HTTP Error 404.20 - Not Found (No default document). When I route the same action to /demostuff, everything works just fine. I noticed that my application startup scripts are fired on the first request, but it's somehow not routed to Fubu's HttpHandler.
I'm using IIS Express.