Visual Studio Net Core Web App: No option to output as web app in project properties? - visual-studio

So I made a Net Core Web app project with razor pages and javascript files, as you can see on the right of the first screenshot, but I cannot seem to publish it as a web app, only console app or windows application.
For instance, when I publish it to folder, it does not even publish my razor pages, no index.cshtml at all.
Anyone ran into this issue before?
Project properties screenshot
Published folder
Inside wwwroot folder

Razor pages .cshtml files will be embedded into the web.config file after publishing.
It seems like you are using a regular Linux FTP. Make sure you are using a windows server to publish your app on. Net Core does not work on Linux servers unless you install the Net Core runtime on the server.

Related

How to deploy the entire project to IIS

I'm trying to publish my ASP.NET Core 5 MVC application from Visual Studio to IIS Web Server (on VPS). But all my Areas folders, Cshtml files, view components etc, have not been published - only the wwwroot folder and its contents have been uploaded to the server. I saw about project.json, but .NET 5 doesn't use it anymore.
PS: when I try publishing clicking directly from the "Area" folder selected, the files are published, but the .Cs files are published too.
How can I fix it?
On publishing to Microsoft Azure, everything goes fine. But to my VPS it is not working as I would like to.
The easiest way is open scm site, check the publish file under D:/home/site/wwwroot. And compare the structure of deployed file between azure and IIS. It should be same.
After the comparison, see if the folders or files are not included. Just modify it in the .csproj file.
Related posts:
1. Unable to find files located in my root project folder when hosted on Azure
2. dotnet core publish: include/exclude dir in output

How do I deploy a .net core 1.1 app to IIS?

I right-clicked on the project and selected Publish. I chose Folder as the target and VS 2017 published it to that folder.
I want to copy the output to IIS so that I can host it. Which folder should IIS point to in the output?
The output contains a bunch of folders and I've tried to get IIS to point to some of them without any success. In addition, I am not seeing a default.htm or anything traditional like that.
So where should IIS point to?
You will need to copy whatever you see inside the screenshot under PublishOutput to a folder in web server. For example, C:\inetpub\wwwroot\yourapplication.
Then in IIS, Add Website or Add Application depending on your requirement.
In addition, you will need to install .NET Core Windows Server Hosting bundle on the web server.

Azure Web Site not updating via Visual Studio Web Deploy

This may be a basic question, but I've searched for a little while and couldn't find anything specific to this.
I bought a domain and created the web app in Azure for hosting, and set up the DNS so that it's linked to the Azure Web App. Using Visual Studio 15, I opened the website via the FTP connection settings found in Azure, and was able to create files, edit the html, css, etc. Going forward, I wanted to use Web Deploy with Visual Studio to push new builds of the code up to the web site. I downloaded the publish profile from Azure, and imported it into a new visual studio project. I also copied all the previous files over(it wasn't alot). I got the correct Web Deploy settings and successfully published the solution to the Web App in Azure. However, it never updates the code with my new changes. When I look at the site in Firebug it still has the same files/code that it had when I edited it via FTP.
Any idea what I'm doing wrong?
I followed your steps and everything published perfectly for me. Did you try to simply refresh the file list to make sure Visual Studio is seeing all your files? Are they included in your project?
Also, when you go to publish, on the 4th step labeled preview, try to hit "start preview" and see if it detects any changes.
Also, could you tell me a bit more about your project? Is it a website project folder, mvc solution, etc?
You could try to clean the website to make sure your new files are getting deployed.
Clean Windows Azure Website

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.

"Calls to the web service will fail unless the Silverlight project is hosted in and launched from the same web project"

I have Downloaded demo project from here
I tried to run Silverlight project SkiResult.ThinClient from the “Solution Explorer” I have configured the database nicely as SkiResult.FullClient a WPF Project works fine and display data.
But whenever I have tried to run Silverlight project in my Solution Explorer it shows me following error message.
I have googled so much I have also found one solution that set xyz.WEB project as a Start Up Project but as u can see from below screenshot of my Solution Explorer there is no xyz.WEB project in solution.
Thank you so much.....
Try setting the SkiResult.DataService project to be the startup project. This looks very much a web project created to host a Silverlight application because:
it has a Web.config file (so it is clearly a web project)
it has a Silverlight.js file (some utility JavaScript used with Silverlight),
it has some autogenerated test pages,
it has a ClientBin folder, which is typically where the compiled Silverlight application will be copied to.
When you create a Silverlight project, Visual Studio offers to create a web application project to host the Silverlight application for you. (You don't have to create a web application - VS can generate a test webpage during the build process and use that instead.) If your Silverlight project is called Xyz, then this web application will be called Xyz.Web. However, with the solution you're dealing with above, it seems this project has been renamed from the default.

Resources