IIS Deployment issue with several sub projects - c#

I am trying to deploy the solution to IIS but it does not work.
I have the following structure in my solution:
Web ASP.NET MVC project
Web API project
Web API project (authentication related)
In the IIS, I created the following structure:
C:\inetpub\wwwroot\prj\site
C:\inetpub\wwwroot\prj\api
C:\inetpub\wwwroot\prj\auth
IIS has only 1 Web Site, pointing to C:\inetpub\wwwroot\prj\site
That's it. Nothing else.
When I go to localhost/login it displays me the proper page but for some reason authentication does not work, I presume this is because there is something wrong with the settings
All that works fine when I run the project using VS (Internal IIS), just clicking "run"
Please advise what to check and what to change? Thanks

Related

Can't publish .net core web api on local iis

I made a .net core web API project. My project has 3 layers. The first and second layers are .net core class library and the third layer is .net core web API.
When I start the web layer in Visual Studio with iis express no problem I can work with my web services but I want to publish it on my localhost it doesn't work.
I followed this tutorial:
https://www.youtube.com/watch?v=ZZfRlBMHds8 and when I try it with my project it doesn't work.
What should I do?
I also tried an empty web API project but it doesn't work either.
I would make sure you have he IIS_IUSR permission for the directory the the WebApi is located in. Then, I would open the solution in VS as the administrator and right click the WebApi project and select Publish. This will open the configuration part of publishing your WebApi and you can set your settings here. Make sure you can connect to your IIS site you wish to publish to and save your settings. Then stop IIS, publish, then restart IIS. Hope this helps.

How to deploy an ASP.NET application to localhost using IIS?

I'm trying to deploy an ASP.NET application to localhost using IIS, I've been reading a LOT of tutorials and following them step by step but I just can't seem to make it work...
I created an Application Pool(TestPool) with .NET version 4.0 and gave it every permission to the folder where the application is at.
I then added an application to the Default Web Site and tried to run it at
http://localhost/TestApplication/
But I keep getting:
Any idea what is wrong and how can I solve this?
Versions:
IIS version: 6.2
OS: Windows 8.1
VS 2013 Ultimate: 12.0
VS .NET: 4.6
PS: It's my first attempt at deploying an ASP.NET application so if you need any further information just leave a comment.
EDIT:
It is now running at least thanks to Julian and Marge, but when I run it using VS it has the default view, why isn't it showing when I run it through IIS? When running through IIS it just lists the files:
This error is because your website, in the IIS Server, does not have the Directory Browsing enabled and the default document (default page of the site ex: Default.aspx) configured.
Go to IIS Server IIS > Default Documents and check if the default page of your site is listed, if no, add the page.
Check the related link:
https://support.microsoft.com/en-us/kb/942062
Generally speaking, you do not need to access IIS manager at all to run your webpage on localhost. All what you need to do is right click on the project and then choose properties. In the Web tab you will find Servers section. Make sure the Project Url is something like http://localhost/myproj or simply http://localhost/ then hit Create Virtual Directory. Your webpage should be up by then, and you can access it either in debug mode, or simply by navigating your browser to the Project Url you have chosen.
When you add web application in IIS ex.
That your hostname should be to add in host file which is C:\Windows\System32\drivers\etc"\hosts
ex.
127.0.0.1 test.pln

Visual Studio 2013 web forms project (.NET 4.5 and above) fails when deployed to hosting service. Runs locally

I've recently been working with ASP.NET again and decided to create a small ASP.NET project in a subfolder on one of my websites. I'm using Visual Studio 2013 and created the project using the ASP.NET Web Forms Application template. After creating the project, I left everything at the default, verified that it would build locally, published it to a folder on my system and then copied the published files via FTP to the subfolder on my site. When I tried to bring it up in my browser, it failed with the code ERR_CONNECTION_RESET. This told me that the host was seeing something there, otherwise it would have gone to my site's main 404 page. Chrome also refused to load the other pages within the deployed template. I did set the folder as an application in IIS after getting another error about forms authentication but that didn't have any effect.
I was able to successfully re-deploy an old ASP.NET site created with .NET 4.0 in VS2010. I was also able to deploy and load a project created in VS2013 / ASP.NET 4.5.1 with the ASP.NET Empty Web Application template.
I finally finally get the Web Forms template to work by doing the following -
Created a basic Default.aspx page with no master page.
Created a basic web.config file (copied from another new empty
project)
Commented out the following lines in the Application_Start function of Global.asax
BundleConfig.RegisterBundles(BundleTable.Bundles);
AuthConfig.RegisterOpenAuth();
RouteConfig.RegisterRoutes(RouteTable.Routes);
At that point, the project ran on the host with no problem. I then restored the Default.aspx and Web.config files and the project again failed, even with the Global.asax lines still commented.
I also changed the SessionState mode to "Custom" as suggested in the web.config file and this made no difference.
My question at this point is this - Has anyone else deployed a .NET 4.5.1 Web Forms app designed from the VS2013 template to a shared hosting service and is there something that you have to do to get it to work?
I'm fairly satisfied at this point that I can use the empty web application template and build things from scratch but I'd like to know if anyone else has run into this and what they did.
Thanks.
ERR_CONNECTION_RESET sounds to me like you were having some kind of Internet connectivity troubles, or your server was having some sort of Internet connectivity trouble. If it's working fine now, probably nothing to worry about.
Has anyone else deployed a .NET 4.5.1 Web Forms app designed from the VS2013 template to a shared hosting service and is there something that you have to do to get it to work? Yes, lots of people have done that.

Starting a ASP.NET restful webservice on IIS

I have developed a restful web service using ASP.NET, and while using the Visual Studio environment, it worked like a charm with IIS Express. The service itself is a complementary feature and will have to run on every machine on which our product is installed.
I have therefore created a new directory webservice, which holds the web.config and the Global.asax file, as well as a directory bin, which holds the RestulWebservice.dll file.
I then have setup a new web page on the IIS, rooting at C:\inetpub\wwwroot. The web page itself is hosting a web application, based in C:\inetpub\wwwroot\RestfulWebservice (which holds the files described above).
However, if I startup the IIS and visit http://localhost:80/RestfulWebservice, all I am getting is an error 403.14, stating that I may not inspect the contents of this folder unless I allow IIS to do so. If I choose to allow this, I am simply presented with the contents of the folder, not the service itself.
If I try to access a resource of the restful web service directly (i.e. http://localhost:80/RestfulWebservice/Home, I get a direct 404.0 error, telling me that the resource does not exist)
What am I doing wrong here, it can impossibly be this hard to get a compiled library ASP.NET web service to run on the IIS, it works like a charm on IIS express.
c:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_regiis.exe -i

web deploy c# web application with web api's

I made a very simple web application from the web application template. Then I added a web api controller, added global.asax and an entity framework based database. When running in VS2012, everything works fine. The web api returns the expected requested stuff from the database. So far so good. Now I want to deploy this to an productive machine using web deploy 3.5. So I do Publish/Create web deploy package/etc. Then copy the package to a production machine and do .cmd /y and all installs fine. But when I try to browse the site I first I receive and error that tells me that there is a duplicate 'entityframework' section in my web.config (well, there's NOT), but OK, I renamed some stuff to get it to work, but now my web api url does not respond =(
Sigh, are there any recommendations how to use this web deploy thing or how can I just make sure that what I created in VS2012 and works on IISExpress, to port it to another web server?
This is really driving me nuts and I spent a lot of time on this.
Anyone please???
BR,
Ronald
Ronald please take a look here,maybe it might help you.
http://msdn.microsoft.com/en-us/library/dd394698(VS.100).aspx

Categories

Resources