I am writing a windows service in c# which runs on every server containing "Windows Server 2003". Purpose of this service is to check all the IIS websites and their types. For the current scenario, we only have two types, One is php and other is ASP.Net
Is there any way to get that? or any other possible alternate?
IIS web sites don't have a type.
A site can run both asp.net and php at the same time.
Just because asp.net and php is enabled for a site, doesn't mean it is actually used.
So you don't need to look at IIS but at the content files. Do you see *.php, *.aspx or *.cshtml files?
By looking at the file extensions you should be able to determine what type of technology is used.
Related
I needed some help in understanding how i can get this setup completed. Due to the current setup of the website, we have a "/blog" that is powered by Wordpress PHP. We are looking to upgrade the website with ASP.NET C# for the main website "/" in a Windows Azure server but maintaining "/blog" on a Linux machine.
The service doesn't wish to use sub-domain for the blog in fear of losing too much SEO value that cannot be duplicated.
May i ask how can this be done?
Thanks!
Make the php website a subfolder of your main ASP.NET site as described in Create a Separate Site or Virtual Directory for PHP Content.
See also Can PHP and ASP.Net run together within the same web site in IIS 7.5?
I have just begin using ASP.Net Web application in Visual Studio. What I want to know is that I have two web pages namely index1.aspx and index2.aspx. I want to host them separately using different port numbers in local host on the iis server. I know site binding is used in these cases but not sure how to go about it.
What is the best way to do this? I want them to run simultaneously and communicate between each other.
In IIS there is something called Virtual directory. You can create two web applications in IIS and make both pointing to same physical location on your system.
You can also update settings of each web application to have different index pages. i.e. web app1 shall use Index1.aspx as index page, and web app 2 shall use Index2.aspx.
Virtual directories are so cool, you can use the same code base for multiple tenants. All we have to create is new web apps or sites in IIS.
So I solved it like this:
I created two projects WebApp1 and WebApp2 in the same Solution.
Right Click on Solution Explorer--> Properties--->Select the radio button with Multiple Startup projects.
Also make sure The Action of atleast one of the projects is set to Start only . The rest can be Start Without Debugging.
To connect IIS to your web application say webapp1:
Reference this video:
https://www.youtube.com/watch?v=IwbKquNBNgQ
Hope this helps anyone who is trying this out.
I have a c# .net VS2010 web application that contains only classic asp files.
What I want to do is convert the web application to a web site to make it easier to manage the classic asp files.
How can I convert from web application to web site? I have researched google and found lots of examples going the other way.
I don't think there's an automated way to do this. You could just create a new website in Visual Studio and copy your files from the web app into this new website. Be sure to go into each and every .aspx/.ascx file and edit the 'Codebehind' attribute so that it reads 'Codefile' (codebehind directive needs to be compiled and thus won't work in an ASP.NET website). You'll also need to delete the Designer/Designer.cs files.
Hopefully you don't have too many files so that this won't be too much of a PITA.
(sorry in advance this got a bit long)
The web service in question is running on IIS that has enabled Windows Integrated Authentication.
The development environment is C#, Visual Studio 2008. I can use 2010 if I need to. My old projects are still in 2008.
The two applications I have are my 'fiddling around apps'.
One uses the standard methodology of calling a web service (i.e. adding the web reference, built the proxy classes, etc).
The other basically takes an external XML file and does an HTTP post to the URL (I built it before I knew of the existence of SOAPUI).
So now the web service is going to be behind SSO and I'm trying to figure out how to call the web service with these two different applications.
I assume there is two different ways to do it. The standard way is just to add the line
myproxy.Credentials = System.Net.CredentialCache.DefaultCredentials;
This works great in my standard application.
How would I go about doing this manually in the HTTP post application?
I assume the same line of code would work on the HttpWebRequest object, but I would like to give it a shot manually.
thanks and again sorry for the length.
lee
I have just completed my first aspx/c# project using Visual Web Developer Express and consuming some custom controls and external web services. It runs fine on my development machine.
If I now want to test this on a shared hosting account, do I just upload all the files with the current project structure? Will there be any problem uploading the DLLs to a shared Windows hosting account? Anything I should be aware of or changes to be made to the code? Can anyone recommend a cheap and good provider (this is just for testing - no mssql required yet).
Thanks!
Does visual web developer have a "publish website" menu item under the Build menu?
If you want to pre-compile your site and publish it with all dependencies the easiest way I've found. You can then choose to publish it to either an FTP site or the file system. I usually choose the filesystem and then FTP it up myself to make sure I don't overwrite any config files.
If I'm working on a low volume site for a client and performance isn't a problem, I'll just upload my working directory right up to the server so I don't have to deliver the source code separately and I know they won't loose it.
Oh, and one other thing, if you don't configure it special, I would expect you will have to upload your site to the root directory of your hosting account. GoDaddy does have the ability to specify certain directorys as their own ASP.NET application. If you do that you can put your app in a sub-dir of your choosing.
-Al
It would depend on your website provider. You need to get one that supports the .NET runtime. Once you have that, then you simply upload your code and all should work. I personally use www.godaddy.com. You can see an example ASP.NET site hosted by them at www.chessbin.com.
I hope this helps.
Adam
The hosting companies may vary on what they require, but I would think a simple xcopy deploy would be sufficient for most. Here's a link to one that seems to have good prices (disclaimer: I have never used them)
http://www.reliablesite.net/v3/index.asp