FxCop rule CA2227 and setter error using linq to sql

6. October 2009

I was having a problem with this fxcop rule today CA2227.  This error was being thrown out on all the  Associations when using the Linq to sql templates here: http://l2st4.codeplex.com/

Well of course we cannot have that as this violates checkin policy, so what I did was add this line here to the template:

 [GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "9.0.0.0")]

I googled this problem and landed on Andre Loker's blog here.  I understood the problem as he prensented it, but umm Microsoft is doing this..Yes.

So I dug deeper..and came here:  

Yes, it is a problem, but the workaround is against our policy, so onward...bound to here

Great justification and it fit my needs.  Yes there is some evil when using code generations, but I like having more control and the linq to sql T4 templates give me that.

Hope this helps someone else.

.Net , C#

LINQ to SQL templates for T4-Adding Interfaces for C#

6. October 2009

I was working in these templates and wanted to add interfaces.  

I found a link in the discussions here, from Jwooley stating he had done this: http://www.thinqlinq.com/Post.aspx/Title/Generating-Interfaces-for-LINQ-to-SQL-Entities

Well he did it, but in Visual basic and I needed C#, so I changed up the script.   I tried to add this script to his site, but the submission didnt allow it so I will post it here and add a link to his site.

Hope this saves someone a little time:

(Follow the instructions on the think link site and replace this part :

namespace <#=data.EntityNamespace#>	
{
<#		}
#><#if (options.CreateInterfaces) { #>
	/// <summary>
    /// <#=class1.Name#> interface
    /// </summary>
	<#=code.Format(class1.TypeAttributes)#>interface I<#=class1.Name#>
	{
	<#			foreach(Column column in class1.Columns) {#>
	<# if (column.IsReadOnly) {#>ReadOnly <#}#> <#=code.Format(column.Type)#> <#=column.Member#>{ get; set; }
	<# } 
	#>
	}
<# } 
#>
<#		if (data.Serialization && class1.IsSerializable) {

.Net , C#, Programming

Contextual help

1. January 2008
I will be building a contextual help for my company soon, so I did some research and here it is:

.Net , C#, Programming

Getting Microsoft Office 2003 word addin working

1. January 2007
This is another old blog entry from the past, that I wanted to take with me.
 
I recently spent some time testing word addins for my job and ended up learning much more than I wanted to know about word addins.
Here are the basic steps I came up with for creating a test addin. If you start with these steps below you know that everything is working with your addin from the beginning so you can then move forward.
 
Steps for creating an office 2003 addin without vsto.
  1. Create an addin by creating a new project and chosing other project types, then extensibility, then shared addin.
  2. use this code http://support.microsoft.com/default.aspx?scid=kb;en-us;302901 to create a test addin.
  3. use this http://msdn2.microsoft.com/en-us/library/aa537166(office.11).aspx to download the shim wizard and install the shim.  Is this step necessary, you may ask? I think so, because you are isolating your addin. Plus, the wizard is simple to use.
  4. if you are using vs 2005 and .net 2.0 go here: http://support.microsoft.com/kb/908002/en-us and install this hotfix on your development machine, then include it in the prerequisites of the admin setup file(right-click on addin setup project, choose properties, choose prerequisites.
  5. Install the addin on a test machine. Do not just think that the addin works, because it works on your development machine.  This needs to be throughally tested on a clean machine.
  6. If you have problems then my advice is to post your questions at microsoft of here: http://www.outlookcode.com (They are a very good source for getting your addin working)
Below are the links and some of my notes:
 
Word Addin with shims--C#

.Net , C#, Programming