Hacker News new | ask | show | jobs
by drivebyacct2 5214 days ago
Someone hasn't tried to do Azure development with Visual Studio if they think this Release/Debug type management is a nightmare. Oh let me name the number of inconsistent ways of transforming config files depending on environments.
2 comments

... or tried doing iOS development.

Granted, given all the complex permutations and needs the iOS development team and XCode and Apple App Store has to support, there's probably a lot of method to the madness, a lot of "necessary" complexity. The problem is that if you zoom out a bit, much of the complexity one originally thinks is necessary, is not actually necessary, if you change one or more of your premises.

Oh I love the way Xcode handles this. Just setup multiple targets and use a preprocessor macro to switch between configurations. A nice drop down to select from when you're building. It's bliss! Learning the iOS way took me way less time than figuring it out for Android and it was a nicer solution.
I think people view this as too techy of a solution and I think people rely on their IDEs for this sort of thing too much, but after trying to automate my Azure deployments (local web, dev emulator, prod), I finally gave up and just resorted to having to manually comment/uncomment things in files and flex dropdown boxes across Visual Studio everytime I wanted to change environments. And I paid the 45-minute deploy time tax every time I forgot to change one of them when I deployed.

I'd have killed for a simple macro syntax to use within my config files. Hell, at one point I was actually (stupidly, one of the more futile tasks I've ever tried) editting the MSBUILD files by hand.

Not sure why this keeps getting downvoted. It's a well known "dirty secret". Just try searching for XML Config Transforms as that's theoretically the clean way of solving this problem. It's only natively supported for certain projects, can be hacked into more via manually editting MSBUILD and CSPROJ files and worst of all, breaks miserably during the Azure deploy as VS simply skips some of MSBUILD files and simply decides to package things from your original source tree as it sees fit. Meaning it completely and utterly fails at the one good thing it can do as it only works in fairly contrived situations.

This means I have to manually edit connection strings, debug settings and more that vary between our local ASP.NET servers, our intranet dev server, our local emulator environment and then debug/prod Azure instances.

If I'm mistaken I would be ecstatic to be corrected. Hell, I'd have paid money out of pocket for a macro/conditional solution for this problem when I was working on this project. Also, if it's just too off-topic, please accept my sincere apologies. I just found it kinda nitpicky to pick on Android for this, although I can sympathize with the author if they're accustomed to more "open" languages and frameworks that are more tool-friendly.