I wrote a couple features with some list definitions, site columns, and a content type with a feature receiver. It was the first real feature that I ever wrote. I built a presentation on features, but that was all research and books. I did the presentation once, but I never really knew much about features. This time around I did not use STSDev or VSEWSS. I knew what the DDF file was and the Manifest.xml from my SPS 2003 days, but was very rusty. I think that this week definitely helped me with my shortcomings. I am definitely not using VSEWSS again, but I may use STSDev in future.
So anyway off my crazy tangents and onto the real stuff...I was working with Lookup fields in site columns and attempting to bind them to a content type. When I activated the feature I would see a memory error message like Hresult...I thought to myself why would I get an Hresult error and I realized some address did not exist properly. If you remember anything about pointers you immediately realize what is going on when you see a memory issue. I tried to bind the site column manually to a list and I saw a very similar memory error. Then I did some research in the different ways to declare a site column in a feature. One way states that the List property can be set to "lists/listname"...I don't know where that information is coming from...It does not work. It does not matter if the list exists before the site column feature is activated it will not work. DO NOT use that method...The only method that works involves setting the List property to the List GUID. The only way you can get this guid is when you create the list. If you are declaring a list in a feature it changes every time the list is created and the feature is activated. So honestly if you want to declare the list, then paste in the guid into the feature you can. As development best practices go you want to create a solution that can be reused. So I would not recommend this method. I would recommend using a feature receiver and creating the site columns on activation. It is really simple and I will post the code next week. For now you guys will have to take my advice as the one useful item for this week.
So remember kids don't try this at home unless you are running a science experiment...Clients will not like activating a feature with a huge memory error on the screen:) Have a good weekend all...If anyone will be at Raleigh Code Camp on the 15th see you there guys.