Feed Subscribe
Exception has been thrown by the target of an invocation.


VS2010 Bug: Entity Data Model Wizard disappears after selecting “Generate from Database”

by ondrejsv 6. June 2010 17:55

Today I found another annoying bug in Visual Studio 2010. I often work connected to my company LAN via VPN and I have generated some entity data models from databases over the wire in the past. Entity Data Model Wizard which runs when you add a new “ADO.NET Entity Data Model” item in Visual Studio has a “nice feature” that it remembers all connections you entered into it. Of course, if you disconnect from LAN, those connections are not available. If you are unlucky enough, one of those connections may be the first one and default in the combobox where you can select an existing connection to base your EDMX on. Visual Studio probably tries to get information on tables or whatever from the database but if the database is not reachable, it fails very silently and closes the window instead of letting you to select another connection or create a new one. #fail

Fortunately, these connections are the same you see in the Data Connections node of the Server Explorer. So delete all of those which are remote and you have no connection to them any more and the Data Model Wizard would behave properly.

Tags:

How to debug PHP applications on Windows

by ondrejsv 2. June 2010 00:20

If you need to dwelve into some PHP stuff and do not want to leave your comfortable Windows environment, just read on. It’s easy and no Apache will be harmed in this process.

Disclaimer: It’s been almost 10 years since I wrote the last serious line in PHP (PHP 3 then), so it’s possible that there is another way to debug PHP applications, or that I do not do things ideally or in the most elegant way but it did work for me.

You can install PHP conveniently and make it play nicely with IIS via the Microsoft Web Platform Installer. You then need some IDE to edit and debug the application. Microsoft Expression Web supports PHP but obviously not debugging. If you don’t mind spending some bucks, you can buy VS.Php or other similar product and use Visual Studio to do all PHP magic and stop reading. Or you may touch the other side of the world and download Eclipse with PHP Developer Tools (PDT) embedded. Unpack it but do not run yet. Download XDebug tool; note that you must download version that matches your PHP version and build flavor (if you don’t know, they have a fantastic tool that tells you what you want). Unpack it to any folder of your choice, open PHP.ini (by default in C:\Program Files\PHP) and at the very end of the file paste these lines:

[xdebug] xdebug.remote_enable=1 xdebug.remote_host="localhost" xdebug.remote_port=9000 xdebug.remote_handler="dbgp" zend_extension = C:\Program Files\php\plugins\php_xdebug-2.1.0RC1-5.2-vc6-nts.dll

Of course, the path in the last line should reflect the folder you unpacked XDebug zip into. Also note that if you have some non-standard build of PHP (on Windows it means something else than non-debug non-thread-safe), you may need to change the last line – read full instructions.

Verify that XDebug is correctly installed by running php.exe –m. The last line should read:

[Zend Modules] Xdebug

Restart IIS (iisreset) and now you may fire Eclipse. Go to Windows/Preferences/PHP/Debugger and change it from default Zend Debugger to XDebug.

Create a new file, type in some PHP code, set a breakpoint (Ctrl+Shit+B? What the…? I must find a way to change its key bindings to Visual Studio ones) and run. Yes, it works :-) :

image

Tags: