Calculate Code Metrics – Troubleshooting

Project A references B
Code metrics work fine for B. Project A builds OK in Visual Studio. However “Calculate Code Metrics” on project produces error.

Message: An error occurred while calculating code metrics for target file ‘<My Assembly1 path>’ in project <My Assembly1>. The following error was encountered while reading module ‘<My Assembly2>’: Could not resolve member reference: <My Assembly3>.Models.IModel::get_FunctionTable.

SOLVED
It is possible that Code Metrics is using a different reference to Visual Studio. In my particular case my “Common Assemblies” folder had an older reference for Project B. By deleteing the reference from Common Assemblies, Code Metrics was forced to use the more up to date Project Reference, and then worked.

Computing Frustrations – Annoyances

Written to see if this presents any ways of reducing frustration
List is:

  1. Computerstaking a long time to turn on
  2. Always updating whether you want to do so now or not
  3. You are working on one job when the computer/software another problem intervenes nothing to do with this work

Things that help:

  1. Blog solutions to problems for future reference
  2. Do things which are satisfying
    • Work on code generation
    • Use code generation
    • DRY – make something re-useable
  3. Satisfaction is a function of expectation

 

LINQ errors

Error:

  • ‘First’ is not a member of ‘System.Data.EnumerableRowCollection(Of System.Data.DataRow)
  • “Definition of method ‘GroupBy’ is not accessible in this context”
  • ‘ToList’ is not a member of ‘System.Linq.Iqueryable(Of T)’

Solution:
Imports System.Linq
Also ensure that the DataSet is up to date. Use Run Custom Tool on the DataSet to ensure this.
Then ensure there is a reference to “System.Data.DataSetExtensions”.

See MSDN “How to Create a LINQ Project”
http://msdn.microsoft.com/en-us/library/bb546156.aspx

See MSDN 101 LINQ Samples
http://msdn.microsoft.com/en-us/vbasic/bb688088

Windows XP icons all hi-lighted AND Office 2003 loses color

My NVidia Control Panel was set for dual monitors. However one was detached, so it seemed to have switched it to Main monitor name + TV.
Changed back to single monitor and both of the above problems disappeared

Other sites have different answers for the Windows XP icons all hi-lighted. This was not the issue in my case.

Windows 7 SDK – Hilo

Cool sample http://code.msdn.microsoft.com/Hilo-0e6f10bf
http://msdn.microsoft.com/en-us/library/ff708696%28v=MSDN.10%29.aspx

Initially had error “cmd.exe exited with code 9009”
The code.msdn page where Hilo is in Q+A had this solution:

Hey, Try to open Properties for Annotator (right click) and select Configuration Properties –> General. Then set Platform Toolset to “Windows7.1SDK” (need to install Windows SDK 7.1 first). Good Luck
 
Then I had a message saying that the SDK was not installed. It seems that even though Windows SDK is installed with Visual Studio, I needed to install v7.1 to get Hilo sample working. The SDK did not install completely first time. But on trying to install it again, it suggested it was installed, did I want to Repair it, which I did, this seemed to work and Hilo then built and ran.

SSMS 2008 R2 is losing Intellisense after installing Visual Studio 2010 SP1

http://connect.microsoft.com/SQLServer/feedback/details/650569/ssms-2008-r2-is-losing-intellisense-after-installing-visual-studio-2010-sp1

Apply cumulative update to SQL Server 2008 R2

http://support.microsoft.com/kb/981356

 

VS Bug on FormClosing datagridviewcomboboxcell value is not valid

Error message may be “Field called xxx does not exist”

Try this on Form closing

Private Sub frm_FormClosing(sender As Object, e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
    Me.MyGridView.AutoSizeRowsMode = DataGridViewAutoSizeRowsMode.None
End Sub

I would hazard to suggest thatVisual Studio does not dispose of the datagridview in the correct sequence

This sometimes occurs when my personal code > SetUpDataGridView may programmatically set the AutoSizeRowsMode.

—–

This link http://social.msdn.microsoft.com/forums/en-US/winformsdatacontrols/thread/88c3adee-ed2a-41ee-9407-c3314588e08a/
Suggests it may be something to do with autosize, when there is a combobox created. The order of creation and setting may be important.

“If you autosize the column but have not provided the combo box column with a valid datasource or you haven’t yet added items to the combo box column’s items collection then you’ll get this error at startup because autosizing requires the cell’s FormattedValue to be requested. Requesting the FormattedValue of a combo box cell is where the check is done that may raise the data error exception you are seeing.

Set the autosize mode after you fill the combo box and things should be ok.

Mark Rideout – DataGridView Program Manager – Microsoft”

Or create the comboboxcolumn then clear the autosize modes > run > re-set the autosize mode.
Or programattically set the autosize after form has designer InitialiseComponent code has loaded.

Dataset Designer: Unable to find connection MyConn (MySettings)1 for object ‘MySettings’

 

Solved:
http://social.msdn.microsoft.com/Forums/en-US/winformsdatacontrols/thread/08a48cad-619d-4421-b584-f2b5550ba6c5

Solution from Don,
“I had the same problem with one of my projects. If you open up the Dataset using the XML editor you should see a line near the top that looks like this:

<DataSourceDefaultConnectionIndex=1FunctionsComponentName=QueriesTableAdapterModifier=AutoLayout, AnsiClass, Class, PublicSchemaSerializationMode=IncludeSchemaxmlns=urn:schemas-microsoft-com:xml-msdatasource>

I changed the DefaultConnection Index from a 1 to a 0 and the problem went away. I suspect at one time I had two connections and one went away but the index was not updated.

<DataSourceDefaultConnectionIndex=0FunctionsComponentName=QueriesTableAdapterModifier=AutoLayout, AnsiClass, Class, PublicSchemaSerializationMode=IncludeSchemaxmlns=urn:schemas-microsoft-com:xml-msdatasource>”

Also other posts here may be useful:
In my particular case had too many connection strings and deleted one of them.

 

Crystal Reports specified DSN contains an architecture mismatch between the Driver and Application

Database error: MicrosoftODBC Driver Manager The specified DSN contains an architecture mismatch between the Driver and Application. (IES 10901) (WIS 10901)

On Windows 7 there are two ODBC. Probably want the first of these:
C:\Windows\SysWOW64 use against 32 bit data
C:\Windows\System32

However this could be mis-leading, as was the case this morning. It could be that a DSN is missing. Or perhaps missing from the correct ODBC.

SSRS Configuration – “user … does not have required permissions. Verify that .. and … UAC …

SOLVED

User ‘<server>\<username>’ does not have required permissions. Verify that sufficient permissions have been granted and Windows User Account Control (UAC) restrictions have been addressed.

“To get this resolved you need to start you Internet Explorer as Administrator -> Run as Administrator then open the url http://<Server name>/Reports this will take you to the “SQL Server Reporting Services” Home page
Click on the “Folder Settings” button.
Click on the “New Role Assignment” button.
Add the Group or user name: DOMAIN\USER_NAME, and permissions you have logged in as.
Click on Ok button.
This should resolve the issue.”