Access IIS Express Website From Remote Machine

IIS Express Run From a Remote Machine

Sometimes running a web application using IIS Express using localhost is fine, but if you want to use the IP address and port to access it from another machine then you need to configure IIS Express. For example if you see this error

Invalid hostname

Invalid hostname

You can get to the IIS Express settings applicationhost.config by going to IISExpress\config in your documents folder.

The important section of the config file are the sites listings

<site name="WebApplication1" id="45">
<application path="/" applicationPool="Clr4IntegratedAppPool">
<virtualDirectory path="/" physicalPath="C:\visual_studio_projects\WebApplication1\WebApplication1" />
</application>
<bindings>
<binding protocol="http" bindingInformation="*:60106:localhost" />
</bindings>
</site>

To access it from another machine, you need to add an extra entry for the binding like this:-

<binding protocol="http" bindingInformation="*:60106:192.168.234.12" />

But after restarting IIS Express which is accessible from the try icon you may get this

 

Visual Studio error

Visual Studio error

 

Usually all you need to do is start a command console as administrator and run this command:-

netsh http add urlacl url=http://192.168.234.12:60106/ user=everyone

To delete the same urlacl run this:-

netsh http delete urlacl url=http://192.168.234.12:60106/

But sometimes that does not always work and you still cannot run the web application by its IP address. The other approach is to run Visual Studio as administrator. This can be tedious every time you start Visual Studio up, so find its executable which is usually under:-

C:\Program Files (x86)\Microsoft Visual Studio {version}\Common7\IDE

Right click the devenv.exe icon and choose properties. The select the compatibility tab.

Change the Privilege Level to run as administrator like this:-

Visual Studio .exe properties

Visual Studio .exe properties

 

You can also choose to change this setting for all users if you wish.

Now you should be able to run your web application from another machine such as virtual machine.

 

Happy coding

 

 

Posted in CodeProject, MVC, Practices, Web

Hooking Trello Into Visual Studio Online

Trello

Trello is a fantastic web based tool that helps you set up a Kanban board for pretty much anything. A typical example would be for software development practices such as listings for ToDo, Doing and Done.

0

Trello Interface

But Trello is so configurable that you can use it for other non development tasks. I have boards set up for stuff I need to do for my home and a board for my business projects.

Visual Studio Online

If you have not used Visual Studio Online before, but have used Team Foundation Service. Well Visual Studio Online is very similar to the web experience of TFS.

Creating Cards in Trello from Visual Studio Online

With a bit of configuration, it is possible to join up Trello and Visual Studio Online, so that when certain tasks are done in VS Online then it is communicated to Trello where it can create a new card for example.

This gives a great visual experience for when new work items are created and if you are the sort of place that have information radiators dotted around the office, can give a quick representation of the tasks as they are added to the project backlog.

Firstly go to Trello and get an Authorization token for Visual Studio Online here.

1

Applying for authentication token

2

Received authentication token

Now go to your Visual Studio Online account and go to the Admin section from the top right cog icon.

3

Visual Studio Online admin area

This tabbed area allows you to set up what are called Service Hooks, they are in preview at the moment so may be liable to change.

4

Service hooks tab

There are many services that you can hook into, here we choose Trello.

5

Setting up a trigger

Set up a trigger that will call an action when an event in VS Online is triggered.

6

Configuring an event

Enter what action you want to happen, here I want to create a card in a board I have set up specifically for my project MoonPhase. It is here you need to input the authentication token you got earlier.

7

The action

So now it is all set up.

8

All done

So by creating a new work item in my project backlog, a new card is created for me in Trello.

9

The cards as they are added to the Trello board

Happy coding.

Posted in Practices, Tooling

Connecting your Visual Studio Project to Visual Studio Online

I am a big fan of continous integration and automated builds and letting somebody else look after the infrastructure. I am a develoer and although quite happy to install Team City, Team Foundation Server etc, I would prefer somebody else to do the install (correctly) and well just look after it and make sure the hardware and database systems are working correctly. So when Microsoft announced last year that they launched Team Foundation Service for development and build in the cloud I had to have a look. Well it took some time to get off my butt and have a play around with it, so long infact that Microsodt ended up renaming it to Visual Studio Online. Personally I think this renaming was a big mistake, but I won’t delve too much into that here.

