Creating Virtual Directory returns error - c#

I wrote a web service and hosted it on Local IIS. I clicked Create Virtual Directory: Project URL (my local IP address is 192.168.1.102). I get an error:
Unable to create the virtual direcotry. Could not find the server 'http://192.168.1.102/ on the local mashine. Creating a virtual direcotry is only supported on the local IIS server.
What do I need to do to solve this?

Unfortunately your request is quite a large request- You have a few issues you need to overcome in order to successfully accomplish your task.
The Problems:
Permissions
Ensure Site is configured correctly within IIS.
Ensure you've configured a valid Application Pool within IIS.
You see these are going to be your largest hurdles; mostly because in order for your site to function correctly it will have to allow the Network Service account to perform functionality-
Hopefully this starts to gauge your complexity a bit-
Without code it will be difficult to see why this error has occurred. However, based on your listed IP Address that isn't your actual address. You see your machine is connected to a Router which knows which machine made the given request-
Which means your real IP could be: 50.5.1.14 but the Router has assigned you an IP of 192.168.1.102. So you'd want to target your Wide Area Network and ensure that your local machine will accept the request when it goes through your port.
If your actually testing this on a local machine, the most simplistic thing you could do would be to use the localhost address- This will utilize the Network Interface Cards built in loopback address 127.0.0.1. Which may alleviate your issue within your test environment.
Without more detail it will be quite difficult to correctly answer you.

Related

Internet Server in front of Firewall communicating to server behind firewall C#

Okay so this is probably a very confusing title for this question I am sure. Hopefully I can clear up that title with the actual question.
I am putting together a website for employees to connect to that is internet facing but I want them to be able to log into the site using their Active Directory login as well as access data that will be behind a firewall that is not accessible to our internet facing sites. Someone made mention to me that I could have the site communicate with a server behind the firewall and have that server make the requests back and forth. (Sort of a check point)
So now that the back story to this is out there, I am not really looking for how to configure the server's or the network itself but rather how would one make an API call to an Intranet server from an Internet server? They will be on the same network but one behind the firewall and the other in front of the firewall.
Would you make the call directing to the server name or IP address or what? This may be too premature of a question to be asking since I still don't have the servers setup but none-the-less it is a concern I am having and need to figure out.
This site is going to be all done in ASP.NET MVC 4
The best way to accomplish this type of a setup is via firewall and/or domain configuration.
Most recently I have seen this implemented by first creating a one way trust relationship between the external and internal domains, this will serve to allow the external application to resolve the address of the internal server by name.
Theoretically you could also accomplish this by using port forwarding on the firewall; in this configuration the external application will use the address of the firewall and the firewall will take care of sending the request to the correct server.
Once this confiugration is in place your external application should be able to communicate directly with your internal servers without any special code.

selenium/selenium grid: how to post request to web server with different ip address

i have to test a website that restrict total requests from same ip address. Is there any way to change ip address with each new request sent to web server so that server could not through exception that the current ip address is exceeding maximum requests? i don't know weather i could fix with change of proxy? i need to use it in C#.
It looks like you're trying to change the IP address of your local machine after each call to a server - this is currently impossible using selenium. If you are steadfast in trying to do this you'll need to look up methods of DHCP release/renew from c# or if you have the capability, giving yourself randomly created static-IP, all from c#.
Here's another link you might find helpful http://social.msdn.microsoft.com/Forums/en-US/csharpgeneral/thread/8bf269bd-128e-457f-8c64-09834e995b59/
If you're distributing your tests, you might have even more trouble if all your test machines start changing their IPs - selenium will think it's lost connection to the test machine and bomb out.
Also, don't forget to change everything back after your test has finished (if you're using something like NUnit, make sure your settings are correctly reset in [TearDown])

IIS7 public hosting & domain question

I am trying to test my asp.net project website for public access, so far I have done:
Uploaded to IIS 7 and binded to my localhost (192.168.....) Ok works well.
Obtained a free domain from 000webhost.com/
I tried to change the binding in IIS to the free domain mytestsite#herobo.com but apparently it's showing the webhost default page instead.
Is is possible to remain hosting all web project files in my IIS but use the free domain name so that the public can access?
I believe you need to change this on the hosting site. They should have a webpage you can use to edit your DNS records. This might be it (View Account Details)
192.168 is a private ip address. No one on the internet will be able to see you. Your ISP likely provides you with a public IP address that can support certain server tasks but many ISP's block port 80 so that home users can't start hosting web servers. That means you may need to host your site on a non-standard port.
So, in order for other people to browse to your domain and have that domain's services be handled by your local machine, you'll need to have your domain's A record (in the DNS settings for the domain) pointing to your public IP address. If your ISP assigns you a dynamic IP address, this will require updating your domain name's A record each time you are assigned a new public IP address. This can cause a period of "unavailability" as the changes to the DNS records take time to propagate.
There are services such as DynDNS that can make this rather automatic.
Then there is the issue of configuring your router (assuming it's a NAT based router), which is likely going to need to be configured to forward requests for web services (for port 80 or whatever port you end up using if you need to work around your ISP's restrictions) so that requests from the internet are forwarded to your machine. Your router likely has "port forwarding" and "dynamic dns" features built in, but it'll be manufacturer specific.

How do I make my ASP.Net website viewable in my private home network using IIS 6.0?

I want to know how I can make website available in my private home network? I know I am supposed to make my IP address static but I still do not know the complete steps to accomplish what I want to do. Is this even possible? If it is can someone please explain to me what I have to do?
A lot of ISP's won't allow you to receive requests on port 80. However, you can test this by trying...
-Install IIS - when you go to http://localhost, you should see an IIS start page.
-If you have a router/switch, you'll need to access the admin interface on it. This is usually default 192.168.1.1, but varies by manufacturer. You'll also need to get the local IP address of your IIS server. Go to run, hit CMD, and type IPCONFIG.
-Inside the admin interface, you'll have port forwarding. Forward port 80 to the IP address of your IIS server. Save.
-Now, get your actual IP address by going to a site like whatsmyip.com.
That should do it. Ask a friend or a family member to browse to your IP address. If they see your site, your ISP allows you to host. If they don't see it, your ISP has it blocked..
Having said that, you should check out serverfault.com - this question is more suited for that site.
This is pretty easy but you need to read up on some security before making anything live.
Static IP addresses cost more money than dynamic ones so I suggest signing up to http://www.no-ip.com/. It's requires installing a program which updates a domain which your ip address everytime it changes.
You will also need to use port forwarding on your router so it knows to send all http requests to your PC. HTTP data to passed normally through port 80 or 8080.
Hope this helps.
Check this out: http://msdn.microsoft.com/en-US/library/1y1404zt(v=VS.90).aspx

Is there a way I can tell a process before it starts up or after it starts up which IP address to use on Windows?

I can program in C# so if there are any .NET classes available to reassigning IP addresses or if there is a command line operation for changing the IP address of a given process, that is what I think I'm looking for.
I'm doing some automated browser testing and I want to have requests coming to my site from different IP addresses. My web server has 15 IP addresses assigned to it so I want to have the browser make requests from a different IP address on each request. Or I want to be able to open multiple instance of a browser and have each instance use a different IP.
I read about this today: Why cloud-based load testing is a killer app
You can use a cloud service (like Amazon's) to do load-testing by bringing up a large group of servers for a short period of time to test out your site.
You can set the BindIPEndPointDelegate property of the ServicePoint class to specify the local IP address to use for a connection.

Categories