The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 1,995 other followers

Archive for September 6th, 2011

EmbarcaderoTechNet’s Channel – YouTube

Posted by jpluimers on 2011/09/06

EmbarcaderoTechNet published a couple of interesting videos on YouTube covering Delphi XE2 including FireMonkey HD/3D, FireMonkey xPlatformVCL Styles and more.

All of them short (couple of minutes each) studio work with good video and audio quality (they default to 360p, but most are available in 720p HD, some just in 480p).

–jeroen

Via: EmbarcaderoTechNet’s Channel – YouTube.

Posted in Delphi, Development, FireMonkey, Software Development | Leave a Comment »

Unbelievable: Dutch Government made Microsoft agree to keep Microsoft customers vulnerable to fake digital certificates from DigiNotar by postponing Windows Updates for Dutch users. #fail

Posted by jpluimers on 2011/09/06

English translation of the link title below: Dutch Government forces Microsoft to delay Windows Update.

Google Translate of the linked article.

Why? Because it will give the Dutch Government more time to install certificates of which fake copies can exist because of the DigiNotar hack back in July 2011 and the resulting issuance of fraudulent certificates.

This is a big #fail for the Dutch Government.

What the Dutch Government should have done:

Allow people and companies some slack filling in their electronic correspondence with the government (i.e. Tac Forms, filing of legal documents, etc) until the Dutch Government has installed their new (and now hopefully secure) certificates.
By postponing due dates, they can ensure safe  communication, now they can’t.

(Edit: since posting the above, I learned that Agentschap NL has given their customers a week more time to supply digital documents).

What users of Microsoft software should do:

For at least a week, don’t use the (embedded) Microsoft Internet Explorer to communicate with the Dutch government, but use an alternative browser and disable the DigiNotar root certificates on your system.

Use the most recent version of Mozilla Firefox, Google Chrome, Opera or Apple Safari *and* disable the DigiNotar root certificates.
This post explains how to disable the DigiNotar certificates on OS X.
This post explains how to disable the DigiNotar certificates on Windows.

Keep an eye on the DigiNotar post by Joshua Long as he updates it frequently.

Note that on Windows there is s truckload of software that embeds Microsoft Internet Explorer, so you should try to block the iexplore.exe process whenever possible.

–jeroen

Via: Overheid dwingt bij Microsoft vertraagde Windows Update af | Pro | Tweakers.net Nieuws.

Posted in LifeHacker, Opinions, Power User | Leave a Comment »

Entity Framework: simple solution for cryptic error message “System.NotSupportedException: Unable to create a constant value of type ‘System.Object'”

Posted by jpluimers on 2011/09/06

The drawback of using ORM layers is that often the error messages are very cryptic, and it takes some getting used to in order to find the (often deceptively) simple solution.

This case was an Entity Framework wrapper around a SQL Server database where the primary and foreign keys were all GUIDs, and some of the foreign keys were optional.

So the generated model has a mixed use of Guid? and Guid data types.

Below is the full stack trace, but here is the exception class and message:

System.NotSupportedException: Unable to create a constant value of type ‘System.Object’. Only primitive types (‘such as Int32, String, and Guid’) are supported in this context.

The exception is caused by a piece of code like this:

        public static long CountChildren(ParentEntity parentEntity)
        {
            using (EntitiesObjectContext objectContext = new EntitiesObjectContext())
            {
                Guid? parentId = parentEntity.ID;

                if (null == parentId)
                    throw new ArgumentNullException("parentEntity.Id");

                IQueryable<ChildEntity> ChildEntitys =
                    from content in objectContext.ChildEntity
                    where content.ParentID.Equals(parentId)
                    select content;

                long result = ChildEntitys.Count(); // BOOM!

                return result;
            }
        }

The stack trace at the end of this post contains a truckload of ExpressionConverter lines. Since the LINQ expression contained only one WHERE clause, the mentioning of the list of primitive types in the message (Int32, String, and Guid) made me change the code into the one below.

Read the rest of this entry »

Posted in .NET, .NET ORM, C#, Development, EF Entity Framework, Software Development | 5 Comments »

 
%d bloggers like this: