Wednesday, June 30, 2010

.NET Framework 4 Client Profile available through Windows Update

.NET Framework now served through Windows Update

Beginning June 22, 2010 the .NET Framework 4 is available through WIndows Update to ease deployment.

The whole framework? No, only the "light" version, so called "Client Profile", which contains the features to develop a client application, including:

Common language runtime (CLR)

ClickOnce

Windows Forms

Windows Presentation Foundation (WPF)

Windows Communication Foundation (WCF)

Entity Framework

Windows Workflow Foundation

Speech

XSLT support

LINQ to SQL

Runtime design libraries for Entity Framework and WCF Data Services

Managed Extensibility Framework (MEF)

Dynamic types

Parallel-programming features, such as Task Parallel Library (TPL), Parallel LINQ (PLINQ), and Coordination Data Structures (CDS)

Debugging client applications

It does not include (meaning you still need to install the full .NET Framework 4.0 to use those features), for example:

ASP.NET

Advanced Windows Communication Foundation (WCF) functionality

.NET Framework Data Provider for Oracle

MSBuild for compiling

Now, it's on Windows update, will it install automatically?

It depends on the Windows Update settings, "the .NET Framework 4 Client Profile is released as a recommended update that may be installed automatically on Windows Vista and Windows 7. The Client Profile is released as an optional update for Windows XP. In Windows XP, you must manually run WU and select the .NET Framework 4 Client Profile".

.NET Framework 4 Client Profile:

  • Recommended Update on Windows Vista/7
  • Optional Update on Windows XP

Full .NET Framework 4:

  • Optional Update on Windows Server 2003, Windows Server 2008 and on Windows Server 2008 R2

More Information?

Tuesday, June 29, 2010

When using Remote Desktop the keyboard layout always defaults to EN (English)

Finally there's a solutionYou…

  • use a different keyboard layout than EN (English)
  • use Remote Desktop to connect to another machine
  • the default keyboard/input language is set to EN (regardless of your user settings)

… then this is your solution:

On the machine you connect to run the following .REG file:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout]
"IgnoreRemoteKeyboardLayout"=dword:00000001

Download: IgnoreRemoteKeyboardLayout.zip

Monday, June 28, 2010

Solution: Internet Explorer detected as mobile device

IE LogoProblem description:
"Internet Explorer redirects to mobile layout web site"
"Some websites are connecting to mobile version"
Why am I getting mobile sites? I'm using my desktop PC!
Solution: (as found in this thread)
  1. In the Windows registry navigate to the following key:
    HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\5.0\User Agent\Post Platform
  2. Remove the entry "Creative AutoUpdate v1.40.01"
  3. Close all Internet Explorer windows.
Background:
Some websites are scanning the user agent string for the word "PDA", unfortunately the word "Update", contains PDA. Thus, those websites present their mobile versions instead.

SMTH-AUTH errors with System.Net.Mail

net_v_webIf you are getting SMTH AUTH errors while trying to send e-mails using the SmtpClient to an smtp server that requires authentication, make sure that you call UseDefaultCredentials before settings the credentials.

So, order is important here!

using System.Net;
using System.Net.Mail;
...
using (var client = new SmtpClient())
{
client.Host = "smtp.teamfoundationserver.de";
  client.Port = 25;
client.UseDefaultCredentials = false;
client.Credentials = new NetworkCredential(username, password);
client.Send(message);
}

Good luck!

Code Contracts: don't forget to turn them on

dd491992_codecontracts_project(en-us)

If you use the new System.Diagnostics.Contracts classes like

int Div(int a, int b)
{
  Contract.Requires(b > 0);
  return a / b;
}

Do not forget to download the Code Contracts tool and turn on static and/or runtime checking of your code.

Otherwise the Contract.Requires statement above will just be ignored (thus the second parameter will not be checked)…

Notes:

  • If you use Contract.Requires<TException> you will receive an assert message telling you that you need to use the rewriter
    image
  • Alternatively, leave your pre-conditions as old-fashoned if-then-throw-statements, and end them with EndContractBlock, (contract tools recognize them as legacy-require statements).
    Beispiel aus den FAQs:

    void MyMethod(Foo foo)
    {
       if (foo == null) throw new ArgumentNullException(...);
       Contract.EndContractBlock();
       ... normal method code ...
    }

Setting Attribute value in VB.NET XML Literals

ms_net_rgb_webYou the receive compile error when using XML literals and try to set an attribute using quotation marks…

Error message: "Expected matching closing double quote for XML attribute value."

Your code might look similar to this fragment:

Results in an error:

Dim output = From item In items
  Select <Item ID="<%= item.ID %>">
  </Item>

What's wrong? Just Remove the quotation marks. The <% %> syntax will insert them later.

Works fine:

Dim output = From item In items
  Select <Item ID=<%= item.ID %>>
  </Item>

The result as XML:

<Item ID="1">
</Item>
<Item ID="2">
</Item>

Sunday, June 27, 2010

Visual Studio 2010 Keyboard Shortcuts Poster

VS_h_rgb

Reference cards for the default keybindings in Visual Studio 2010 for Visual Basic, Visual C#, Visual C++ and Visual F#

Download from Microsoft: Visual Studio 2010 Keybinding Cards

image

Saturday, June 26, 2010

Unable to display feeds in Internet Explorer 7/8

internet_explorer_7_logo_thumb[7]Problem Description:
After clicking on a subscribed feed in Internet Explorer you get a message that the feed could not be downloaded.
If you run Internet Explorer as an administrator (right-click "Run as Admin") feeds are displayed as expected.
Solution:
Equipped with administrative privileges change the integrity level of your feeds folder (located under %LOCALAPPDATA%\Microsoft\Feeds) to low by typing:
icacls feeds /setintegritylevel (OI)(CI)low
Related posts:

Wednesday, June 2, 2010

Maximum database size in SQL Server

sqlserver2008logo There's a limit for everything: do you know the maximum database size supported by SQL Server (32 and 64-bit)?

Well, no reason to panic. It's 524,272 terabytes (although a single database file is limited to 16 terabytes of data).

Further reading:

Northwindow database as OData service

The famous Northwind database is now available as WCF "OData" service from the web:

http://services.odata.org/Northwind/Northwind.svc/