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,861 other subscribers

Archive for the ‘.NET’ Category

Visual Studio 2010 “Solution Explorer Tools” addin: Collapse all, Select current item, Collapse all except current item. Highly recommended.

Posted by jpluimers on 2011/04/07

When you have lots of projects in a solution, quickly the tree in the Solution Explorer gets a mess, especially if you have “Track Active Item in Solution Explorer” enabled.

“Solution Explorer Tools” addin for Visual Studio 2010 helps with that.

It adds three buttons to solution explorer

  1. Select current item
  2. Collapse all
  3. Collapse all except current item

The first one basically means you will never need to enable “Track Active Item in the Solution Explorer” again.

The second and third quickly get rid of the mess in the Solution Explorer.

Highly recommended!

–jeroen

via: Solution Explorer Tools.

Posted in .NET, Development, Software Development, Visual Studio and tools | Leave a Comment »

Visual Studio 2010: some entries in the Error List are not Errors, Warnings or Messages, but are still indicating a problem

Posted by jpluimers on 2011/04/06

The below message in my Error List is not an error: it has a red exclamation mark, which falls outside the category Error (Red bullit with white cross), Warning (Yellow triangle with black exclamation mark) or Message (White bullet with blue lowercase i).

Bit it is still indicatint something was wrong:

1 Failed to copy project output to file C:\tfs.root\MyServiceApplication\ClientBin\MySilverlight.Client.Test.xap. Access to the path ‘C:\tfs.root\MyServiceApplication\ClientBin\MySilverlight.Client.Test.xap’ is denied. 0 0 MyServices

What it indicates is that the .xap file is readonly, and cannot be overwritten.

The reason is that during checkin in TFS, by accident all the .XAP files were added (by default, .XAP files are not on the binary exclusion list), and I found the answer in this thread.

At the end of the build process, the above message disappeared, but the .XAP file was not replaced, so the project output was not up-to-date.

Ergo: the build should have failed.

The solution was simple:

  1. Remove the .XAP files from TFS
  2. Delete the read-only .XAP files from disk
  3. Rebuild

Now Visual Studio 2010 can regenerate the .XAP files and your project output is correct again.

NB: .XAP files can be in two places, be sure to check both:

  1. The bin\debug or bin\release folder of a SilverLight project
  2. The ClientBin folder of an ASP.NET web project

–jeroen

 

Posted in .NET, ASP.NET, Development, SilverLight, Software Development | Leave a Comment »

Recommended blog post: Favorite C# Idioms | Blue Onion Software

Posted by jpluimers on 2011/04/05

While browsing for some less used but useful C# features, I came across a great post by Michael (Mike) Ward from Blue Onion Software on Favorite C# Idioms based on the great Hidden Features of C# thread on StackOverflow.

Mike starts with

There’s a great post on Stackoverflow about hidden features in C#. I prefer to think of these as idioms rather than hidden features since most are actually documented. Here are my favorites.

Then he continues with some nice examples of C# idioms.

Recommended reading!

–jeroen

via Favorite C# Idioms | Blue Onion Software.

Posted in .NET, C#, C# 2.0, C# 3.0, C# 4.0, Development, Software Development | Leave a Comment »

Entity Framework 4 “Error 3004: Problem in mapping fragments starting at line” means you must generate your DB from your model first (Stack Overflow)

Posted by jpluimers on 2011/04/05

Entity Framework 4 is nice, but has very confusing  error messages.

Maybe it is just me, but getting a feel for what each error message means, and how to cure the underlying mistake(s) is time consuming.

For instance, it took me quite a while to find out why this error occurred during a project build:

Error 3004: Problem in mapping fragments starting at line 569: No mapping specified for properties MyEntity.MyValue in Set MyEntities. An Entity with Key (PK) will not round-trip when: Entity is type [MyEntities.MyEntity]

The solution was simple, I had forgotten to manually perform the “Generate Database from Model…” step before building my solution and was glad I found it in this Stack Overflow answer:

Have since discovered that after I add/change/delete properties on my entities I must “Generate Database from Model” before I compile otherwise I get 3004 mapping errors.

Note that this generation is always a manual step; I haven’t found a way to automate that (if you have found a way: please add a comment below).

–jeroen

via: .net – Entity Framework 4 mapping fragment error when adding new entity scalar – Stack Overflow.

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

Bootstrap and DVD ISO Download details: Microsoft Visual Studio 2010 Service Pack 1

Posted by jpluimers on 2011/03/30

The Download details: Microsoft Visual Studio 2010 Service Pack 1 (Installer) initially lets you download a bootstrap installer that only downloads the Service Pack 1 parts you actually need.

