MVC6 Web API - How to deploy - asp.net-core-mvc

I downloaded and installed the RTM of VS 2015, got my Web API project working nicely, can hit F5 all works in IIS Express, lovely. But now I go to deploy my WebAPI on a local network server and oh my! I was hoping to find the publish to File System option and then to be allowed to select IIS but it ain't there. Publish to file system is there but that compiles wwwroot and approot folders and for the life of me I haven't been able to get them's files to run under IIS - tried all sorts, ege approot as my website root on IIS, wwwroot as my website root. I've found plenty of reference to show you how to deploy Web API ASP 5 to Azure but have as yet been unable to locate any information for how to deploy to IIS on network.

Just got it to work, for the sour down voter here's how
Right click WebAPi project select Publish
Profile -> Select File System
Connection Target Location browse to somewhere that makes sense eg. C:\inetpub\WebAPI
Settings ->Configuration select Release
Settings Target DNX Version select x64 example dnx-clr-win-x64.1.0.0.beta4
In IIS set the Physical Path of your website to be C:\Inetpub\WebAPI\wwwroot
Test eg localhost/api/Values

Related

The webserver could not be found for IIS-confugured Web Application Project

When I am trying to create a new project in dotnetnuke 9 with for Theme develop using VS, I am getting the following error:
"The Web Application Project is configured to Use IIs. The webserver could Not be found "
I am using VS 2019 and SQL 2017. I create a website in IIS with port 80 that works correctly at localhost. Folder wwwroot/dnndev.me has Network Service permission full access, hostname is dnndev.me without www, there is no .csproj file because the project has not created it yet.
Any suggestions are welcome.
Please check if you have some virtual directories and/or applications in your web site. Visual Studio creates these very often when you open a project. It's safe to remove them - also after opening the project.

Sharepoint customization wizard - can't deploy as a farm solution

Whenever I try to connect with the url (Sharepoint customization wizard, with option deploy as a farm solution) of the solution after creating a new sharepoint 2010 solution with the VS 2010 ultimate and I can't connect it, but I can access it in the browser.
I am running visual studio as administrator.
It gives me the error:
"Cannot connect to the Sharepoint site: [site name].org.br.
Make sure that the Site URL is valid, that the SharePoint site is running on the local computer, and that the current user as the necessary permissions to access the site.
Additional Information:
It is working without need to making package, automattically, (just pressing F5) on the localhost, but is not working in the network intranet solution.
Cannot connect to the Sharepoint site: [site name].org.br.
Make sure that this is a valid URL and the SharePoint site is running on the local computer. If you moved this project to a new computer or if the URL of the SharePoint site has changed since you created the project, update the Site URL property of the project."
Maybe it is required to use the Visual Studio Team Foundation Server to be able to make it to work.
EDIT: Was an error with the anti-virus at the network.
Now I can connect to the project, but cant deploy.
Now I have a problem when deploying it, it gives me a new error.
Recycle the IIS application pool:
Error occurred in deployment step 'Recycle IIS Application Pool': Cannot connect to the SharePoint site: http://[website]. Make sure that this is a valid URL and the SharePoint site is running on the local computer. If you moved this project to a new computer or if the URL of the SharePoint site has changed since you created the project, update the Site URL property of the project.

Manually Assigning WCF Application in IIS

