I'm working on a Visual Studio 2012 web application, and need to allow colleagues to view the current website by my IP address (while I would access it my localhost). It appears that hosting the site locally through IIS7 and allowing others to access it by my local IP the simplest method. After troubleshooting and experimenting for a day though, I still don't understand the relationship between an IIS7 site/website/application and Visual Studio web application, and the MSDN explanations are really hard to follow.
Basically, I'm trying to understand:
1) How to set up a IIS website and application (should the 'physical path' be the VS solution folder or deployment package .zip folder?, for example)
2) How to most simply deploy the web application (e.g. File System/ Web Deploy/ Web Package, etc.) and
3) The order to do all of this.
I'm running VS as administrator, my port 80 is open, and have IIS7 set to use .NET v4, yet when I publish the selection using File System in VS2012 to my C drive, the resulting site gets a HTTP:500 error, with no source code underneath. (Also, before even publishing, setting the solution to use my Local IIS instead of IIS Express and previewing results in a blank page). If there is a better way to do this please let me know.
Thanks in advance.
If you don't want to learn (or bother) with the details of setting it up, you can use a small utility like 'ngrok' that will allow others to view your website at 'localhost'.
Takes about 5 minutes to learn and get up and running (and its free).
https://ngrok.com/
Related
I got an ASP.NET project. I'm going to send the project to a server company where they will host it. How do I prepare it to be hosted? I assume I cant simply send the whole project to them. What are the steps to prepare the project to be readable in their server?
This is my first project, never done it before.
Used Visual Studio 2015, WebForm/ASP.NET.
It's going to be hosted via a server company, no clue about anything about their servers.
Also got a MS Access database in App_Data folder within the project.
PS: I found "Publish" by right-clicking the project in Visual Studio's 'Solution Explorer'. I've been checking out this link but it's really confusing.
Any help would be greatly appreciated.
When you publish an application, most of the time it will run just as it does when you debug it, but on the server. All the binaries are copied there, with the Web.config, and most like all you have in your application, but the source code will not be avaiable of course. You don't need to send the application to the company which will host your application, most likely they will give you the server address where your application will be published, they will create an account for you, with some permissions, and credentials. And of course, you can read more about IIS server, it will be pretty relevant to you, and you can configure yourself a server where you can publish your application, just to see how it works.
Set up your own application on your own IIS and experiment locally until you have all stuff in place. Then copy to you hosting environment.
Later on you can script this process to have full control over what you need in dev and prod respectively.
I have a MVC 5 web application that is working fine. But due to internal security reasons and restrictions of my organization, I cannot host it as a website. My current requirement is to make this app run on a particular computer that has IIS installed on it but no Visual Studio.
My application makes use of MS-SQL database, Entity Framework, C# razors and all other .NET dependencies that are usual in a MVC app, and my target framework is 4.5.1 .
What I Found : I googled a lot, what I got is to create a Virtual Directory using the inetmgr and create the application under that directory. But since already the application is created I cannot go for this fix.
Please help me out by providing some links to refer to or steps to solve this.
Thanks in advance for any help.
What you will need to do is to either:
Use Visual Studio to publish the website directly onto the machine which is hosting the IIS application, as shown here.
Use Visual Studio an publish the application to a folder location on your machine and then use remote desktop or some other method to move the published DLL's to the virtual directory of the application.
Essentially both of them do the same thing, but sometimes due to security reasons, option 2 is easier to accomplish.
So it is super easy to setup debugging for your 4.6 (and <) ASP.NET web app in your local IIS. However, I do not see any way to do this in ASP.NET 5. I see IIS Express, ef, and web. Am I missing something? How can I set it up so that I can push Play and have it pull up a Chrome tab and have full debugging of my web app in my local IIS?
If you meant Controller debugging, you just have to make sure you properly have your breakpoints at the lines of codes you've created. After that, all you have to do is to run via IIS Express and you're good to go, VS will automatically prompt you to take a look at the IDE when you have to perform a stepover or etc.
From there you'll be able to check on your code with the various debugging windows in the 'Debug' option on the top bar of VS.
By the way, if you made a thorough lookup on the state of local IIS with .NET Core, there is no way as of now to do so..
How to configure ASP.NET Core 1.0 to use Local IIS instead of IIS Express?
And to further emphasize the pointlessness of using local IIS, here's quote from this article:
However, with ASP.NET Core there's little to no reason to be running
full IIS during development. Why? Because ASP.NET Core applications
aren't actually running inside of IIS. Whether you running called from
IIS, IIS Express or whether you do dotnet run directly from the
command line - you are running the exact same code and in most cases
the exact same execution environment. Running inside of IIS really
doesn't buy you anything anymore that you can't easily simulate with a
command line environment.
Maybe not exactly what you need, but you can debug it.
Before you start debugging, you need to republish the project to the path specified in IIS.
Browse to any webpage of the app so the process starts.
Then inside your VS go to Debug -> Attach to process. Find and select dotnet.exe. There might be several of them, so ticking Show processes from all users could reveal a few more records.
For example, the pool I use on IIS for .net core apps runs under NetworkService identity so it is easy for me to identify the dotnet.exe process I need to attach to (Attach to Process popup has User Name column that contains identity info).
Finally, VS will start debugging. It's similar to the steps for .net framework + attaching to w3wp.exe
How can I run my application on another machine, my team member wants to view the webpage in his computer. He doesn’t want to install visual studio but just wants to see the webpage in the browser.
I am using a Mac book
Publish it to a web server, or have him install IIS on his machine and set it up.. wait. That would be publishing to a web server.
In short, an ASP.NET website needs a web server to run. Usually it's IIS, but if you have Visual Studio, it uses the built-in Cassini web server. Either way, you need to have it in a web server of some kind. You can't just run it as a stand-alone program.
I haven't' done this, but I think you COULD have it running in your computer in Visual Studio and still have him see it. If you run it, you'll see that the address is in the format:
http://localhost/:[some port number]/YourWebAppName
If you have it running in Visual Studio on YOUR machine, your team member MAY be able to access it by changing "localhost" to your PC name. It's worth a shot.
Otherwise, here are a bunch of links to how to publish your site, in case you're not sure.
http://www.google.com/search?q=publishing+asp.net+web+sites&sourceid=ie7&rls=com.microsoft:en-us:IE-Address&ie=&oe=
Create a new virtual directory in IIS
Set the directory root to your project root folder.
allow anonymous access.
Your team member can then access it at http://yourmachinename/virtualdirectoryname
This looks like a good job for IIS express http://learn.iis.net/page.aspx/868/iis-express-overview/
For the majority of things, it's functionally equivilent to using regular IIS 7.5, with the exception that it's easier to start new websites with this. You simply use the command line to start IIS Express, point it to your physical path, set the CLR version, and the port, done!
http://learn.iis.net/page.aspx/870/running-iis-express-from-the-command-line/
There's some instructions for how to do that.
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.