Published my MVC 5 site used to be webforms 4.5 - c#

I had a website in ASP.Net 4.5 Webforms on DiscountASP.Net since approx. last April. I converted my website to MVC 5. I basically re wrote it from scratch. When I click on one of the links, it redirect me to a webpage that says [To Parent Directory] and list some directories from my previous project (4.5 webforms).
I tried rebuilding the project and publishing it again and I still have the issue. I am not sure what is wrong.
Can someone try clicking on the one of the two Practice Areas links on this website: www.attorneybeaulac.com and see what might cause the issue?

I see no Index.aspx under /PracticeAreas
The pages that work have views /PracticeAreas/FamilyLaw -> FamilyLaw.aspx
Things to check:
Make sure to properly prep the server for MVC 5.
Make sure .NET 4.5 is installed since that is the framework you are building with VS 2013 (and is required for the latest)
Check that you've run regiis_aspnet -ir to register .NET 4.5
Make sure to deploy your dependencies, all of the MVC and Razor assemblies to your site bin directory.
Make sure you have site configured as a .NET 4 site.
Make sure your web/mvc/razor references have copy local set to true
Clean the deployment destination and deploy fresh

Related

How do I setup a ASP.net Core MVC web application to IIS when publishing it creates .dll, .pdb, and .json files

I'm trying to setup the default ASP.net Core MVC Web application on my local IIS. I publish it using a folder profile, but it generates .dll, .pdb, and .json files. Before, publishing it on the Webforms would generate .aspx and .ashx files I could drag and move to the folder for my web application. I've done some googling but I haven't been able to find a solution or tutorial on what to do with these files. So I'm kinda lost and in need of assistance.
FYI I'm on VS2019 and my project uses the ASP.net Core 2.1 framework. I'm also running IIS version 10.0.19041.1.
EDIT: clarified that it should be IIS, not IIS Express.
EDIT: changed my comparison to WebForms to what it actually creates. Some reason I thought it does .html.
Hi yep it's not straight forward I had a bit off difficulty the first time.
You first have to install the support for IIS from here.
Download
But know that 2.1 is not supported any longer I think.
1 IIS > add sites
2 create your site in the inetpub folder with whatever name you like.
3 paste the content of this folder in the app. C:\Users\yourUser\source\repos\projectName\projectname\bin\Release\netcoreapp2.1\publish
4 It is an app so the .dll etc is exactly what you need. Check the doc it explains how to install the support off .net core it is not native of IIS
Official Doc
Microsoft official documentation on How to deploy the website.
youtube video
Follow carefully the Doc and it should be Ok

ASP.NET Not Publishing to IIS - 500 or 404 Error

I am trying to publish my ASP.NET MVC Core website to IIS 8.5. I've published the package locally and get three folders: "approot", "logs" and "wwwroot". I then have to manually copy all three folders to my web server e.g. D:/inetpub/wwwroot/myWebsite/<CopyHere>.
Should I simply copy "approot", "logs" and "wwwroot" directly to "CopyHere", or elsewhere?
When I attempt to view the website, I simply get a blank page (e.g. "http://my.web.site"). If I enter my Controller and Action to the URL (e.g. "http://my.web.site/myController/myAction") then I get a 404 error status.
This has been an issue with ASP.NET Core RC1 for everybody. ASP.NET Core RC2 came out yesterday. I hope it fixes the many issues of publishing a project to IIS. But I've yet to try it. You can download ASP.NET Core RC2 here. And go here to read the instructions on migrating from RC1 to RC2.
I wouldn't suggest even bothering with the very buggy RC1. But if you want to try and make it work, first make sure you have httpPlatformHandler v1.2 installed. Then follow the steps and issue resolutions here. If it still is not working, I've heard some people have resolved their issues by adding a Configure1() method in Startup.cs. See the details here.
EDIT:
Here is the folder structure for RC1.
approot
logs
wwwroot
You point your website to wwwroot. The contents of wwwroot should be the same as the wwwroot folder in your project.
Also, make sure you set the .NET CLR version on your application pool to No managed code.

mvc4 vs2010 iis7 - set server auhentication

so my problem Erises as i refuse to advance nor to vs2012/15 nor to mvc 6 i think is the latest and nor using EF... well latest.
as the configuration i am in :
windows 7 .net 4.03... mvc4 iis7
i have a problem adding a new website/application so i could simply publish using built-in arrangement via vs2010... instead..as i did with webforms(my till now approach) copying source to wwwroot by my self.
so the issue is i can not find any article /tutorial to set it correctly as the guidance is to set via web platform referencing this age of versions is via using older Wplatform that has Install Web Deploy - via using option in list "Recommended Server Configuration for Web Hosting Providers" which does not exist in current wplatform...
update i forgot to mention i did not want to set any kind of athuresation till i know what will be the effect and what problems in connectivity to the application it will apply from other hand how easy will it be to hack even via spoofing no sweat
as it seems the problem till now was the access permit to the folder of the project i suggest to not use the vs studio as the folder of the project but to make a copy on a normal directory otherwise u need to set user as the user of iis asp.net iis/nameofpool and give it a read right ...full rights accessing the folder.

ASP.NET site throws compilation error on webserver

I am working on a webserver that has ASP.NET 2.0 as the activate instance of ASP.NET (I can't change it. I don't have control over it.)
I orginally wrote the site in 4.0, not even thinking to ask what version the webserver was in. When it came to installing, I realized the error and changed the targeted framework. After a little bit of wrestling with VS 2010, it compiled fine.
I put it up, and now it is giving me this error:
Account used to be a .cs file, which I then put into it's own project so I could get in a DLL in hopes of it working with it being a dll. It always fails when it comes to the first thing that references Account.
Account is compiled against .NET 2.0.
Any help? D:
Edit: The other important thing that may change this, is that the person is already hosting another ASP.NET site on the main folder. He wants to host this site in a subfolder.
I have read that ASP.NET may not like that, so could that be the issue?
Check following:
Your application referencing assembly with Account class;
Corresponding assembly existing in web application 'bin' directory - you may referenced it, but not specified as 'copy always' in reference properties.
You built it, not just put into 'App_Code' (it is bad practice to put code in the App_Code for asp web application as I know)
Also, your error appeared only on 'production' host or reproduced also on VS devserver?

Deployment of asp.net web on IIS 7

I am going to deploy my asp.net web on IIS 7. For this purpose I have googled and found a tutorial link. I followed all the steps and then run the web, in the result web is not running, its not showing its asp.net page instead of this it is showing directory listing of my web.
When I run the web through visual studio the default page in browser is http://localhost:58276/Home/LogIn?ReturnUrl=%2f
Normally, IIs looks for a certain type of file names that it considers are entry file names.
Usually the start page for ASP.NET applications is Default.apsx.
(You can check that in the IIs manager -> Default Document.
Check that your start page has that name.
You should check the start page as #Magnus Johansson mentioned; if that's not the problem, it might be that you're targeting the wrong ASP.NET version.
Did you specify ASP.NET 4.0 for your Application Pool? If you created your own application pool, you should open up the configuration for it and make sure it's set to .NET Framework v.4.0.
If that's not an option for your application pool, you might not have ASP.NET 4.0 set up on your system (which can happen if you install the .NET Framework 4 before you install IIS 7). If that's the case, you may need to run aspnet_regiis: http://msdn.microsoft.com/en-us/library/ie/k6h9cz8h.aspx. (The set of options you want is probably aspnet_regiis -i)

Categories

Resources