In a Visual Studio "WCF Service Application" project, on the properties->web page, if I select "Use Local IIS Web Server"->"create virtual directory"...it creates the IIS application successfully in the Default Web Site of a local IIS 7.5 install. So far so good.
However, I'd like to use a site other than the default web site. My attempts to host the service in a different web site aren't working. I tried:
Delete the application / virtual directory in IIS that Visual Studio successfully created.
Manually create a new IIS application, in the different web site, using the same settings that were present in the IIS application previously created by Visual Studio automatically.
Go to Visual Studio, project properties->web, and select the "visual studio development server". Save. This is just an "erase" step.
On the same properties page, I select "Use Local IIS Web Server" again and hit save (without pressing "Create Virtual Directory").
In that last step, I expect it to save. It doesn't. It pops up a message saying the virtual directory does not exist. But as I stated, it does exist because I had manually created it just prior.
My own guesses about this problem:
*. The non-default site I've made is somehow different from the default web site, in a way I've yet to determine.
*. Visual Studio is not designed to work with a virtual directory that is not in the default web site.
Any suggestions or clarifications?
I've activated IIS "failed request tracing," but no records are created for this issue.
What you want to do is look at your second site is IIS (the one you want the WCF service to run under) and look at the host name on new or if you go to manage web site -> advanced settings and look at what is after the the bindings. So it may show something like: http:*:80:localhost2 . localhost2 is what you need. It may be an IP Address too, not sure how you set it up.
So then in your WCF project properties in the Use Local IIS Server -> Project URL you put the host name of the site. So for example it may be something like: http://localhost2/yourservice.svc .

publish MVC 3 app to localhost IIS 7

I have searched a lot and I have tried but couldn't published asp.net mvc 3 application on localhost. I have never tried before. I have currently adminpanel application running on development server of the visual studio. In my machine, following are installed:
IIS 7
windows 7
SQL server 2008
MVC 3
asp.net 4
In visual studio, I publish application using File System publish method and target path to C:\inetpub\wwwroot\adminpanel. And Following Directory and files were copied.
Directory
App_Data
bin
Content
Scripts
Views
Visual Studio 2010
Files
Global.asa
Packages.xml
Web.xml
I don't know but I think Some directory's are missing like the controllers, Helpers, Models, Sources which I have seen in Visual Studio Solution Explorer. When I browse to http://localhost/adminpanel, it shows all directory and files list in browser.
How to publish the application to IIS and use SQL server of local machine so that I can browse to particular controller like http://localhost/User/UserManager which I can do in the dedicated server of the visual studio.
I don't know but I think Some directory are missing like controllers,
Helpers, Models, Source which I have seen in Visual Studio Solution
Explorer.
That's perfectly normal. ASP.NET MVC 3 uses an ASP.NET application type (in contrast to ASP.NET WebSite) meaning that it is precompiled and all the source code is removed when deploying. Only the Views, Static resources such as CSS, Images and Scripts as well as the bin folder containing the compiled assemblies is deployed.
Basically, I think your Site has not been defined as a application in the IIS. You can do it from IIS manager.
But, instead, when you publish the the application, select File System but instead of browsing to the mentioned Folder, in Target Location field click the button next to the text box and select Local IIS on the left side. Now you can create a Application Folder and directly publish into it.

Debugging an existing sharepoint solution

I've recently mapped a sharepoint solution from TFS to a local directory and successfully 'got' the latest version.
It wasn't building, but this was because of there were no Site URL's in the properties of the several projects included in the solution. So, using central admin, I created a new web app (the port 36352). U then added the url and port to the Site Url and it's now building fine.
However, when I go to run with the debugger I get the following two errors:
Error 2 Error occurred in deployment step 'Recycle IIS Application Pool': Cannot connect to the SharePoint site: :36352/">http://:36352/ (deleted url for security reasons). Make sure that this is a valid URL and the SharePoint site is running on the local computer. If you moved this project to a new computer or if the URL of the SharePoint site has changed since you created the project, update the Site URL property of the project.
AND
Error 3 Program 'Path.PowerShell.exe' (deleted path for security reasons) does not contain a static 'Main' method suitable for an entry point
It seems that the first error is related to the way in which I've 'connected' it to the new web app I've created - have I done this part right?
The 2nd error seems to be with regard to the entry point at which the debugger should execute, but this is a sharepoint site - so I just want to run the site (has VS not identified this as sharepoint somehow?).
Thanks a LOT for any help.
I got this exception when I had the solution on a different server. Make sure your solution is on the same server as the SharePoint web application. When you run the solution, Visual studio packages the solution and tries to deploy it onto the URL you specified in the properties. If your project is a farm solutions such as visual web part then make sure you have rights to deploy.

Resources