<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-2415496026469205746</id><updated>2011-07-29T02:28:49.532-07:00</updated><category term='VS2010'/><category term='NET4'/><category term='EF4'/><category term='XSL'/><category term='app.config'/><category term='MsBuild'/><title type='text'>Fredrik Knutson's scattered thoughts</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://fknut.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2415496026469205746/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://fknut.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Knutte</name><uri>http://www.blogger.com/profile/15424360177979312055</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://3.bp.blogspot.com/_qcg-olvY7yw/Sw8I8yMmN9I/AAAAAAAAAB4/tDflBePJR8c/S220/fknut.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>3</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-2415496026469205746.post-2400624893422943535</id><published>2009-11-26T13:14:00.000-08:00</published><updated>2009-11-26T14:59:38.795-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='NET4'/><category scheme='http://www.blogger.com/atom/ns#' term='XSL'/><category scheme='http://www.blogger.com/atom/ns#' term='MsBuild'/><category scheme='http://www.blogger.com/atom/ns#' term='app.config'/><title type='text'>app.config transformation with the new MsBuild task XslTransformation in .NET4</title><content type='html'>I want to have different connection strings, server paths, etc. in my app.config files for different build configurations. MS have solved this in a nice way inVS2010 Web Deployment with web.config transformations but that's regretfully not available in my non web projects.&lt;br /&gt;&lt;br /&gt;I'm trying to accomplish something similar to my app.config files by including xslt files in my projects and then have MsBuild execute transformations at build time. I just found that in version 4 of the Microsoft.Build.Tasks (Microsoft.Build.Tasks.v4.0.dll) there is a new task called XslTransformation which is cool, as we no longer have to write our own custom task for this!&lt;br /&gt;&lt;br /&gt;By using a simple xsl file with the following contents I can replace a named connection string (Test) with a new one. This is very similar to the behaviour of the web.config transformations though the XDT syntax is a bit simpler.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:78%;"&gt;&amp;lt;?xml version="1.0" encoding="utf-8"?&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl"&amp;gt;&lt;br /&gt;   &amp;lt;xsl:output method="xml" indent="yes"/&amp;gt;&lt;br /&gt;&lt;br /&gt;    &amp;lt;!-- Default template --&amp;gt;&lt;br /&gt;    &amp;lt;xsl:template match="@*  node()"&amp;gt;&lt;br /&gt;        &amp;lt;xsl:copy&amp;gt;&lt;br /&gt;            &amp;lt;xsl:apply-templates select="@*  node()"/&amp;gt;&lt;br /&gt;        &amp;lt;/xsl:copy&amp;gt;&lt;br /&gt;    &amp;lt;/xsl:template&amp;gt;&lt;br /&gt;&lt;br /&gt;    &amp;lt;!-- Connection string replacement template --&amp;gt;&lt;br /&gt;    &amp;lt;xsl:template match="/configuration/connectionStrings/add[@name='Test']"&amp;gt;&lt;br /&gt;        &amp;lt;add name="Test" connectionString="NewValue" providerName="System.Data.EntityClient" /&amp;gt;&lt;br /&gt;    &amp;lt;/xsl:template&amp;gt;&lt;br /&gt;&amp;lt;/xsl:stylesheet&amp;gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2415496026469205746-2400624893422943535?l=fknut.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fknut.blogspot.com/feeds/2400624893422943535/comments/default' title='Kommentarer till inlägget'/><link rel='replies' type='text/html' href='http://fknut.blogspot.com/2009/11/appconfig-transformation-with-new.html#comment-form' title='2 kommentarer'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2415496026469205746/posts/default/2400624893422943535'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2415496026469205746/posts/default/2400624893422943535'/><link rel='alternate' type='text/html' href='http://fknut.blogspot.com/2009/11/appconfig-transformation-with-new.html' title='app.config transformation with the new MsBuild task XslTransformation in .NET4'/><author><name>Knutte</name><uri>http://www.blogger.com/profile/15424360177979312055</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://3.bp.blogspot.com/_qcg-olvY7yw/Sw8I8yMmN9I/AAAAAAAAAB4/tDflBePJR8c/S220/fknut.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2415496026469205746.post-8716904829225345152</id><published>2009-11-25T01:28:00.000-08:00</published><updated>2009-11-25T01:35:45.697-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='EF4'/><category scheme='http://www.blogger.com/atom/ns#' term='VS2010'/><title type='text'>UNIQUE constraint on properties in the EDM (EF4)</title><content type='html'>&lt;span style="font-family:georgia;"&gt;There is no built in way of accomplishing this. The best way I've found to do this is to: &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt;&lt;ol&gt;&lt;li&gt;Modify the database generation workflow, look for annotations in the CSDL and move them to the SSDL. This &lt;a href="http://blogs.msdn.com/dsimmons/archive/2009/06/27/d3-fun-with-concurrency-and-model-first-part-2.aspx"&gt;post&lt;/a&gt; by Dan Simmons on the EF-team explains how to do it.&lt;br /&gt;Modify the T4 that sits behind the SSDL to DDL activity and have it produce a UNIQUE constraint for each field that has been annotaded.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Build an extension to the EF designer / property sheet to allow for annotations to the Entity Properties. An example on how to do this can be found in &lt;a href="http://code.msdn.microsoft.com/DesignerExtStartKit"&gt;ADO.NET Entity Data Model Designer Extension Starter Kit&lt;/a&gt;.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Annotate the Entities/Properties in you EF Data Model where you want to have a UNIQUE constraint.&lt;/span&gt; &lt;/li&gt;&lt;/ol&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2415496026469205746-8716904829225345152?l=fknut.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fknut.blogspot.com/feeds/8716904829225345152/comments/default' title='Kommentarer till inlägget'/><link rel='replies' type='text/html' href='http://fknut.blogspot.com/2009/11/unique-constraint-on-properties-in-edm.html#comment-form' title='0 kommentarer'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2415496026469205746/posts/default/8716904829225345152'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2415496026469205746/posts/default/8716904829225345152'/><link rel='alternate' type='text/html' href='http://fknut.blogspot.com/2009/11/unique-constraint-on-properties-in-edm.html' title='UNIQUE constraint on properties in the EDM (EF4)'/><author><name>Knutte</name><uri>http://www.blogger.com/profile/15424360177979312055</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://3.bp.blogspot.com/_qcg-olvY7yw/Sw8I8yMmN9I/AAAAAAAAAB4/tDflBePJR8c/S220/fknut.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2415496026469205746.post-7557493160236955657</id><published>2009-11-25T00:28:00.000-08:00</published><updated>2009-11-25T01:27:44.700-08:00</updated><title type='text'>Started to blog (again).</title><content type='html'>&lt;span style="font-family:georgia;"&gt;I've realized I need to start blogging (again). The project I'm working on is all VS2010/.NET4, EF Feature CTP and soon also WCF/WF hosted in AppFabric.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt;In this blog I'll try to write a bit about problems and ideas we come across during the project and how we solve and implement them.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt;Stuff that I haven't written about (but might on request) include:&lt;/span&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-family:georgia;"&gt;Modifications to the EF Feature CTP 1 - Self Tracking Entities types.tt T4.&lt;br /&gt;Including implementation of&lt;/span&gt;&lt;span style="font-family:courier new;"&gt; INotifyPropertyChange&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-family:georgia;"&gt;How to workaround database-generation bug in EF4 when having set &lt;span style="font-family:courier new;"&gt;ConcurrencyMode&lt;/span&gt; for a property.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-family:georgia;"&gt;How to allow for rowversion type in generated DDL from EF Data Model&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-family:georgia;"&gt;How to overcome incompability between EF Feature CTP1 and EF4 Beta 2 by creating a 'FrankenBuild' of the CTP1.&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-family:georgia;"&gt;Hope you will enjoy this blog (and that I can deliver)&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2415496026469205746-7557493160236955657?l=fknut.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fknut.blogspot.com/feeds/7557493160236955657/comments/default' title='Kommentarer till inlägget'/><link rel='replies' type='text/html' href='http://fknut.blogspot.com/2009/11/started-to-blog-again.html#comment-form' title='0 kommentarer'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2415496026469205746/posts/default/7557493160236955657'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2415496026469205746/posts/default/7557493160236955657'/><link rel='alternate' type='text/html' href='http://fknut.blogspot.com/2009/11/started-to-blog-again.html' title='Started to blog (again).'/><author><name>Knutte</name><uri>http://www.blogger.com/profile/15424360177979312055</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://3.bp.blogspot.com/_qcg-olvY7yw/Sw8I8yMmN9I/AAAAAAAAAB4/tDflBePJR8c/S220/fknut.jpg'/></author><thr:total>0</thr:total></entry></feed>
