-1

I have build a web application based on asp.net mvc using Visual Studio 2015 and .NET framework 4.6.1. The application have multiple projects.

The app is running successfully when I am running from Visual Studio but when I am publishing the app using Visual studio's "Publish" it is not working.

I have gone through tons of articles but no success, I have busting my 2nd day don't know exactly what the hell is wrong with IIS or what the hell I am missing.

My Os is Windows 10 and Windows Server 2012 R2, Visual Studio version is 2015 and Application is built using .NET 4.5.6

Appreciate if anyone can guide me to drill down the real issue. enter image description here

enter image description here

enter image description here

Thanks

Shax
  • 4,207
  • 10
  • 46
  • 62
  • "Publish is not working" is not an error message. There's nothing special about ASP.NET MVC, it works the same way as WebForms. Post the actual error – Panagiotis Kanavos Oct 25 '16 at 12:31
  • The OS and VS versions don't matter either. The error message and log files do. I didn't vote to close yet, but this question can't be answered without the relevant information – Panagiotis Kanavos Oct 25 '16 at 12:32
  • @PanagiotisKanavos, when I am trying to browse the website, Chrome is compalining this "This site can’t be reached msginfo’s server DNS address could not be found. Search Google for msginfo 8080 ERR_NAME_NOT_RESOLVED" – Shax Oct 25 '16 at 12:33
  • https://www.asp.net/mvc/overview/deployment/visual-studio-web-deployment/deploying-to-iis – Liam Oct 25 '16 at 12:34
  • There are sooo many variables here it's not answerable here. Publish just creates a published asset, how that's hosted, etc. depends on many, many variables. – Liam Oct 25 '16 at 12:36
  • @Shax so deployment *succeeded* but you are using the wrong address in your browser. Have you tried using the server's full name? Its IP? Are you using host headers? If so, did you remember to set them on the server *and* DNS? – Panagiotis Kanavos Oct 25 '16 at 12:39
  • I have posted my settings pics, i hope this will give you some idea – Shax Oct 25 '16 at 12:53

1 Answers1

1

Create a new folder for e.g. website and create a subfolder bin where you'll be placing the dlls.

Open IIS. Create a new website and point its physical path to the directory which you have created. Add a binding with a hostname e.g. mywebsite and assign port 80 to it.Make sure the ip is 127.0.0.1

Edit your host file: %windir%\System32\drivers\etc\hosts add the following line: 127.0.0.1 mywebsite

Open your browser and key in http://mywebsite

This should do the trick

Yasirmx
  • 417
  • 3
  • 9
  • @Yasirmx, I followed your suggestion and now getting this error "Could not find a part of the path 'C:\inetpub\wwwroot\msgInfo\bin\roslyn\csc.exe'. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.IO.DirectoryNotFoundException: Could not find a part of the path 'C:\inetpub\wwwroot\msgInfo\bin\roslyn\csc.exe'." – Shax Oct 25 '16 at 12:44
  • @Yasirmx, your tricked workd on local system on my windows 10 machine now can i copy and paste the files from this website to Windows server 2012 and follow the same instructions will this work ? let me try – Shax Oct 25 '16 at 13:06
  • @Shax if you are deploying to another machine. Make sure you know the ip address of the machine. Replace 127.0.0.1 by the new ip address. Each time the ip changes, you will have to update your host file. – Yasirmx Oct 25 '16 at 13:20
  • I am unable to run the same web app on the windows 2012 r2 server by following your same tips – Shax Oct 26 '16 at 08:38