Archive for the ‘Open Source’ Category

EF + NPGSQL: “Only PrimitiveTypes can be used without qualification.”

01:46 PM

Are you trying to create a SSDL/EDM file for Entity Framework and Npgsql ? Are you getting the following error?

error 0040: The Type … is not qualified with a namespace or alias. Only PrimitiveTypes can be used without qualification.

This is caused by Npgsql mapping a very sparse selection of type-names to the underlying Entity Framework type structures.

As of 2.0.9, the following type names are recognized:

  • bool
  • int2
  • int4
  • float4
  • float8
  • uuid
  • numeric
  • bpchar
  • varchar
  • text
  • xml
  • timestamp
  • date
  • bytea

Porting Puppet to Windows

01:50 PM

In the course of the PuppetCamp Europe, I met with many people I only knew from IRC and email and it was a great time with interesting and inspiring discussions.

Today I want to write about the work I’m currently commisioned for by puppetlabs, porting puppet to Microsoft Windows.

Current Status

After disabling some minor pieces (color, conf file watching) and fixing a few bugs (see the tree on github) and a little bit hacking various parts to pass through paths with a drive letter, I was able to create the first file on windows with puppet. On the downside a few technical problems with the code surfaced, the most daunting were approximately 600 spec failures (out of 8.500 examples).

(more…)

Using gendarme with Code Contracts from .NET 4.0

04:30 PM

When using gendarme on post-processed assemblies with code contracts and /throwonfailure set, a few things have to be ignored. Put the following lines into your ignore file (for example gendarmeignore.txt) and use it with --ignore on the command line.


R: Gendarme.Rules.Exceptions.ExceptionShouldBeVisibleRule
T: System.Diagnostics.Contracts.__ContractsRuntime/ContractException

R: Gendarme.Rules.Exceptions.MissingExceptionConstructorsRule
T: System.Diagnostics.Contracts.__ContractsRuntime/ContractException

R: Gendarme.Rules.Serialization.MissingSerializableAttributeOnISerializableTypeRule
T: System.Diagnostics.Contracts.__ContractsRuntime/ContractException

R: Gendarme.Rules.Serialization.MissingSerializationConstructorRule
T: System.Diagnostics.Contracts.__ContractsRuntime/ContractException

Since this is a tool-generated class we cannot do anything about it anyways and should not access or need the missing features.

Kolab Connector binaries uploaded

05:57 PM

Arthur moved on with programming and testing. Now we uploaded the first packages, which now contain the basic calendar and contacts synchronisation. The plugins already are able to synchronize our personal data.

You can find the packages on the download pages of the Kolab Sync for Outlook und Kolab Sync for Android projects.

Please use the issue trackers there for feedback.

Kolab Sync for Android and Outlook: Developer Preview

05:18 PM

We are proud to announce the first developer preview for Kolab sync clients for both Android and Outlook. Both are licensed under the GPLv3.

Using this software you will be able synchronize your contacts and calendar to any IMAP folder. Every item is saved in a separate Email using the Kolab Storage Format. This allows for interoperability with other Kolab Clients.

Please join us on the Google code projects for the Android and the Outlook connectors.

Since there are still quite a few rough edges, this is only a developer preview to publish the already done work. Read on for a more detailed status of the development so far.

(more…)

Building a simple MSBuild Task

12:19 AM

On the “Using Studio’s “Custom Tool” in MSBuild” question, I was prompted to share the code. Here is a stripped down skeleton where I removed the actual calls to the custom tool. Since it is open source I didn’t really need to access the Visual Studio’s registry keys.
(more…)

Gendarme Integration for VS2008

09:33 PM

Ever since setting up our CruiseControl.NET server for our internal projects, I wanted to integrate a Gendarme run to catch all those nasty little things that slip through, like not checking arguments for null.

Now that I finally found some tuits to do it, the next problem became obvious: doing a quick commit often lead to a quick build fail. Gendarme would have no use if it didn’t find anything, no? So the missing piece was integration into Visual Studio. Arthur hacked together a little XSLT+PowerShell and voila, Gendarme now runs on every build right from the studio and populates the “Error List” window with properly linked entries. Yay!

Read on for the details of the implementation. The complete source is downloadable at the end of the article.

(more…)

AppDomainUnloadedException with NUnit, a ServiceHost and several other technologies

05:03 PM

All tests ok, but still a NUnit failure?

Seeing unexplicable “System.AppDomainUnloadedException: Attempted to access an unloaded AppDomain.” errors?

You might be a victim of nunit’s bug #423611.

See also here, here and here.

A typical error message looks like this:

Unhandled exceptions:
1) : System.AppDomainUnloadedException: Attempted to access an unloaded AppDomain.

I’ve uploaded a minimal solution exhibiting the problem to the bugreport and I hope that’ll help clearing the issue up.

CruiseControl.NET and other open source stuff

12:49 PM

Recently I’ve spent some time setting up a CruiseControl.NET instance for our internal projects. Using this project, we have an automatic and immediate feedback whether our checkins work without having to waste developer time waiting on the full unit test suite.

To improve response times of the server running CC.Net while integrating, I’ve applied the ProcessPriority patch from CCNET-504 and now run all processes at BelowNormal. Now there is no noticeable impact on other services on the server while a build is running. Since the patch didn’t apply cleanly to the newest CC.Net version, I updated the patch to current HEAD and posted it in the bugtracker. Thanks to Craig Sutherland the patch is now applied in the HEAD and will be released with 1.5. Having already wet my feet, I proposed a refactoring for the Tasks to move all common properties to the BaseExecutableTask class, thereby removing ~300 lines of code and unifying the diverse set of properties currently in the wild. This will have to wait for the next release in order to not interfere with a timely 1.5 release.

Currently CC.Net builds the projects from subversion, runs all unit tests with NUnit and checks code quality with Gendarme.

While integrating Gendarme in our build process, I found and reported two bugs in the rules, which triggered false positives on our code. Thanks to Sebastien Pouliot both appear to be already fixed and slated for release with the next Gendarme (2.8).

MSSQL doesn’t (completely) support IEEE754 floating points

12:00 PM

After looking for quite a while (it is unbelievable, no?) I have to accept that Microsoft’s SQL Server 2000, 2005 and 2008 do not fully support IEEE-754 floating point numbers. Specifically NaN (Not-a-Number) and +/- Infinity are not allowed. While the 2000 Server seemingly allows such values to be inserted, but breaks badly afterwards, the newer versions disallow inserting such values. Here is the MS Connect article requesting the feature. There is also the documentation about float data and a read-between-the-lines hint in the documentation for XPath numbers. The article describing floats is very circumspect about this:

The behavior of float and real follows the IEEE 754 specification on approximate numeric data types.

[emphasis mine]

The XPath article states it clearly:

However, float(53) is not exactly IEEE 754. For example, neither NaN (Not-a-Number) nor infinity is used.

.

For completeness, here’s a little review about other DMBS’ support for NaNs and Infinity: