by Jörg Jooss
20. February 2008 03:31
Thanks to everybody who attended Holger's and my session today at Microsoft Launch 2008 in Frankfurt and all the great feedback we've got.
I'll publish the slide deck on my blog tomorrow evening, since we're not sure about the official shipping vehicle, and for some of you time seems to be of the essence .
Update:
You can now download the slides in both PowerPoint 2007 and PowerPoint 2003/XP/2000 format. Please rename the PowerPoint 2007 file to "Launch.pptx".
Update 2:
I've moved the files to my SkyDrive.
by Jörg Jooss
17. February 2008 06:08
This is a very brief summary of changes I've observed after installing the RTM version of Windows Vista Service Pack 1 on my Vista Ultimate x64 machine:
WCF developers beware: After setup, all WAS listener adapters are shut down and set to disabled. I'm not sure why this happens, but all your WCF services that use TCP, MSMQ, or Named Pipe transports will of course no longer work. Make sure that these services are enabled after installing SP1.
WCF and web developers rejoice: IIS Manager now has a lot more functionality than in Vista RTM:
Protocols can now be enabled in the GUI. No more appcmd.exe set app "Default Web Site/YourService" /enabledProtocols:http,net.pipe,net.tcp required. You can set these in your application's advanced settings.
HTTP caching headers can now be set in the GUI. Unfortunately, my previous remark of a few implementation shortcomings remains true. The GUI lets you set /clientCache.cacheControlMode:DisableCache, /clientCache.cacheControlMode:UseMaxAge, and /clientCache.cacheControlMode:UseExpires, but not custom strings, so don't forget about appcmd.exe completely.
There's way more—make sure to check out all the new configuration options!
75ac04c5-2b6c-41a8-bb40-fbffff11166d|0|.0
Tags: .NET
.NET
by Jörg Jooss
22. August 2007 10:23
While preparing my home machine for Visual Studio 2008 Beta 2, I found that uninstalling the .NET Framework 3.5 Beta 1 seems to break the ASP.NET 2.0 AJAX Extensions in Visual Studio 2005. After uninstalling, every time I tried to drag a AJAX control from the Toolbox to the design surface, Visual Studio 2005 complained it coudn't find the System.Web.Extensions.dll. To fix that, delete the existing AJAX Extensions tab from the Toolbox and recreate it using Add Tab and Choose Items…
(I also did a repair installation of the ASP.NET 2.0 AJAX Extensions as well, but I don't think that was necessary.)
by Jörg Jooss
29. July 2007 10:28
I've had a couple of inquiries over the last week, to which my response rate was rather sluggish. I was in Seattle attending TechReady 5, a Microsoft internal event similar to TechEd. Since all content is MS confidential, I cannot really say anything about it here. But I sure had a heck of a time listening and talking to .NET luminaries like Scott Guthrie, Pat Helland, Justin Smith, Anson Horton, or Greg Leake (who's just creating some major buzz with .NET StockTrader).
by Jörg Jooss
1. March 2007 05:30
MSDN TV is gone, but the German Developer Strategy & Group strikes back with a new developer news show recorded at the MTC Munich!
Watch Microsoft Developer News Februar 2007
I wonder whether Carmen Herrmann checked with Erica Wiechers before agreeing to host the show
PS: If there seems to appear a faint sound of an espresso machine grinding coffee during the recording, that might have been yours truly…
PPS: Of course it's all in German.
by Jörg Jooss
6. November 2006 20:09
Finally, it's here.
And for good measure, make sure to grab Beta 2 of the AJAX ASP.NET Extensions.
by Jörg Jooss
24. September 2005 05:11
The .NET 2.0 BCL includes some significant enhancements for System.Net.WebClient, like async I/O, easy access to response headers, proxy handling…
Many of these advanced features in .NET 1.1 can only be used by programming directly with System.Net.HttpWebRequest and System.Net.HttpWebResponse. But in order to use a proxy server for your HTTP request, you don't need to do this. Even though there's no Proxy property in WebClient in .NET 1.1, you can still use a proxy through configuration (machine.config – messy) or through code with System.Net.GlobalProxySelection.Select. Just set the proxy before using your WebClient instance.
1: GlobalProxySelection.Select = new WebProxy("http://www-proxy.t-online.de:80", true); 2: WebClient client = new WebClient(); 3: byte[] bytes = client.DownloadData("http://www.google.com/search?q=ASP.NET");
36c9fbeb-465f-4aae-b44f-0d079d76c1b9|0|.0
Tags: .NET
.NET
by Jörg Jooss
18. September 2005 02:59
The .NET 2.0 BCL offers various means to create URL encoded strings. One can use System.Uri or System.UriBuilder to create RFC 2396 compliant URLs, or System.Web.HttpUtiliy.UrlEncode(System.String, System.Text.Encoding) to URL encode individual strings. Unfortunately, neither System.Uri nor System.UriBuilder allow one to specify a character encoding for URL encoding. Both classes use UTF-8 exclusively. System.Uri is nonetheless capable of representing URIs whose query strings are based on encodings other than UTF-8, if the user creates a System.Uri from an already URL encoded string. System.Web.HttpUtiliy.UrlEncode(System.String, System.Text.Encoding) on the other hand cannot encode entire query strings, only individual names or values, so a developer must parse query string and encode each name or value individually.
Enter UrlEncoder. This class is able to encode or reencode System.Uri and System.String objects with arbitrary character encodings. Enjoy.
Note for Firefox users: The formatted code below may display scroll bars below some of the longer lines. To get rid of them, reduce the pixel size for fixed width fonts — sorry!
1: using System;
2: using System.Collections.Specialized;
3: using System.Text;
4: using System.Web;
5:
6: namespace JoergJooss.SharpAgent.Http
7: {
8: /// <summary>
9: /// Provides URL encoding capabilities for <see cref="System.Uri"/> and
10: /// <see cref="System.String"/> using arbitrary character encodings.
11: /// </summary>
12: /// <remarks>
13: /// <para>
14: /// The .NET BCL offers various means to create URL encoded strings
15: /// or URI objects with query strings. One can use <see cref="System.Uri"/> or
16: /// <see cref="System.UriBuilder"/> to create RFC 2396 compliant
17: /// URLs, or <see cref="System.Web.HttpUtiliy.UrlEncode(System.String, System.Text.Encoding)"/>
18: /// to URL encode individual strings. Unfortunately, neither
19: /// <see cref="System.Uri"/> nor <see cref="System.UriBuilder"/> allow one
20: /// to specify a character encoding for URL encoding. Both classes use
21: /// UTF-8 exclusively. <see cref="System.Uri"/> is nonetheless capable
22: /// of representing URIs whose query strings are based on encodings
23: /// other than UTF-8, if the user creates a <see cref="System.Uri"/> from
24: /// an already URL encoded string.
25: /// <see cref="System.Web.HttpUtiliy.UrlEncode(System.String, System.Text.Encoding)"/>
26: /// on the other hand cannot encode entire query strings, only individual
27: /// names or values. <see cref="JoergJooss.SharpAgent.Http.UrlEncoder"/>
28: /// is able to encode or reencode <see cref="System.Uri"/> and
29: /// <see cref="System.String"/> objects with arbitrary character encodings.
30: /// </para>
31: /// <para>
32: /// <see cref="JoergJooss.SharpAgent.Http.UrlEncoder"/> instances are
33: /// immutable. All non-inherited instance methods are thread safe.
34: /// </para>
35: /// </remarks>
36: public sealed class UrlEncoder
37: {
38: private readonly Encoding encoding;
39:
40: private static readonly UrlEncoder utf8;
41: private static readonly UrlEncoder latin1;
42: private static readonly UrlEncoder latin9;
43:
44: static UrlEncoder()
45: {
46: utf8 = new UrlEncoder(Encoding.UTF8);
47: latin1 = new UrlEncoder(Encoding.GetEncoding(28591));
48: latin9 = new UrlEncoder(Encoding.GetEncoding(28605));
49: }
50:
51: /// <summary>
52: /// Initializes a new instance of the
53: /// <see cref="JoergJooss.SharpAgent.Http.UrlEncoder"/> class
54: /// that uses the specified character encoding.
55: /// </summary>
56: /// <param name="encoding">An encoding.</param>
57: /// <exception cref="System.ArgumentNullException">
58: /// encoding is <c>null</c>.
59: /// </exception>
60: public UrlEncoder(Encoding encoding)
61: {
62: if (encoding == null)
63: {
64: throw new ArgumentNullException("encoding");
65: }
66:
67: this.encoding = encoding;
68: }
69:
70: /// <summary>
71: /// Gets the encoding used by this instance.
72: /// </summary>
73: /// <value>
74: /// A <see cref="System.Text.Encoding"/> object representing the
75: /// character encoding that is used by this instance.
76: /// </value>
77: public Encoding Encoding
78: {
79: get { return encoding; }
80: }
81:
82: /// <summary>
83: /// Gets a <see cref="JoergJooss.SharpAgent.Http.UrlEncoder"/> for the
84: /// Latin 1 (ISO-8859-1) character encoding.
85: /// </summary>
86: public static UrlEncoder Latin1
87: {
88: get { return latin1; }
89: }
90:
91: /// <summary>
92: /// Gets a <see cref="JoergJooss.SharpAgent.Http.UrlEncoder"/> for
93: /// the Latin 9 (ISO-8859-15) character encoding.
94: /// </summary>
95: public static UrlEncoder Latin9
96: {
97: get { return latin9; }
98: }
99:
100: /// <summary>
101: /// Gets a <see cref="JoergJooss.SharpAgent.Http.UrlEncoder"/> for
102: /// the UTF-8 character encoding.
103: /// </summary>
104: public static UrlEncoder Utf8
105: {
106: get { return utf8; }
107: }
108:
109: /// <summary>
110: /// Gets the Base Class Library's default Encoding object
111: /// used by <see cref="System.Uri"/> and
112: /// <see cref="System.UriBuilder"/>.
113: /// </summary>
114: internal static Encoding DefaultUriEncoding
115: {
116: get { return Encoding.UTF8; }
117: }
118:
119: /// <summary>
120: /// Creates a new Uri object from an existing Uri but
121: /// using the UrlEncoder's character encoding.
122: /// </summary>
123: /// <param name="uri">A URI.</param>
124: /// <returns>The URI whose str string is encoded with
125: /// the UrlEncoder's character encoding.</returns>
126: /// <exception cref="System.ArgumentNullException">
127: /// uri is <c>null</c>.
128: /// </exception>
129: public Uri Encode(Uri uri)
130: {
131: if (uri == null)
132: {
133: throw new ArgumentNullException("uri");
134: }
135:
136: UriBuilder ub = new UriBuilder(uri);
137: ub.Query = EncodeString(uri.Query);
138:
139: return ub.Uri;
140: }
141:
142: /// <summary>
143: /// Creates a new Uri object from a string
144: /// using the UrlEncoder's character encoding.
145: /// </summary>
146: /// <param name="uri">A URI.</param>
147: /// <returns>The URI whose str string is encoded with
148: /// the UrlEncoder's character encoding.</returns>
149: /// <exception cref="System.ArgumentNullException">
150: /// uri is <c>null</c>.
151: /// </exception>
152: public Uri Encode(string uri)
153: {
154: return Encode(new Uri(uri));
155: }
156:
157: /// <summary>
158: /// URL encodes a string with the UrlEncoder's encoding.
159: /// </summary>
160: /// <remarks>
161: /// <paramref name="str"/> is URL decoded before it is being
162: /// encoded. This method assumes UTF-8 as original character
163: /// encoding.
164: /// </remarks>
165: /// <param name="str">A string.</param>
166: /// <returns>A URL encoded representation of <paramref name="str"/>
167: /// using the UrlEncoder's encoding.
168: /// </returns>
169: public string EncodeString(string str)
170: {
171: return EncodeString(str, null);
172: }
173:
174: /// <summary>
175: /// URL encodes a (potentially already URL encoded) string
176: /// with the UrlEncoder's encoding.
177: /// </summary>
178: /// <remarks>
179: /// <paramref name="str"/> is URL decoded before it is being
180: /// encoded, using <paramref name="enc"/> as original character
181: /// encoding.
182: /// </remarks>
183: /// <param name="str">A string.</param>
184: /// <param name="enc">The original character encoding. If <c>null</c>
185: /// is passed, UTF-8 is assumed. </param>
186: /// <returns>A URL encoded representation of <paramref name="str"/>
187: /// using the UrlEncoder's encoding.
188: /// </returns>
189: public string EncodeString(string str, Encoding enc)
190: {
191: if (str == null)
192: {
193: throw new ArgumentNullException("uri");
194: }
195:
196: if (str == String.Empty)
197: {
198: return String.Empty;
199: }
200:
201: StringBuilder sb = new StringBuilder(str.Length);
202: NameValueCollection coll = HttpUtility.ParseQueryString(
203: str,
204: enc != null ? enc : DefaultUriEncoding);
205:
206: foreach (string key in coll)
207: {
208: string encodedKey = HttpUtility.UrlEncode(key, Encoding);
209: string encodedValue = HttpUtility.UrlEncode(coll[key], Encoding);
210: sb.AppendFormat("{0}={1}&", encodedKey, encodedValue);
211: }
212:
213: sb.Length -= 1;
214: return sb.ToString();
215: }
216: }
217: }
by Jörg Jooss
19. May 2005 09:33
It's been a while since I started porting my venerable learning project XmlView.NET (an XML viewer that includes XSD schema validation) to .NET 2.0 Beta 2. The original .NET 1.1 project uses NUnit to the test the application's core (or model, if you will), so I was anxious to see how VSST's unit testing facilities stack up against NUnit and VS .NET 2003:
First, it's very annoying that MS introduced a new API that does not follow the classic xUnit approach. Instead of TestFixture, we now have TestClass. Instead of SetUp and TearDown, we now have TestInitialize and TestCleanup. You can get around this by using alias directives, but this is just a kludge.
The current performance is rather poor. This is already one of the top bugs in the MSDN product feedback center.
If you've ever seen any xUnit test runner, you know what the green bar is. There's no green bar in VS 2005. It puts green checkmarks next to each test that has run successfully. I prefer having a green bar, as it is a much more obvious indicator than simple check marks.
Microsoft.VisualStudio.QualityTools.UnitTesting.Framework.Assert offers generics support, e.g. Assert.AreEqual<T>—neat.
The ClassInitialize (think TestFixtureSetUp), ClassCleanup (think TestFixtureTearDown), AssemblyInitialize (that's new), and AssemblyCleanup (new as well) attributes don't work as advertised and are not properly documented—typical beta woes.
by Jörg Jooss
23. April 2005 23:40
My first week of playing around with Visual Studio 2005 Beta 2 can be easily summarized as "downloading and installing".
Unless you are in the movie or music file sharing business, downloading the 3.75 GB Team Edition really puts both your patience and your Internet access to test. What seemed a bit strange to me is that there's currently no Professional Edition available for download. That's why I chose Team Edition, even though I won't likely look into the "Team" specific features.¹ Sticking with my DSL flat rate proves unparalleled wisdom
Installing this beast was another story. I didn't use a clean Windows image to install Beta 2. Instead, I cloned my regular workstation's hard disk (an up-to-date Windows XP SP2 installation running VS2003 .NET, Office XP, various Java develepment tools, and some games) and used the clone to perform the installation.
Basically, I ran into two problems:
Installing SQL Server 2005 Express Edition failed over and over again. After digging through the README file, I found one important hint: "When installing Visual Studio on a machine with SQL Server already installed, uncheck SQL Server Express April CTP."
Ok, my original setup included MSDE 2000A, so uninstalled that and started over again. Still, no joy.
Next, I tried to run SQL Server 2005 Express Edition's setup program manually. But that didn't work either, complaining that some installation package seemed to be corrupt. Was my download screwed up? I quickly downloaded the SQL Server 2005 Express Edition standalone package and tried to install that. Lo and behold, it failed with more or less the same error message as the VS 2005 setup program before.
Thus, I started searching through the Product Feedback Center, and luckily found some interesting hints. It all boiled down to this: Make sure to run the installation including advanced options—that's a checkbox at the start of installation wizard of SQL Server 2005 Express Edition's setup porgram. This will allow you to select the service account that run your SQL Server instances. Instead of "network service", choose "local service". This may not be the best option for real life deployment, but it at least allows you to install the bloody thing…
Another note: The installation program suggests installing a named instance SQLEXPRESS. The database scripts of the .NET 2.0 Framework Beta 2 samples use that instance as well, so make sure to use this name or change the SQL scripts accordingly.
Visual Studio's failed to load its Unit Test facilities. Silly me, because on page 17 of the known issues document it says: "Team Developer and Test tools do not function if Team Foundation Client is not also installed." Of course I tried to be smart when installing VS 2005 and chose not to install Team Foundation Client, since I didn't have Team Foundation Server deployed anyway. OK, reinstalling the full blown product fixed that easily. Mental note: This is the era of 100+ GB hard disks. No reason to be stingy with disk space.
So here we are!
¹ Actually, I'm highly interested in Team Edition's unit testing features. I do think though that these should be included in all editions of Visual Studio 2005. And I'm not alone here…