I have an already compiled web application on Visual Studio 2012.
I want to show it on my browser, using IIS, without open again VS. Is there this possibility?
If you don't want to go back into VS and assuming this is a ASP.NET MVC or Web API application, then in IIS:
Right click on Sites, and Add Web Site
Set the site name, physical path (C:/inetpub/wwwroot/applicationName), and host name etc (be sure to add to the hosts file)
Once you've created the site, go to your application pool and make sure you're on the right version of .NET (by going through advanced settings)
In the applicationName directory, put in your bin, app_start, app_data, fonts, scripts, views, etc folders. Also, you will need the Global.asax and obviously Web.config
As you have a compiled Web Application in VS I assume you used IIS Express during development.
In case you want to run in on local IIS go to the project properties (right click the project node in the Solution Explorer), select the Web Tab, choose Local IIS and create a virtual directory (Button on the right side).
If you want to run the Web Application on another server, right click the project node and choose Publish... You can export via FTP or to a directory, from where you can copy/paste to your target server.
Related
I am a new-ish solo developer in a company, and I am trying to deploy an existing ASP.NET website to Dev and Prod environments. I think this is a WebForms project (I am not sure how to figure out what kind of project this is tbh).
When I Publish the website to a folder using Visual Studio, everything but the Content, Styles, Scripts, Images, Resources folders get published properly. As a result, after deploying on IIS, the website loads with just HTML, no styles, themes or images. I have to manually copy those folders over from the code repo to the Publish folder after publishing is done.
How can I fix this?
Tools: ASP.NET, Web Forms (I think?), Visual Studio 2013
This suggests that you are working and attempting to maintain this web site as a web site applcation.
Keep in mind that a Web site?
This has all of the folders and includes your css files etc. This folder is ASSUMED to be a 100% valid working copy of the web site. Often developers will open the web site "live" on the hosted server directly. This is not a great idea, but it is VERY easy, since you can say open up a web page, modify it, and save, and you are DONE!!!
In effect, no real publish is required. You have a full working web site that the web server (IIS) is running against.
if you want to work on a copy, then you can/would copy the whole web site from the wwwroot or whatever folder the IIS web site is CURRETLY consuming and using.
You can then ALWAYS open the web site using file->open web site. You NEVER and DO NOT in ANY case want to open that web site as a web site project or so called applcation. (that would be the prj, or sln file).
However, it is possible that you have a asp.net web site applcation. (the key concept/word here is "applcation".
For a application, then yes, you REALLY need to use web site publish. That publish will compile all the code, remove the c# (or vb.net) code, compile those to .dll's. That resulting folder publish will thus have MANY parts removed, including source code, and the code will have been pre-compiled by Visual studio as opposed to letting the web site (IIS) do the compile of such code.
And with this choice, you of course have to mark/check/set/ensure/control/be aware/know/ that any additional folder has to be marked as part of the project. In fact VS should show such folders as "grayed" out, and not to be part of the publish process.
Say, I have a folder with a bunch of css and other files. So, right click on that folder and check the settings.
let's say do this from VS for a folder I have called content. (lots of css and other things in that folder in my case). And this is a "applicaiton"
So, right click, and check this:
NOTE very close in above - "Exclude" from project.
also, you can right click on ANY file in that folder, and display property sheet, and you have these options (which publish will use).
So, i right clicked on the file called Burke.css, and we then get this:
So, check those options for those missing files. And check the options for the folder(s) (include/exclude from project).
My spider sense suggests that this was a web site, and you trying to work/change/develop/use this web site as a web site project.
You can certainly covert over time to a "application", and while I prefer a "applcation" over a web site, often many prefer a web site, since it does not really require you to use the publish options at all.
You can super easy find out - just look at the web site running on IIS - does it include the vb.net (or c#) files on that site? If thsoe code behind files exist, then you have a web site, and not a web site applcation.
I need a way to run web application , like as we do for windows form application by clicking .exe file from bin folder.
Example:if windows form application namely "helloworld" is created means, we can move to the actual folder where the project is stored and we can run the application manually by moving into helloworld folder->bin folder->debug folder-> helloworld.exe.
Likewise i need a way to run wed based applications.I am using C# language in Visual studio 2010
you run web applications by publishing them to a web server and then opening a link in browser. your options are:
open project in visual studio and hit F5 to start debugging. visual studio will launch a built-in webserver to host your application. while it's running you will be able to access it via url similar to http://localhost:53212/appurl
if you have IIS installed you can publish project to your IIS. you would be able to access application even without visual studio via url similar to http://localhost/ or http://localhost/myapp depending on settings
you may choose web hosting provider and publish your web app to a server. you will be able to access your app via url like http://myaccount.hostingcompany.com/ or if you buy a domain than via http://yourowndomain.com
if you need an icon so that users could double click on it and go to your web app url, create a text file that contains
[InternetShortcut]
URL=http://www.yourdomainurl.com/
IconFile=
IconIndex=0
and store it as Yourname.url file.
however if you need an executable that behaves similarly to a web page, you can host a webbrowser object in your windows application or create WPF application.
you could create a windows form project and add a web browser control with the URL you want it pointed to.
You could also run it without IIS (from command line) or mount it as a windows service.
http://www.realsoftwareblog.com/2012/03/running-standalone-web-application-as.html
For a web application you have to host in on IIS(web server).
Here is a link that will help you get started with IIS
Web applications need a web server, and running is not as simple as clicking an exe.
.net does allow you to create installers for web applicaitons.
I have been using the embedded server that visual studio has to test my ASP.NET MVC 3 application and it has been working fine. I decided that I want to start using IIS on my local machine for my personal development environment as that is how the application is going to have to be deployed.
I installed IIS through the control panel on Windows 7 (so I am assume it is version 7/7.5) and enabled basically every option. I then open up the IIS Manager and added the website. I also added an entry in my hosts file so that the domain I gave the IIS Manager maps to 127.0.0.1.
I then started Visual Studio (as administrator) and opened up the solution. I changed the properties for a few of the references as mentioned in a "How to Web Deploy ASP.NET Applications" article (like System.Web.MVC, System.web.Routing, and a few others). I then went to the main project, right-clicked and clicked publish. I set everything in there for Web Deploy and published it. To double check I when to the folder that I set as the path for the website in IIS Manager and they was a folder called app as excepted (when publishing I gave it website/app so I was excepting that folder) and it had a number of different files.
Edited
At first I was getting a blank page. After restarting my server, I now get a page with the message:
Error Summary
HTTP Error 403.14 - Forbidden
The Web server is configured to not list the contents of this directory.
It tells me the most likely issue is that directory browseing is not enable but I would have though that my application would be access from the url (sb.website.com/app). The only files that publish copied over into that folder is the Web.config and Global.asax (it also copied the folder Areas, bin, and Views). Is there some setting in IIS Manager I am missing something else that should be copied over in the publish?
Figured out the issue.
I had to do was run aspnet_regiis -i in command line.
to start - Add a test.html page in your solution just to exclude any extension issues. Try even adding it to your wwwroot folder as well and see if you can hit it from localhost/test.html
I've spent a great long while googling this problem without any luck and I've always found great answers here, so here it goes:
[BACKGROUND]
I have a web application which was developed in C# with Visual Studio 2008. It was a part of a solution with another project which contained a web service. This was not created "IN" IIS (I was using the Cassini ASP.NET Development Server at first, but have encountered numerous issues). I finally got approval to install IIS 5.1 (Government Network - using Windows XP) so I wanted to host my apps there for development.
I moved my projects to another folder created my IIS virtual directories, pointed them at the right location, updated my security settings, ensured that .NET 2.0 was selected and tested the site and web service. They function perfectly in IIS.
[ACTUAL PROBLEM]
I open Visual Studio, click File > Open > Web Site > Local IIS > [Application Name] and it opens up, but my .design files aren't nested under the ASPX / ASCX objects, and when I right click on it and select "View Code" it takes me to the markup instead of the code behind. Once I reach the code behind, I don't have access to any of the members of the design, as though there was a problem with the wire up.
I have tried creating a web site from IIS through Visual Studio, and it works perfectly. I closed it and opened it up again to see if that functionality would persist and it did.
I've encountered this before and have had to re-create a new site through Visual Studio, and manually re-populate it with all of my classes from a "broken" solution. I would love to solve this the correct way.
Please help!
Adam
The best thing I could suggest would be to go through the Project files with a fine toothcomb (as Filburt suggested) and make sure the references are pointing to a virutal directory (or via the inetpub folder, if thats how your IIS settings are configured), rather than a file system directory.
You might also want to check your IIS settings. Is your virutal directory set up to point to a file directory?
Good luck!
All dependencies between markup, .design and code-behind files are laid out in the project file.
You could use a sample project to discover how to correct your existing project.
I have recently inherited an ASP.NET website to look after.
I have a copy of all the files but coming from a PHP background I am not sure how to make changes and deploy it.
After I make changes to the site I presume I need to compile it. But can I then simply copy the site onto the server or do I need to create a setup package and 'install' it over the top of the production system?
Also, where does the code-behind DLL 'sit' in the file system?
Is there a decent guide to this kind of stuff?
After making changes and testing them with your local copy (I'm assuming you know how to do that), click the "Copy Web Site" button at the top of the solution explorer. This lets you connect to a remote server (your production box, presumably) and will compare your local version of the web site to the one on the server, and flag any files that have been changed locally. You can then update the server version so that it matches your local version.
If you're deploying the web app as a compiled DLL (instead of as uncompiled CS files), the DLL should sit in the application's \bin folder. Even with a compiled DLL, you still need to deploy the ASPX files.
You don't have to go for a setup. The answers to your questions differ based on whether you are using a 'WebSite' or a 'Web Application Project'. Please answer to following and we can follow up after that;
Which version of .Net / ASP.Net you use? (1.1, 2.0 or newer)
When you open up the package in VS (Visual Studio) and right click on the top most group (solution explorer) do you see options like Build web Site, Publish Web Site?
As a long-shot just try to create an IIS web site pointed to the root of your files and see if anything comes up. If this works the work process will be;
1. Do a change
2. Compile
3. Hit the web site URL and see whether it reflects