So how do you go about creating an application in Visual Studio and have it uploaded to Visual Studio Online?

Firtsly you need a Visual Studio online account, so go here first and sign up.

Now open up Visual Studio, I am using VS2013 here for this demo.

Create your project and make sure the boilerplate code builds ok.

Now go on over to Visual Studio Online and create a new project there

1

Give the project some details

2

It will now create it

4

All done.

5

Now go over to Visual Studio and right click the solution in Solution Explorer and choose to add it to source control.

6

You have a choice between TFS Version Control and Git. I am going to choose TFS for this.

7

It will now connect to your Team Foundation Service, you may need to input your credentials here. Choose your project from the listing it finds under your account in Team Foundation Service.

8

Now if you get an error such as this, don’t panic cancel your way back out.

10

Go to Team Explorer and choose the little plug icon to Connect to your team project.

11

Then click on the Select Team Projects link.

12

You now get a pop up, put a tick in the project ypu want to connect to. Why it doesn’t do this initially I don’t know.

13

You will see the project listed now.

14

Then go back and right click the solution in Solution Explorer like before and choose the project.

15

Now do a check in.

16

Give it a comment. I always state that it is the initial check in when doing this the first time.

17

Hey presto, you get a confirmation that it has been checked in and you get the Changeset number.

18

Go back to Visual Studio Online and navigate to your project and have a look at the changesets. You should have you latest change sets listed.

19

Right lets start adding some work items. Go to the Work sub menu and select New under Backlog items. Fill out the details and click on Add.

20

Back in Visual Studio, go to Team Explorer and click on Work Items.

21

Go to Product Backlog and double click it. This will run a query against your backlog items in Team Foundation Service.

22

There you go, you can read and make changes to the work item locally. Clicking on the Save Work Item button will propogate any changes back to the service.

23

I hope this quick run through helps you getting up and running with Visual Studio Online. Next I will explore doing automated builds using the Build functionality in Windows Azure.

Happy coding.

Posted in Enterprise, Practices, Tooling

Debugging a Windows 8 Store App on a Surface RT

While developing your Windows 8 Store App, you have two choices when it comes to debugging. The first is to debug on the machine you are developing with and the second is to set up remote debugging on another device and debug from your development machine whilst running the app on the second device. Here I will explain how to set up a Surface RT machine to allow debugging from a laptop when both are connected to a home wi-fi connection.

Here is the set up I used for this demo; simple stuff. Both devices are only connected to my home w-fi.

Surface and laptop set up

Surface and laptop set up

Firstly you need to install the Remote Tools for Visual Studio 2013, and choose just the ARM component.

Download choice from MSDN

Download choice from MSDN

Transfer this file over to your Surface device and run it on there. Normally installs are blocked on an RT device, however this is allowed to install.

This gives you an app to run under Visual Studio 2013, you will have to go to the All Apps screen to get access to it. You can then pin it to your Start Screen if you wish.

Program links on all apps screen

Program links on all apps screen

Running this app takes you to the desktop view and waits for incoming connections.

Note the name of the device:- here its GP_SURFACE

Remote debugging listening for connections

Remote debugging listening for connections

You can go to Tools >> Options and select the No Authentication radio button. This is not recommended, but it will do for this example.

Remote debugger connection properties

Remote debugger connection properties

Go to Visual Studio and choose Remote Device from the debugging drop down menu.

Visual Studio debugger choice

Visual Studio debugger choice

You may get an error with deployment, this is because authentication is set by default.

Deployment error

Deployment error

To fix this, right click the project file and go to properties.

Visual Studio properties option

Visual Studio properties option

This is where you can configure the authentication and the remote machine name. When doing this the first time Visual Studio will prompt you for the machine name, but if you need to change it in the future it is here under Properties.

Visual Studio debugging options

Visual Studio debugging options

Now when you run it, you will see on the Surface debugger that a connection has been made just prior to the app being deployed and run. You can now debug into your app.

Connection established on remote machine

Connection established on remote machine

Here is my setup with my app MoonPhase running in debug mode.

Hey presto! The app is running.

Hey presto! The app is running.

Happy coding.

Posted in Practices, Tooling, Uncategorized, Windows 8