|
|
|
This is more of a place for me to store something I use fairly often, but can never remember off the top of my head. This script, when run as administrator, will install all the features of IIS for developing on Windows 7. Mind you, this is the prettified* version so it’s web-readable. START /WAIT DISM /Online /Enable-Feature /FeatureName:IIS-ApplicationDevelopment /FeatureName:IIS-ASP /FeatureName:IIS-ASPNET /FeatureName:IIS-BasicAuthentication /FeatureName:IIS-CGI /FeatureName:IIS-ClientCertificateMappingAuthentication /FeatureName:IIS-CommonHttpFeatures /FeatureName:IIS-CustomLogging /FeatureName:IIS-DefaultDocument /FeatureName:IIS-DigestAuthentication /FeatureName:IIS-DirectoryBrowsing /FeatureName:IIS-FTPExtensibility /FeatureName:IIS-FTPServer /FeatureName:IIS-FTPSvc /FeatureName:IIS-HealthAndDiagnostics /FeatureName:IIS-HostableWebCore /FeatureName:IIS-HttpCompressionDynamic /FeatureName:IIS-HttpCompressionStatic /FeatureName:IIS-HttpErrors /FeatureName:IIS-HttpLogging /FeatureName:IIS-HttpRedirect /FeatureName:IIS-HttpTracing /FeatureName:IIS-IIS6ManagementCompatibility /FeatureName:IIS-IISCertificateMappingAuthentication /FeatureName:IIS-IPSecurity /FeatureName:IIS-ISAPIExtensions /FeatureName:IIS-ISAPIFilter /FeatureName:IIS-LegacyScripts /FeatureName:IIS-LegacySnapIn /FeatureName:IIS-LoggingLibraries /FeatureName:IIS-ManagementConsole /FeatureName:IIS-ManagementScriptingTools /FeatureName:IIS-ManagementService /FeatureName:IIS-Metabase /FeatureName:IIS-NetFxExtensibility /FeatureName:IIS-ODBCLogging /FeatureName:IIS-Performance /FeatureName:IIS-RequestFiltering /FeatureName:IIS-RequestMonitor /FeatureName:IIS-Security /FeatureName:IIS-ServerSideIncludes /FeatureName:IIS-StaticContent /FeatureName:IIS-URLAuthorization /FeatureName:IIS-WebDAV /FeatureName:IIS-WebServer /FeatureName:IIS-WebServerManagementTools /FeatureName:IIS-WebServerRole /FeatureName:IIS-WindowsAuthentication /FeatureName:IIS-WMICompatibility /FeatureName:WAS-ConfigurationAPI /FeatureName:WAS-NetFxEnvironment /FeatureName:WAS-ProcessModel /FeatureName:WAS-WindowsActivationService *Interesting that “prettified” is a word according to Live Writer.
I’ve been working on getting a testable ADFS environment setup for evaluation and development. Basically, because of laziness (and timeliness), I’m using Windows Virtual PC to host Server 2008 guests for testing. I didn’t have the time to setup a fully working x64 environment, so I couldn’t go to R2. One of the issues I’ve been running into is that the Windows Service won’t start properly. Or rather, at all. It’s running into a timing issue when running as Network Service, as its timing out while waiting for a network connection. More Googling with Bing returned the fix for me from here. In the file [C:\Program Files\Active Directory Federation Services 2.0\Microsoft.IdentityServer.Servicehost.exe.config] add this entry to it: <runtime> <generatePublisherEvidence enabled="false"/> </runtime> Other places have noted that this isn’t a problem on R2. I haven’t tested this yet, so I don’t know if it’s true.
Only took a couple quick searches Googling with Bing, but in IIS 7 if you create a request for a certificate, create it by a CA and then complete the request, and find it blows up with this message box: CertEnroll::CX509Enrollment::p_InstallResponse: ASN1 bad tag value met. 0x8009310b (ASN: 267) All it means is that the CA that issued the certificate isn’t trusted on the server. I came across this in a test environment I was building. I had a Domain with CA Services, and a server that existed outside the domain. I used the domain CA to create the certificate, but because the web server wasn’t part of the domain, it didn’t trust the CA. My fix was to add the CA as a trusted Root Authority on the web server.
I’ve been looking at ways of parsing types and values from text without having to do switch/case statements or explicit casting. So far, based on my understanding of statically typed languages, is that this is impossible with a statically typed language. <Question> Is this really true?</Question> Given my current knowledge, my way of bypassing this is to use the new dynamic type in .NET 4. It allows me to implicitly assign an object without having to cast it. It works by bypassing the type checking at compile time. Here’s a fairly straightforward example: static void Main(string[] args)
{
Type boolType = Type.GetType("System.Boolean");
Console.WriteLine(!parse("true", boolType));
Type dateTimeType = Type.GetType("System.DateTime");
DateTime date = parse("7/7/2010", dateTimeType);
Console.WriteLine(date.AddDays(1));
Console.ReadLine();
}
static dynamic parse(string value, Type t)
{
return Convert.ChangeType(value, t);
}
Now, if I were to do something crazy and call
DateTime someDate = parse(“1234”, Type.GetType(“System.Int32”));
a RuntimeBinderException would be thrown because you cannot implicitly convert between an int and a DateTime.
It certainly makes things a little easier.
Unfortunately I will be unable to attend the ALM presentation later this afternoon, but luckily I was able to catch it in Montreal last week. When I think of ALM, I think of the development lifecycle of an application – whether it be agile or waterfall or whatever floats your boat – that encompasses all parts of the process. We’ve had tools over the years that help us manage each section or iteration of the process, but there was some obvious pieces missing. What about the SQL? Databases are essential to pretty much all applications that get developed nowadays, yet for a long time we didn’t have much in the way to help streamline and manage the processes of developing database pieces. Enter ALM for SQL Server. DBA’s are now given all the tools and resources developers have had for a while. It’s now easier to manage Packaging and Deployment of Databases, better source control of SQL scripts, and something really cool: Database schema versioning. I have a story: Sometime over the last couple years, a developer wrote a small little application that monitors changes to database schemas through triggers, and then sync’ed the changes with SVN. This was pretty cool. It allowed us to watch what changed when things went south. Problem was, it wasn’t necessarily reliable, it relied on some internal pieces to be added to the database manually, and made finding changes through SVN tricky. With ALM, versioning of databases happens before deployment. Changes are stored in TFS, and its possible to rollback certain changes fairly easily. Certain changes. :) That’s pretty cool.
We just finished the SQL Server 2008 R2 Launch Keynote. That’s quite a mouthful. One of the problems I saw with this release was that not a lot of people knew what went into it. R2 products are strange in that people just sort of assume they are nothing more than Service Pack releases. Well, this isn't actually the case.
There were some really cool things shown in the keynote this morning. PowerPivot being my all-time favorite. Excel on Analysis Services steroids would be an apt description. Analyzing huge sets of data within Excel was sort of tricky because you ran into a million row limit. This was only half the problem though. Performance was painful if you had that many rows in Excel -- sluggish at best. PowerPivot helps change this dramatically. The demo just shown pulled down 100,000,000 rows of data into Excel, filtered down to 19, and then filtered back up to the initial set -- all within a second. That's pretty cool.
Just don't hit print.
Earlier today, Cory Fowler suggested I write up a post discussing the differences between the AntiXss library and the methods found in HttpUtility and how it helps defend from cross site scripting (xss). As I was thinking about what to write, it occurred to me that I really had no idea how it did what it did, and why it differed from HttpUtility. <side-track>I’m kinda wondering how many other people out there run in to the same thing? We are told to use some technology because it does xyz better than abc, but when it comes right down to it, we aren’t quite sure of the internals. Just a thought for later I suppose. </side-track> A Quick Refresher To quickly summarize what xss is: If you have a textbox on your website that someone can enter text into, and then on another page, display that same text, the user could maliciously add in <script> tags to do anything it wanted with JavaScript. This usually results in redirecting to another website that shows advertisements or try’s to install malware. The way to stop this is to not trust any input, and encode any character that could be part of a tag to an HtmlEncode’d entity. HttpUtility does this though, right? The HttpUtility class definitely does do this. However, it is relatively limited in how it encodes possibly malicious text. It works by encoding specific characters like the the brackets < > to < and > This can get tricky because it you could theoretically bypass these characters (somehow – speculative). Enter AntiXss The AntiXss library works in essentially the opposite manner. It has a white-list of allowed characters, and encodes everything else. These characters are the usual a-z 0-9, etc characters. Further Reading I’m not really doing you, dear reader, any help by reiterating what dozens of people have said before me (and probably did it better), so here are a couple links that contain loads of information on actually using the AntiXss library and protecting your website from cross site scripting:
WinFS has been puttering around my idle thoughts lately. Yep, weird. Why is it still available on MSDN and TechNet subscriptions? Food for thought.
A few months ago some friends of mine at Microsoft told me about a step-up promotion that was going on for the release of Visual Studio 2010. If you purchased a license for Visual Studio 2008 through Volume Licensing, it would translate into the next version up for the 2010 version. Seems fairly straightforward but here is the actual process:
So we upgraded our licenses to benefit from the step up. Problem was, we couldn’t access any of the applications we were licensed to use (after RTM, obviously). After a week or so of back and forth with Microsoft we finally got it squared away. A lot of manual cajoling in the MSDN Sales system, I suspect, took place. It turns out a lot of people were running into this issue.
Someone told me this issue got elevated to Steve B (not our specific issue, but the step-up issue in general). I’m curious where things actually went wrong. I suspect the workflow that was in place at the business level wasn’t in place at the technical level, so everything ended up becoming a manual process. However, that is purely speculative. Talk with Steve if you have questions.
In the end, everything worked out. I got Visual Studio 2010 installed (which fricken rocks, btw), and my productivity will go up immensely once we get TFS deployed. After of course, it has the necessary drop while I’m downloading and playing with the new MSDN subscription.
For those that are interested in the promotion, it’s still valid until the end of April. Contact your account rep’s if you are interested.
About 10 minutes ago I was told to sit down and open my laptop. The event is about start, and the place is extremely crowded. Barnaby Jeans is on stage doing the usual intro. Twitter, blog, twit tweet tweet tweet #vs2010. Sean Graglia hits the stage. Today VS2010 and .NET 4.0 were released. It makes you a little nostalgic about the old days of development. The way things were done, the way teams worked, the way we tested. It’s changed quite a bit since a quarter century ago. We used to be proud of a user interface that worked on an 80x24 printout. Notsomuch anymore. We now need a new way of doing things. Visual Studio 2010 can help us with this. Whether we want to deliver to conventional devices, or things like the phone, or even the cloud, Visual Studio can help us from inception to release. So here we have Keith Yedlin from Corp up to now discuss the value of 2010. First up is multi-CPU. .NET 4.0 has created the ability to easily multi-thread processes for faster processing. That’s actually pretty cool. Multi-threading applications is for lack of a better word, terrible. It’s hard to do natively, its hard to do in Managed code, and it’s even harder to figure out what’s going on after the fact. Now, that brings up an interesting thought. Debugging can be tricky. Visual Studio 2010 has introduced something pretty awesome. You can now create trace files for the debugger, and while that’s not all that interesting, you can load that back into the debugger from a remote PC and run through exactly what happened. That is pretty fricken awesome. Team Foundation Server TFS was first released in 2005. It was tricky to use, and the learning curve was fairly high. Oh, and it was bloody expensive. 2010 has changed that entirely. It’s now easier to use, easier to manage, and cost is much more reasonable (read: free version - FTW). This can (and does) easily translate into faster time to market, more bug/test coverage, and overall better code. Win-win-win. More to come.
|
|
|