A bit further down on that page is the link to the full ISO DVD image with the anything you might need when updating multiple systems.

–jeroen

Posted in .NET, Development, Software Development, Visual Studio 2010, Visual Studio and tools | Leave a Comment »

C# Toolbox: Debug-able, Self-Installable Windows Service Template Redux | Visual Studio Feeds

Posted by jpluimers on 2011/03/29

James Michael Hare finally published his Debug-able, Self-Installing Windows Service Template download.

Quote: Read the rest of this entry »

Posted in .NET, C#, Development, Software Development | 2 Comments »

trace switches for LLBLGenPro

Posted by jpluimers on 2011/03/24

I always forget which trace switches in the App.Config come in handy when using LLBLGenPro.

So  I remember: The most important one is SqlServerDQE.

More of them are explained in Righthand blogs : Implementing more useful tracing for LLBLGenPro 2.0.

–jeroen

Posted in .NET, Development, LLBLGen, Software Development | Leave a Comment »

SccProjectName value in .csproj hosed – strange build results (via: Interesting support case – Visual Studio solution prompts for entire SCC check-out on open – Developer Support Team Foundation Server – Site Home – MSDN Blogs)

Posted by jpluimers on 2011/03/24

Something in TFS screwed a SCC references in one of the .csproj files at a client.

As a result, it generated strange build errors (unfound projects in the wrong branch), because when loading project from the correct, the IDE in fact loads it from the wrong branch.

When you read the blog post from the Microsoft TFS development support team, the solution looks simple: in a regular project the values for SccProjectName, SccLocalPath, SccAuxPath and SccProvider should all be SAK (indicating the SCC should ignore their values).

That is only 1 piece of the solution. Somehow, Visual Studio and/or TFS seem to cache some information in hidden places, so it keeps insisting to use the project from the wrong branch.

So, in addition to changing the above SAK values in the project in the correct branch, you need to:

  1. Also check (and if wrong change) the above values to SAK for the project in the wrong branch
  2. Remove the references to the project in the wrong branch from the Visual Studio MRU list in the registry (HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\9.0\ProjectMRUList)
  3. Delete the .suo file for the good solution
  4. Add the project from the correct branch to the solution
  5. Manually modify the .sln file in the correct branch to remove the relative directory paths to the project in the wrong branch (values in keys named like SccProjectUniqueName58, SccProjectName58 and SccLocalPath58)
  6. Reload the solution in Visual Studio and check everything works correctly

It took at least a couple of hours to find this all out, for these reeasons: Read the rest of this entry »

Posted in .NET, C#, Development, Software Development | 2 Comments »

How to clear the “ErrorList” window before compiling

Posted by jpluimers on 2011/03/22

It seems that all versions of Visual Studio suffer from this behaviour:

Visual Studio (VS) doesn’t always clear the “Error List” window of existing errors when you compile a different project but simply appends new errors to it.

Simplest solution: Build | Clean All.
That takes some time (especially on large solutions), but I haven’t found an easier way.

Have you?

–jeroen

via: How to clear the “ErrorList” window before compiling.

Posted in .NET, Development, Software Development, Visual Studio and tools | Leave a Comment »

Ideone.com | Online IDE & Debugging Tool >> C/C++, Java, PHP, Python, Perl and 40+ compilers and intepreters

Posted by jpluimers on 2011/03/18

Really cool stuff; dozens of computer languages are supported, including C# and VB.NET (both on Mono) and a few Pascal flavours.

Briefly about ideone

ideone.com is a… pastebin. But a pastebin like no other on the Internet. More accurate expression would be online mini IDE and debugging tool.

Ideone is an Italian word for great ideas – because ideone.com is a place where your greatest ideas can spring to life.

ideone.com is designed mostly for programmers (but, of course, common plain text can also be uploaded). You can use it to:

share your code (that’s obvious – it is a pastebin, isn’t it? :)) in a neat way,

run your code on server side in more than 40 programming languages (number still growing)

and do it all with your own input data!

ideone.com also provides free Ideone API which is availabe as a webservice. It’s functionality allows you to build your own ideone-like service!

for logged in users Ideone offers possibility to manage their codes, publish multiple submissions at one go, and more.

All codes can be accessed through convenient hash links. Source code pages provide information about the code and its execution: memory usage, execution time, language and compiler version, code itself, input uploaded by the user, output generated by the program and error messages from compilers and interpreters.

–jeroen

via Ideone.com | Online IDE & Debugging Tool >> C/C++, Java, PHP, Python, Perl and 40+ compilers and intepreters.

Posted in .NET, C#, Delphi, Development, Software Development, VB.NET | 4 Comments »