FxCop for .NET 4.0

The latest version of FXCop (v10) is bundled with the install of the latest Windows SDK for Windows 7 and .Net 4, released on 5/19/2010. From Microsoft – Full ISOs Once the SDK is installed you can find the FXCop installer EXE under %programfiles%\Microsoft SDKs\Windows\v7.1\Bin\FXCop (This assumes you kept the default install directory when installing … Read more

c# warning – Mark assemblies with NeutralResourcesLanguageAttribute

The NeutralResourcesLanguageAttribute informs the resource manager of the language that was used to display resources which are contained in the main assembly. E.g. if you coded your assembly so that it contains resources which are in English, then include the following line in your AssemblyInfo.cs [assembly: NeutralResourcesLanguage(“en”)] This way, when looking up resources in English, … Read more

How to get the FxCop custom dictionary to work?

If you use it inside Visual Studio… From Visual Studio Code Analysis Team Blog To add a custom dictionary to a C# and Visual Basic project is simple: In Solution Explorer, right-click on the project and choose Add -> New Item… Under Templates, select XML File, enter a name for the dictionary, such as CodeAnalysisDictionary.xml … Read more

What’s with the “Afx” in StdAfx.h?

From Wikipedia: One interesting quirk of MFC is the use of “Afx” as the prefix for many functions, macros and the standard precompiled header name “stdafx.h”. During early development what became MFC was called “Application Framework Extensions” and abbreviated “Afx”. The name Microsoft Foundation Classes (MFC) was adopted too late in the release cycle to … Read more

Why is it considered bad to expose List? [duplicate]

I agree with moose-in-the-jungle here: List<T> is an unconstrained, bloated object that has a lot of “baggage” in it. Fortunately the solution is simple: expose IList<T> instead. It exposes a barebones interface that has most all of List<T>‘s methods (with the exception of things like AddRange()) and it doesn’t constrain you to the specific List<T> … Read more

Parameter naming: filename or fileName?

Lower camel case is recommended for fields and parameters. Example 1: fileName // for fields, parameters, etc. FileName // for properties, class names, etc. Generally, fileName is used and NOT filename; you can verify that by reading source code of open source stuff created by Microsoft, such as Enterprise Library. Reasons: The main point behind … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)