Forum Discussion

burair's avatar
burair
Copper Contributor
Nov 23, 2021

Need Advice on Asp.Net MVC project

Hey, I just need advice on my first project. I am highly frustrated rn. I dont know where to start.
I am creating a web-application on Asp.Net MVC using Entity framework with SQL server

Till now:

  • I find the template and created the layout and index page on mvc

Its only me on the project. Its about a week and i am really losing my mind how to connect each dots(specification). To complete my project.

I have some question. 
I am sorry, i dont think, so this is the right platform for this or not. I dont want to waste anyone time here. Thanks for your time and consideration.

2 Replies

  • AgaveJoe's avatar
    AgaveJoe
    Copper Contributor

    burair 

     

    It's not clear what problems you are facing.  I recommend the official MVC tutorials which illustrate standard MVC programming patterns.  

    https://docs.microsoft.com/en-us/aspnet/core/tutorials/first-mvc-app/start-mvc?view=aspnetcore-6.0&tabs=visual-studio

    https://docs.microsoft.com/en-us/aspnet/core/data/ef-mvc/?view=aspnetcore-6.0

     

    The .NET Q&Q forum is good place to get technical assistance.

    https://docs.microsoft.com/en-us/answers/topics/dotnet-aspnet-core-mvc.html

    • gunderj's avatar
      gunderj
      Copper Contributor

      Thanks for the response. I've been through the tutorials which were helpful to get this far, but when deploying to IIS I am stuck.  Here are the specifics...

      I built an MVC web application (about a dozen view pages) that is working fine when run from the VS.net 2019 designer IIS Express, but when I deploy the app to local IIS and run it, I get error... 

      HTTP Error 404.0 - Not Found The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.  

      After weeks of checking every issue I can find, I have to ask for help form the folks here - what am I missing? Here are the steps my app uses to get its first web page to be reached...  

       

      I have index.html at the myApp home directory which invokes the first view page...

      var host = window.location.host; 

          var protocol = window.location.protocol; 

          var url = protocol + "//" + host + "/myAppLogin/Login"; 

          //alert("url: " + url); 

          window.location.replace(url); 

       

      Here is my RouteConfig.cs... 

      namespace myApp 

          public class RouteConfig 

          { 

              public static void RegisterRoutes(RouteCollection routes) 

              { 

                  routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); 

                  routes.IgnoreRoute("");  

       

                  routes.MapRoute( 

       

                      name: "Default",  

                      url: "{controller}/{action}/{id}",                

                      defaults: new { controller = "myAppLogin", action = "Login", id = UrlParameter.Optional } 

                  ); 

              } 

          } 

      }

      The myApp properties in VS.net designer shows start action specific page with index.html shown.

       I copy the entire project over to C:/inetput/wwwroot 

      In inetMgr I startup myApp and check bindings and settings, all looks ok on port 80 (default Web Site shut down) 

      Next, I issue this in my web browser - http://localhost/myApp/index.html which gives error...  

      HTTP Error 404.0 - Not Found The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.  

      the 404.0  error page shows RouteConfig.cs did its job correctly... 

      Requested URL       http://localhost:80/myAppLogin/Login 

      Physical Path       C:\inetpub\wwwroot\myApp\myAppLogin\Login

      Logon Method Anonymous 

      Logon User       Anonymous   

       

      Some other settings that might be appropriate...  

      Windows 11 pro IIS version 10.0.26100.1 DefaultAppPool .net CLR version v4.0 identity is NetworkService 

      myApp .net CLR version is v4.0 and identity is NetworkService  

      myApp web site has physical path C:\inetpub\wwwroot\myApp defaultAppPool and pass-through authentication.

      Thanks for any help.

      Jay

Resources