开发者

Local Testing and Debugging Facebook iframe app (Windows Azure)

I wonder what the best way to test and debug facebook iframe applications locally (using the facebook c# toolkit and the azure toolkit)?

When i try to debug it's always starting the Compute Emulator on a different port.

Basically i want to have a special facebook iframe app pointing to a specific port on local开发者_如何学运维host (e.g. http://localhost:81) and after pushing the debug button that my app url (e.g. http://apps.facebook.com/myspecificappdev) is being started in my browser (with debug functionality).

I found this thread but unfortunatly this didn't help me a lot: http://azuretoolkit.codeplex.com/discussions/207487

What's the best way to debug such applications? Is their maybe a sample project which already has that part set up correctly?


Ok, here is what we do (at Thuzi). We set up an dedicated IIS web site for our code. We create a bogus domain like fbapp.mycompanysdomain.com and then we edit your machine's (or other machine's) Hosts file to point to the proper IP address. When we set up the site in IIS we use a host header which means that we don't need to worry about port numbers. When we debug we simply attach to the process.

So you point your web browser to the FB URL and it should always land on your web server (whether you are debugging locally or not). I know this sounds like a little more work, but it ends up being so much easier in the long run and better reflects what will ultimately happen. I realize if you are using any kind of storage then you will need to start that up, but it's still a lot easier this way..


If your app is simply a website, then you don't need to run the compute emulator to run it. I would setup the site so that it runs on IIS on a specific port, then debug the website project, not the cloud project.

There is a bit more to it than just that however. If you're using development storage then you'll need to start that yourself as it won't automatically be started when you debug the website. If you have a RoleEntryPoint class then you need to be aware that none of that code will be called. Also if you make use of anything in RoleEnvironment (like settings) you'll need to put a wrapper around those items so that they'll still work when not running under the emulation environment (RoleEnvironment.IsAvailable is very useful for detecting this). A setup like this is very useful during development because when you make small changes to CSS of JavaScript you don't need to restart the compute emulator to see your changes.


You're on the right track. You need to create a new facebook app and point the iframe / canvas / tab url to localhost with the specific port cassini chose for the project.


What I did to ensure the the windows azure app stays on the same port:

I placed this as a pre-build event: "C:\Program Files\Windows Azure SDK\v1.4\bin\csrun.exe" /devfabric:shutdown

This makes it better but it's still switching port sometimes

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