Showing posts with label Visual Studio. Show all posts
Showing posts with label Visual Studio. Show all posts

15 April 2013

Visual Studio 2010 Code Compare Line Length Limitation

The default code differencing / compare tool in Visual Studio 2010 contains a bug: lines of code over 4095 characters overrun the buffer and are not evaluated, nor do they appear. What concerns me is that the compare tool did not alert the user that a buffer overrun may have occurred.


Today, my colleague noticed a line of edited code missing from the default VS2010 code differencing / compare tool, used to locate changes in source controlled files. The edited line of code simply did not appear in the tool, and had no indication of containing a change.

Looking at the code in the editor, I noticed it was a wide line. Very wide. 5057 characters wide, to be exact. The code in question was produced by a meat grinder conversion of a legacy system, not only evidenced by this wide line of code, but also that this line was a call to a method that contains 218 input parameters. (Yes, the application actually runs.)

Inserting a line break after character 4095 confirmed this is a buffer overrun issue; breaking the line at character 4095 causes both lines to appear in the comparison tool, and to be marked as a change.

28 February 2012

Suppress EF Compiler Warnings Error 11007 and 11008

I am working on an MVVM project that parses records out of encrypted data files, on demand.  There is no real data source for this project, for Entity Framework 4.1 to reference.  Every time I build the model assembly, I get a huge pile of warnings for Error 11007 and 11008.

Because I am a savvy developer (and slightly obsessive-compulsive), I don't want to see any compiler warnings after a build.  Because I know these are non-issue warnings, I can safely disable them.  Here's how to disable EF warnings in your projects:

15 December 2011

Pex and Moles to be Visual Studio 11 Feature Set

In true, "I will neither confirm nor deny" Microsoft fashion, a little bird in Redmond informed me that Pex and Moles will have no further releases, because they are being "productized". Another, larger bird stated, "dependency isolation will be taken care of, in Visual Studio 2012," when I asked if Moles and Pex will be rolled into VS 2012.

The Visual Studio 2012 community technical preview (CTP) is available for download to anybody.  However, the Moles and Pex products are not yet integrated into the application.  There are several points of integration the need to be perfected, before adding it.

Note, this VS11 download is a BETA version, and is incomplete.  Many more features are still cooking.  Stability is OK, but use it at your own risk!  Visual Studio 2012 Beta will (should) receive updates from Microsoft Update, to keep it current with the newest release.


(This post is extracted from the Testing with Microsoft Pex and Moles page of this blog.  I felt this information was worth putting in its own post, after sitting in a sidebar, since May 2011.)

UPDATE: Changed the link and name to reflect the Beta release.

11 August 2011

Pex and Moles DevExpress CodeRush Templates

CodeRush Xpress (or with RefactorPro), from DevExpress, is probably the most useful and well-built IDE add-ons I have ever used. The templates are extremely useful, especially when you can modify them and create your own. Here are a few templates that I have created for Pex and Moles.


NOTE: These templates are for the Microsoft Test Framework, and will not work when in an NUnit project.  The template shortcut is highlighted in yellow, followed by a description and an example of its output.

How to Clear DevExpress CodeRush Assembly and Solution Cache

My employer has been wrestling with a juggernaut-class ASP.NET application, complete with an intermediary framework, that is a port of the soon-to-be-retired mainframe.  This is a colossal, 4GB monster with procedural C# files, frequently exceeding 30,000 lines.  Needless to say, CodeRush gets pretty busy, when we get a new revision from the external conversion company, every 2 weeks.

With 25GB of cache data, CodeRush really starts to drag down performance; WAY more cache data than most developers dreamed of.  Blowing the cobwebs out of DevExpress CodeRush cache every month or two helps keep things humming along nicely, around the office.

There are a few ways to clear out the assembly cache and solution cache:

05 July 2011

Assembly Not Available in the Currently Targeted Framework

Oh, dreaded .NET 4.0 target framework issue... how I loathe thee.

Symptoms

When attempting to compile a .NET application, using Visual Studio 2010, the build fails, and the following warnings, or similar warnings, are issued:
The primary reference "System.Configuration.Install", which is a framework assembly, could not be resolved in the currently targeted framework. ".NETFramework,Version=v4.0". To resolve this problem, either remove the reference "System.Configuration.Install" or retarget your application to a framework version which contains "System.Configuration.Install". 
The primary reference "System.ServiceProcess", which is a framework assembly, could not be resolved in the currently targeted framework. ".NETFramework,Version=v4.0". To resolve this problem, either remove the reference "System.ServiceProcess" or retarget your application to a framework version which contains "System.ServiceProcess".
I found that even though the .NET Client profiles are supposed to be a subset of the full profile, many assemblies, including the two noted above, are not included in the "Add Reference" dialog.  These assemblies properly appear in the Client Profile.  It's as if the list has somehow been modified.  Now, to identify the culprit...

31 May 2011

Moles requires tests to be IN an instrumented process

After adopting Moles as my dependency isolation utility of choice for .NET projects, I began to encounter an exception that could not be explained by anyone, including Peli:
Moles requires tests to be IN an instrumented process.

To compound my frustration, my unit tests involving "moled" types began to work sometimes, and would work other times.  To add frustration, no code changes took place between the successful and unsuccessful test executions.

But something had indeed changed.  Not in the code.  Not on my workstation. Not in Visual Studio 2010 or Team Foundation Server.  How I executed the text changed.

16 November 2010

Extract Files From ISO Images Without Additional Software

I decided to write reports for SQL Reporting Services.  They are fast, look great, and are oh-so-easy to access via the Web interface.  However, I discovered that Visual Studio versions must be paired to the SQL Server version.  I needed to install Visual Studio 2005, but had only the .ISO CD-ROM image available, and was unable to install software to extract the files.

08 September 2010

Mouse Suites Aren't So Sweet

Visual Studio, Microsoft Office, and many other applications making use of docked windows are subject to the rigors of "helpful" mouse software suites, kindly loaded by computer manufacturers.  Such manufacturers include HP / Compaq, IBM / Lenovo, and others.

20 August 2010

Frustrations with Visual Studio 2010 Extensions

I have become frustrated with the two most popular extensions for Visual Studio 2010.  These are great tools, but also have their issues.  If you, too, are frustrated by these or other issues, please post a comment.

Oh, great creators of VS extensions, hear my rants and fix your code!

09 August 2010

Mouse Scroll Wheel Issues With Visual Studio and Office

I encountered an old foe, on the workstation of my day job, after installing Visual Studio 2010 Premium.  Moving the mouse scroll wheel normally causes my C# code window to scroll vertically.  However, this particular computer randomly decides vertical scrolling is simply too mundane, and starts scrolling tool windows, instead.  I have experienced this problem in the past, after installing Visual Studio 2003 on a HP workstation.  The issue was resolved after I updated the mouse drivers to use the standard Microsoft Windows mouse driver.  The mouse worked beautifully!  But, what was the cause of the problem?

05 August 2010

Practical Uses of Visual Studio 2010 Productivity Power Tool Extensions

This is an unbiased review of practical uses for the new Visual Studio 2010 Productivity Power Tool Extensions.  I waited to post this for a good reason; there are numerous posts reviewing and highlighting the functions of the extension, but none about how they are really useful and actually used to increase your productivity.  Most users will figure these things out in time; however, for those who are unfamiliar with this extension, or extensions in general, it's great to get an idea of what what the Power Tool extension do for you.