<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Computer and me</title>
	<atom:link href="http://er2v.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://er2v.wordpress.com</link>
	<description>Just another WordPress.com weblog</description>
	<lastBuildDate>Sun, 02 May 2010 10:29:44 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='er2v.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Computer and me</title>
		<link>http://er2v.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://er2v.wordpress.com/osd.xml" title="Computer and me" />
	<atom:link rel='hub' href='http://er2v.wordpress.com/?pushpress=hub'/>
		<item>
		<title>ASP.NET MVC 2 client validation with Enterprise Library 5.0 Application Validation Block</title>
		<link>http://er2v.wordpress.com/2010/05/02/asp-net-mvc-2-client-validation-with-enterprise-library-5-0-application-validation-block/</link>
		<comments>http://er2v.wordpress.com/2010/05/02/asp-net-mvc-2-client-validation-with-enterprise-library-5-0-application-validation-block/#comments</comments>
		<pubDate>Sun, 02 May 2010 10:29:44 +0000</pubDate>
		<dc:creator>er2v</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://er2v.wordpress.com/?p=41</guid>
		<description><![CDATA[Not so long ago I learned about new validation aaproach in MVC 2. It&#8217;s realy cool and extensible. My favorite validation framework is Application Validation Block from Enterprise Library 5.0 from Microsoft&#8217;s patterns and practices team. It&#8217;s widely adopted and I thought that there is some implementations of validation using this framevork for MVC 2. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=er2v.wordpress.com&amp;blog=7353710&amp;post=41&amp;subd=er2v&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Not so long ago I learned about new validation aaproach in MVC 2. It&#8217;s realy cool and extensible.</p>
<p>My favorite validation framework is Application Validation Block from Enterprise Library 5.0 from Microsoft&#8217;s patterns and practices team. It&#8217;s widely adopted and I thought that there is some implementations of validation using this framevork for MVC 2. There were not, and this is realy surprised me.</p>
<p>All I found was <a href="http://bradwilson.typepad.com/blog/2009/10/enterprise-library-validation-example-for-aspnet-mvc-2.html">http://bradwilson.typepad.com/blog/2009/10/enterprise-library-validation-example-for-aspnet-mvc-2.html</a> this post from Brad Wilson &#8211; so this was my start point in implementation of full featured support for Validation Block. As MVC&#8217;s 2 approach is realy extensible it was not very hard, but there is a lot of work if you want to do something realy good.</p>
<p>I don&#8217;t want to do everething by myself <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  so I decided to make it available via CodePlex. Meet <a href="http://elvalweb.codeplex.com/">http://elvalweb.codeplex.com/</a> &#8211; my contribution to the hard work of validation <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/er2v.wordpress.com/41/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/er2v.wordpress.com/41/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/er2v.wordpress.com/41/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/er2v.wordpress.com/41/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/er2v.wordpress.com/41/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/er2v.wordpress.com/41/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/er2v.wordpress.com/41/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/er2v.wordpress.com/41/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/er2v.wordpress.com/41/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/er2v.wordpress.com/41/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/er2v.wordpress.com/41/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/er2v.wordpress.com/41/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/er2v.wordpress.com/41/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/er2v.wordpress.com/41/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=er2v.wordpress.com&amp;blog=7353710&amp;post=41&amp;subd=er2v&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://er2v.wordpress.com/2010/05/02/asp-net-mvc-2-client-validation-with-enterprise-library-5-0-application-validation-block/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/85f8230bca7e598f925d0819eba8aaf4?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">er2v</media:title>
		</media:content>
	</item>
		<item>
		<title>How to create Microsoft SDKs v6.0A Bootstrapper DotNetFx35SP1</title>
		<link>http://er2v.wordpress.com/2010/04/22/how-to-create-microsoft-sdks-v6-0a-bootstrapper-dotnetfx35sp1/</link>
		<comments>http://er2v.wordpress.com/2010/04/22/how-to-create-microsoft-sdks-v6-0a-bootstrapper-dotnetfx35sp1/#comments</comments>
		<pubDate>Thu, 22 Apr 2010 18:01:57 +0000</pubDate>
		<dc:creator>er2v</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://er2v.wordpress.com/?p=36</guid>
		<description><![CDATA[As I&#8217;ve found out there were no files for .Net Framework 3.5 SP1 in the Microsoft SDKs\Windows\v6.0A\Bootstrapper\Packages\DotNetFx35SP1 folder. There were only packages.xml and en folder with product.xml and eula. Actualy it&#8217;s not hard to create it by youself. Clear Microsoft SDKs\Windows\v6.0A\Bootstrapper\Packages\DotNetFx35SP1 folder Just download framework installer, open it whith archiver like rar or 7zip and [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=er2v.wordpress.com&amp;blog=7353710&amp;post=36&amp;subd=er2v&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>As I&#8217;ve found out there were no files for .Net Framework 3.5 SP1 in the Microsoft SDKs\Windows\v6.0A\Bootstrapper\Packages\DotNetFx35SP1 folder. There were only packages.xml and en folder with product.xml and eula.</p>
<p>Actualy it&#8217;s not hard to create it by youself.</p>
<ul>
<li>Clear Microsoft SDKs\Windows\v6.0A\Bootstrapper\Packages\DotNetFx35SP1 folder</li>
<li>Just <a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=AB99342F-5D1A-413D-8319-81DA479AB0D7&amp;displaylang=en">download framework installer</a>, open it whith archiver like rar or 7zip and copy it&#8217;s content to the Microsoft SDKs\Windows\v6.0A\Bootstrapper\Packages\DotNetFx35SP1 folder.</li>
<li>Download folder with product.xml, package.xml and en folder from <a href="http://92.248.232.12/DotNetFX35SP1.zip">here</a>, and put it&#8217;s content to Microsoft SDKs\Windows\v6.0A\Bootstrapper\Packages\DotNetFx35SP1</li>
</ul>
<p>The files product.xml file in download addreses issue that is described in <a href="http://download.microsoft.com/download/A/2/8/A2807F78-C861-4B66-9B31-9205C3F22252/VS2008SP1Readme.htm#General%20Issues">this document</a> in the 2.3.1.1 paragraph.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/er2v.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/er2v.wordpress.com/36/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/er2v.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/er2v.wordpress.com/36/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/er2v.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/er2v.wordpress.com/36/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/er2v.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/er2v.wordpress.com/36/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/er2v.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/er2v.wordpress.com/36/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/er2v.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/er2v.wordpress.com/36/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/er2v.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/er2v.wordpress.com/36/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=er2v.wordpress.com&amp;blog=7353710&amp;post=36&amp;subd=er2v&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://er2v.wordpress.com/2010/04/22/how-to-create-microsoft-sdks-v6-0a-bootstrapper-dotnetfx35sp1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/85f8230bca7e598f925d0819eba8aaf4?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">er2v</media:title>
		</media:content>
	</item>
		<item>
		<title>ClickOnce IIS7 Unable to add &#8216;dotnetfx35sp1/dotNetFX20/aspnet.msp&#8217; to the Web site.</title>
		<link>http://er2v.wordpress.com/2010/04/22/clickonce-iis7-unable-to-add-dotnetfx35sp1dotnetfx20aspnet-msp-to-the-web-site/</link>
		<comments>http://er2v.wordpress.com/2010/04/22/clickonce-iis7-unable-to-add-dotnetfx35sp1dotnetfx20aspnet-msp-to-the-web-site/#comments</comments>
		<pubDate>Thu, 22 Apr 2010 17:27:56 +0000</pubDate>
		<dc:creator>er2v</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://er2v.wordpress.com/?p=32</guid>
		<description><![CDATA[Today I decided to publish our internal project with ClickOnce technologie on our IIS 7 web site and I&#8217;ve got several problems google helped me to solve. But there was one that I had to solve by myself. I desided, that .Net framework 3.5 sp1 should be located in same location application does, not to [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=er2v.wordpress.com&amp;blog=7353710&amp;post=32&amp;subd=er2v&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Today I decided to publish our internal project with ClickOnce technologie on our IIS 7 web site and I&#8217;ve got several problems google helped me to solve. But there was one that I had to solve by myself.</p>
<p>I desided, that .Net framework 3.5 sp1 should be located in same location application does,  not to download it from vendors server.<br />
After I pressed publish button some files been published, but the process had stop when it tryed to publish dotnetfx35sp1/dotNetFX20/aspnet.msp file and showed error following error</p>
<blockquote><p>Failed to copy file &#8216;C:\Dev\work\ASC-projects\Asc.Inside.Client\bin\Debug\app.publish\dotnetfx35sp1\dotNetFX20\aspnet.msp&#8217; to &#8216;http://svnsrv/AscProjects/dotnetfx35sp1/dotNetFX20/aspnet.msp&#8217;. Unable to add &#8216;dotnetfx35sp1/dotNetFX20/aspnet.msp&#8217; to the Web site. The server unexpectedly closed the connection.</p></blockquote>
<p>The reason was in MIME types. There were no MIME type  for .msp</p>
<p>So all I did was adding</p>
<blockquote><p><em>.msp application/octed-stream<br />
.msu application/octed-stream</em></p></blockquote>
<p>in the IIS Manager. There are button to config MIME Types in the features view of server node or website node.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/er2v.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/er2v.wordpress.com/32/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/er2v.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/er2v.wordpress.com/32/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/er2v.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/er2v.wordpress.com/32/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/er2v.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/er2v.wordpress.com/32/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/er2v.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/er2v.wordpress.com/32/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/er2v.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/er2v.wordpress.com/32/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/er2v.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/er2v.wordpress.com/32/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=er2v.wordpress.com&amp;blog=7353710&amp;post=32&amp;subd=er2v&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://er2v.wordpress.com/2010/04/22/clickonce-iis7-unable-to-add-dotnetfx35sp1dotnetfx20aspnet-msp-to-the-web-site/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/85f8230bca7e598f925d0819eba8aaf4?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">er2v</media:title>
		</media:content>
	</item>
		<item>
		<title>Form for Connection String Building</title>
		<link>http://er2v.wordpress.com/2009/08/08/form-for-connection-string-building/</link>
		<comments>http://er2v.wordpress.com/2009/08/08/form-for-connection-string-building/#comments</comments>
		<pubDate>Sat, 08 Aug 2009 13:24:03 +0000</pubDate>
		<dc:creator>er2v</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://er2v.wordpress.com/?p=30</guid>
		<description><![CDATA[Few days ago I had t0 create form, that will just let user to define connection string. I was pretty shure that there I&#8217;ll find working example in google, but I could not. So I had to write it by myself. First of all I&#8217;ve created class SimpleConnectionStringBuilder, that implements INotifyPropertyChanged, so I could bind [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=er2v.wordpress.com&amp;blog=7353710&amp;post=30&amp;subd=er2v&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Few days ago I had t0 create form, that will just let user to define connection string. I was pretty shure that there I&#8217;ll find working example in google, but I could not. So I had to write it by myself.</p>
<p>First of all I&#8217;ve created class SimpleConnectionStringBuilder, that implements INotifyPropertyChanged, so I could bind it.<br />
<code></p>
<pre>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.SqlClient;
using System.ComponentModel;

namespace Asc.Utils.WinForms {

	public class SimpleConnectionStringBuilder : INotifyPropertyChanged
	{
		private SqlConnectionStringBuilder stringBuilder = new SqlConnectionStringBuilder();

		public SimpleConnectionStringBuilder() { }

		public SimpleConnectionStringBuilder(string ConnectionString) {
			stringBuilder.ConnectionString = ConnectionString;
		}

		public string ConnectionString {
			get { return stringBuilder.ConnectionString; }
			set { stringBuilder.ConnectionString = value; }
		}

		public string ServerName {
			get { return stringBuilder.DataSource; }
			set {
				stringBuilder.DataSource = value;
				PropertyChanged(this, new PropertyChangedEventArgs("ServerName"));
			}
		}

		public string Database {
			get { return stringBuilder.InitialCatalog; }
			set {
				stringBuilder.InitialCatalog = value;
				PropertyChanged(this, new PropertyChangedEventArgs("Database"));
			}
		}

		public string User {
			get { return stringBuilder.UserID; }
			set {
				stringBuilder.UserID = value;
				PropertyChanged(this, new PropertyChangedEventArgs("User"));
			}
		}

		public string Password {
			get { return stringBuilder.Password; }
			set {
				stringBuilder.Password = value;
				PropertyChanged(this, new PropertyChangedEventArgs("Password"));
			}
		}

		public bool IntegratedSecurity {
			get { return stringBuilder.IntegratedSecurity; }
			set {
				stringBuilder.IntegratedSecurity = value;
				PropertyChanged(this, new PropertyChangedEventArgs("IntegratedSecurity"));
			}
		}

		#region INotifyPropertyChanged Members

		public event PropertyChangedEventHandler PropertyChanged;

		#endregion
	}
}
</pre>
<p></code></p>
<p>So then I&#8217;ve created form with the following code:</p>
<p><code><br />
using System;<br />
using System.ComponentModel;<br />
using System.Data;<br />
using System.Data.Sql;<br />
using System.Data.SqlClient;<br />
using System.Windows.Forms;</p>
<p>namespace Asc.Utils.WinForms {</p>
<p>	public partial class ConnectionBuilderForm : System.Windows.Forms.Form {</p>
<p>		public static string GetConnectionString() {<br />
			ConnectionBuilderForm form = new ConnectionBuilderForm();<br />
			return ReadString(false, ref form);<br />
		}</p>
<p>		public static string GetConnectionString(bool ShowTopMost) {<br />
			ConnectionBuilderForm form = new ConnectionBuilderForm();<br />
			return ReadString(ShowTopMost, ref form);<br />
		}</p>
<p>		public static string ModifyConnectionString(string ConnectionString) {<br />
			return  ModifyConnectionString(ConnectionString, false );<br />
		}</p>
<p>		public static string ModifyConnectionString(string ConnectionString, bool ShowTopMost ) {<br />
			ConnectionBuilderForm form = new ConnectionBuilderForm(ConnectionString);<br />
			return ReadString(ShowTopMost, ref form);</p>
<p>		}</p>
<p>		private static string ReadString(bool ShowTopMost, ref ConnectionBuilderForm form) {<br />
			form.TopMost = ShowTopMost;<br />
			form.ShowDialog();<br />
			string connectionString = form.ConnectionString;<br />
			form.Dispose();<br />
			form = null;<br />
			return connectionString;<br />
		}	</p>
<p>		public ConnectionBuilderForm() {<br />
			InitializeComponent();<br />
			simpleConnectionStringBuilderBindingSource.DataSource = ConnectionBuilder;<br />
			ConnectionBuilder.PropertyChanged += new PropertyChangedEventHandler(ConnectionBuilder_PropertyChanged);<br />
		}		</p>
<p>		public ConnectionBuilderForm(string ConnectionString)<br />
			: this() {<br />
			ConnectionBuilder.ConnectionString = ConnectionString;<br />
		}</p>
<p>		public string ConnectionString {<br />
			get { return ConnectionBuilder.ConnectionString; }<br />
			set { ConnectionBuilder.ConnectionString = value; }<br />
		}</p>
<p>		private SimpleConnectionStringBuilder ConnectionBuilder = new SimpleConnectionStringBuilder();</p>
<p>		private bool needToReloadDataBases = true;</p>
<p>		private void ConnectionBuilder_PropertyChanged(object sender, PropertyChangedEventArgs e) {<br />
			cmbBd.Items.Clear();<br />
			needToReloadDataBases = true;<br />
		}</p>
<p>		private void ReloadDatabases() {<br />
			SqlConnection sqlConx = new SqlConnection(ConnectionBuilder.ConnectionString);</p>
<p>			try {<br />
				sqlConx.Open();<br />
				DataTable tblDatabases = tblDatabases = sqlConx.GetSchema("Databases");<br />
				foreach (DataRow row in tblDatabases.Rows) {<br />
					cmbBd.Items.Add(row["database_name"]);<br />
				}<br />
				needToReloadDataBases = false;<br />
				cmbBd.DroppedDown = true;</p>
<p>			}<br />
			catch {<br />
			}<br />
			finally {<br />
				sqlConx.Close();<br />
			}<br />
		}		</p>
<p>		private void radioItegratedSequrity_SelectedIndexChanged(object sender, EventArgs e) {<br />
			txtPassword.Enabled = !radioButton1.Checked;<br />
			txtUser.Enabled = !radioButton1.Checked;<br />
		}</p>
<p>		private void btnTest_Click(object sender, EventArgs e) {<br />
			SqlConnection sqlConx = new SqlConnection(ConnectionBuilder.ConnectionString);<br />
			bool success = true;<br />
			Exception exception = null;<br />
			try {<br />
				sqlConx.Open();<br />
			}<br />
			catch (Exception exc) {<br />
				success = false;<br />
				exception = exc;<br />
			}<br />
			finally {<br />
				sqlConx.Close();<br />
			}</p>
<p>			if (success) {<br />
				MessageBox.Show("Connection successfully tested", "Success");<br />
			}<br />
			else {<br />
				MessageBox.Show("Connection failed:\n " + exception.Message, "Fail");<br />
			}<br />
		}</p>
<p>		private void btnSave_Click(object sender, EventArgs e) {<br />
			Close();<br />
		}</p>
<p>		private void FindNetworkServers() {<br />
			var instance = SqlDataSourceEnumerator.Instance;<br />
			var table = instance.GetDataSources();<br />
			foreach (DataRow row in table.Rows) {<br />
				string serverName = row["ServerName"].ToString();<br />
				string instanceName = row["InstanceName"].ToString();</p>
<p>				string serverFullName = serverName +<br />
					(instanceName != string.Empty &amp;&amp; instanceName != "\\" ? "\\" + instanceName : "");<br />
				if (InvokeRequired) {<br />
					Invoke(new Action(() =&gt; cmbServer.Items.Add(serverFullName)));<br />
				}<br />
				else {<br />
					cmbServer.Items.Add(serverFullName);<br />
				}<br />
			}<br />
		}</p>
<p>		private BackgroundWorker backgroundWorker = new BackgroundWorker();<br />
		private bool serversBeenAlreadySearched = false;</p>
<p>		private void bgw_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) {<br />
			serversBeenAlreadySearched = true;<br />
			ajax.Visible = false;<br />
			cmbServer.DroppedDown = true;<br />
		}</p>
<p>		private void bgw_DoWork(object sender, DoWorkEventArgs e) {<br />
			Invoke(new Action(() =&gt; ajax.Visible = true));<br />
			FindNetworkServers();<br />
		}				</p>
<p>		private void cmbServer_DropDown(object sender, EventArgs e) {<br />
			if (!backgroundWorker.IsBusy &amp;&amp; !serversBeenAlreadySearched) {<br />
				backgroundWorker.DoWork += new DoWorkEventHandler(bgw_DoWork);<br />
				backgroundWorker.RunWorkerCompleted += new RunWorkerCompletedEventHandler(bgw_RunWorkerCompleted);<br />
				backgroundWorker.RunWorkerAsync();<br />
			}<br />
		}</p>
<p>		private void cmbBd_DropDown(object sender, EventArgs e) {<br />
			if (needToReloadDataBases) {<br />
				ReloadDatabases();<br />
			}<br />
			needToReloadDataBases = false;<br />
		}</p>
<p>		private void ConnectionBuilderForm_Load(object sender, EventArgs e) {<br />
			Activate();<br />
		}</p>
<p>	}<br />
}<br />
</code></p>
<p>And the designer class was </p>
<p><code></p>
<pre>
using System.Windows.Forms;
namespace Asc.Utils.WinForms {
	partial class ConnectionBuilderForm {
		///
		/// Required designer variable.
		///
		private System.ComponentModel.IContainer components = null;

		///
		/// Clean up any resources being used.
		///
		/// true if managed resources should be disposed; otherwise, false.
		protected override void Dispose(bool disposing) {
			if (disposing &amp;&amp; (components != null)) {
				components.Dispose();
			}
			base.Dispose(disposing);
		}

		#region Windows Form Designer generated code

		///
		/// Required method for Designer support - do not modify
		/// the contents of this method with the code editor.
		///
		private void InitializeComponent() {
			this.components = new System.ComponentModel.Container();
			System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ConnectionBuilderForm));
			this.btnSave = new System.Windows.Forms.Button();
			this.btnTest = new System.Windows.Forms.Button();
			this.cmbBd = new System.Windows.Forms.ComboBox();
			this.simpleConnectionStringBuilderBindingSource = new System.Windows.Forms.BindingSource(this.components);
			this.txtPassword = new System.Windows.Forms.TextBox();
			this.txtUser = new System.Windows.Forms.TextBox();
			this.cmbServer = new System.Windows.Forms.ComboBox();
			this.ajax = new System.Windows.Forms.PictureBox();
			this.labelControl1 = new System.Windows.Forms.Label();
			this.labelControl2 = new System.Windows.Forms.Label();
			this.labelControl3 = new System.Windows.Forms.Label();
			this.labelControl4 = new System.Windows.Forms.Label();
			this.radioButton1 = new System.Windows.Forms.RadioButton();
			this.radioButton2 = new System.Windows.Forms.RadioButton();
			((System.ComponentModel.ISupportInitialize)(this.simpleConnectionStringBuilderBindingSource)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.ajax)).BeginInit();
			this.SuspendLayout();
			//
			// btnSave
			//
			this.btnSave.Location = new System.Drawing.Point(271, 195);
			this.btnSave.Name = "btnSave";
			this.btnSave.Size = new System.Drawing.Size(90, 30);
			this.btnSave.TabIndex = 10;
			this.btnSave.Text = "Save";
			this.btnSave.Click += new System.EventHandler(this.btnSave_Click);
			//
			// btnTest
			//
			this.btnTest.Location = new System.Drawing.Point(169, 195);
			this.btnTest.Name = "btnTest";
			this.btnTest.Size = new System.Drawing.Size(91, 30);
			this.btnTest.TabIndex = 9;
			this.btnTest.Text = "Test";
			this.btnTest.Click += new System.EventHandler(this.btnTest_Click);
			//
			// cmbBd
			//
			this.cmbBd.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.simpleConnectionStringBuilderBindingSource, "Database", true));
			this.cmbBd.Location = new System.Drawing.Point(115, 164);
			this.cmbBd.Name = "cmbBd";
			this.cmbBd.Size = new System.Drawing.Size(246, 21);
			this.cmbBd.TabIndex = 8;
			this.cmbBd.DropDown += new System.EventHandler(this.cmbBd_DropDown);
			//
			// simpleConnectionStringBuilderBindingSource
			//
			this.simpleConnectionStringBuilderBindingSource.DataSource = typeof(Asc.Utils.WinForms.SimpleConnectionStringBuilder);
			//
			// txtPassword
			//
			this.txtPassword.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.simpleConnectionStringBuilderBindingSource, "Password", true));
			this.txtPassword.Location = new System.Drawing.Point(115, 133);
			this.txtPassword.Name = "txtPassword";
			this.txtPassword.PasswordChar = '*';
			this.txtPassword.Size = new System.Drawing.Size(246, 20);
			this.txtPassword.TabIndex = 7;
			//
			// txtUser
			//
			this.txtUser.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.simpleConnectionStringBuilderBindingSource, "User", true));
			this.txtUser.Location = new System.Drawing.Point(115, 102);
			this.txtUser.Name = "txtUser";
			this.txtUser.Size = new System.Drawing.Size(246, 20);
			this.txtUser.TabIndex = 6;
			//
			// cmbServer
			//
			this.cmbServer.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.simpleConnectionStringBuilderBindingSource, "ServerName", true));
			this.cmbServer.Location = new System.Drawing.Point(115, 8);
			this.cmbServer.Name = "cmbServer";
			this.cmbServer.Size = new System.Drawing.Size(246, 21);
			this.cmbServer.TabIndex = 4;
			this.cmbServer.DropDown += new System.EventHandler(this.cmbServer_DropDown);
			//
			// ajax
			//
			this.ajax.BackColor = System.Drawing.Color.Transparent;
			this.ajax.Image = ((System.Drawing.Image)(resources.GetObject("ajax.Image")));
			this.ajax.Location = new System.Drawing.Point(86, 4);
			this.ajax.Name = "ajax";
			this.ajax.Size = new System.Drawing.Size(26, 26);
			this.ajax.TabIndex = 12;
			this.ajax.TabStop = false;
			this.ajax.Visible = false;
			//
			// labelControl1
			//
			this.labelControl1.AutoSize = true;
			this.labelControl1.Location = new System.Drawing.Point(5, 8);
			this.labelControl1.Name = "labelControl1";
			this.labelControl1.Size = new System.Drawing.Size(70, 13);
			this.labelControl1.TabIndex = 0;
			this.labelControl1.Text = "Server name:";
			//
			// labelControl2
			//
			this.labelControl2.Location = new System.Drawing.Point(5, 102);
			this.labelControl2.Name = "labelControl2";
			this.labelControl2.Size = new System.Drawing.Size(107, 20);
			this.labelControl2.TabIndex = 6;
			this.labelControl2.Text = "User: ";
			//
			// labelControl3
			//
			this.labelControl3.Location = new System.Drawing.Point(5, 133);
			this.labelControl3.Name = "labelControl3";
			this.labelControl3.Size = new System.Drawing.Size(57, 20);
			this.labelControl3.TabIndex = 7;
			this.labelControl3.Text = "Password:";
			//
			// labelControl4
			//
			this.labelControl4.Location = new System.Drawing.Point(5, 164);
			this.labelControl4.Name = "labelControl4";
			this.labelControl4.Size = new System.Drawing.Size(77, 20);
			this.labelControl4.TabIndex = 8;
			this.labelControl4.Text = "Database:";
			//
			// radioButton1
			//
			this.radioButton1.AutoSize = true;
			this.radioButton1.DataBindings.Add(new System.Windows.Forms.Binding("Checked", this.simpleConnectionStringBuilderBindingSource, "IntegratedSecurity", true));
			this.radioButton1.Location = new System.Drawing.Point(15, 45);
			this.radioButton1.Name = "radioButton1";
			this.radioButton1.Size = new System.Drawing.Size(145, 17);
			this.radioButton1.TabIndex = 13;
			this.radioButton1.Text = "Windows Authentification";
			this.radioButton1.UseVisualStyleBackColor = true;
			this.radioButton1.CheckedChanged += new System.EventHandler(this.radioItegratedSequrity_SelectedIndexChanged);
			//
			// radioButton2
			//
			this.radioButton2.AutoSize = true;
			this.radioButton2.Checked = true;
			this.radioButton2.Location = new System.Drawing.Point(15, 69);
			this.radioButton2.Name = "radioButton2";
			this.radioButton2.Size = new System.Drawing.Size(156, 17);
			this.radioButton2.TabIndex = 14;
			this.radioButton2.TabStop = true;
			this.radioButton2.Text = "SQL Server Authentification";
			this.radioButton2.UseVisualStyleBackColor = true;
			this.radioButton2.CheckedChanged += new System.EventHandler(this.radioItegratedSequrity_SelectedIndexChanged);
			//
			// ConnectionBuilderForm
			//
			this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
			this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
			this.ClientSize = new System.Drawing.Size(367, 229);
			this.ControlBox = false;
			this.Controls.Add(this.radioButton2);
			this.Controls.Add(this.radioButton1);
			this.Controls.Add(this.labelControl1);
			this.Controls.Add(this.cmbServer);
			this.Controls.Add(this.ajax);
			this.Controls.Add(this.labelControl2);
			this.Controls.Add(this.btnSave);
			this.Controls.Add(this.txtUser);
			this.Controls.Add(this.btnTest);
			this.Controls.Add(this.labelControl3);
			this.Controls.Add(this.cmbBd);
			this.Controls.Add(this.txtPassword);
			this.Controls.Add(this.labelControl4);
			this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
			this.Name = "ConnectionBuilderForm";
			this.ShowIcon = false;
			this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
			this.Text = "Connection";
			this.Load += new System.EventHandler(this.ConnectionBuilderForm_Load);
			((System.ComponentModel.ISupportInitialize)(this.simpleConnectionStringBuilderBindingSource)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.ajax)).EndInit();
			this.ResumeLayout(false);
			this.PerformLayout();

		}

		#endregion

		private ComboBox cmbServer;
		private ComboBox cmbBd;
		private TextBox txtPassword;
		private TextBox txtUser;
		private System.Windows.Forms.Button btnSave;
		private System.Windows.Forms.Button btnTest;
		private System.Windows.Forms.BindingSource simpleConnectionStringBuilderBindingSource;
		private System.Windows.Forms.PictureBox ajax;
		private Label labelControl1;
		private Label labelControl2;
		private Label labelControl3;
		private Label labelControl4;
		private RadioButton radioButton1;
		private RadioButton radioButton2;
	}
}
</pre>
<p></code><br />
It will not run becouse of </p>
<p>this.ajax.Image = ((System.Drawing.Image)(resources.GetObject(&#8220;ajax.Image&#8221;)));</p>
<p>the last thing you need to do is -go to http://www.ajaxload.info/ and download any ajax lice icon you whant, and put it into the image box<br />
Use it <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/er2v.wordpress.com/30/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/er2v.wordpress.com/30/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/er2v.wordpress.com/30/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/er2v.wordpress.com/30/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/er2v.wordpress.com/30/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/er2v.wordpress.com/30/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/er2v.wordpress.com/30/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/er2v.wordpress.com/30/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/er2v.wordpress.com/30/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/er2v.wordpress.com/30/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/er2v.wordpress.com/30/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/er2v.wordpress.com/30/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/er2v.wordpress.com/30/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/er2v.wordpress.com/30/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=er2v.wordpress.com&amp;blog=7353710&amp;post=30&amp;subd=er2v&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://er2v.wordpress.com/2009/08/08/form-for-connection-string-building/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/85f8230bca7e598f925d0819eba8aaf4?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">er2v</media:title>
		</media:content>
	</item>
		<item>
		<title>Windows Service Restarting Itself</title>
		<link>http://er2v.wordpress.com/2009/06/10/windows-service-restarting-itself/</link>
		<comments>http://er2v.wordpress.com/2009/06/10/windows-service-restarting-itself/#comments</comments>
		<pubDate>Wed, 10 Jun 2009 15:14:05 +0000</pubDate>
		<dc:creator>er2v</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://er2v.wordpress.com/?p=25</guid>
		<description><![CDATA[Yes, it&#8217;s not possible for the service to be restarted for itself. Actualy this could be very handy. I have two servers, with Sql Server on one of them an service, that connects to this sql server on the start. Sometimes electricity shuts down, so both servers goes down, but when they rises up, server [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=er2v.wordpress.com&amp;blog=7353710&amp;post=25&amp;subd=er2v&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Yes, it&#8217;s not possible for the service to be restarted for itself. Actualy this could be very handy. I have two servers, with Sql Server on one of them an service, that connects to this sql server on the start. Sometimes electricity shuts down, so both servers goes down, but when they rises up, server with Sql server do it slower then server with services, so servise can&#8217;t be started sucessfull. It never starts, nothing ever works. Huge problem. So in my case I needed something that will be starting my service untill connection returns. In my case the problem was, that OnStart event have had initialisation part that had sql connection, and it was realy not so easy to remove this initialisation from OnStart. Actualy I didn&#8217;t whant to do this, becouse it&#8217;s logicall to do initialisation on start. Why am I tolking about this? Becouse there is an easy way to solve the problem.</p>
<h2>Easy Way</h2>
<p>Windows Services have a wonderfull tab. Windows Service Recovery Tab.</p>
<p><img class="alignnone" title="Service recovery" src="http://img-fotki.yandex.ru/get/3506/er-v.5/0_2482b_983471de_L.jpg" alt="" width="410" height="464" /></p>
<p>All you need is  </p>
<p><code></p>
<pre>
  try{
  //code
  }
  catch(SomeException exc)
  {
     ExitCode = -1;
     Environment.Exit(ExitCode);
  }
</pre>
<p></code></p>
<p>But, stupid me, I didn&#8217;t new about this solution and I did it my way.</p>
<h2>Service that starts another service</h2>
<p>I desided to write service, that will check every n minutes is desired services started and start them if they not. The code of such a service is very simple.</p>
<p><code> </code></p>
<p><code></p>
<pre>using System;
using System.ServiceProcess;
using System.Timers;
using System.Configuration;

namespace Asc.ServiceStarter
{
    public partial class ServiceStarterService : ServiceBase
    {
        Timer timer = new Timer();
        public ServiceStarterService()
        {
            InitializeComponent();
        }

        protected override void OnStart(string[] args)
        {
            timer.Elapsed += timer_Elapsed;
            timer.Interval = double.Parse(ConfigurationManager.AppSettings["IntervalInMilliseconds"]);
            timer.Enabled = true;
        }

        void timer_Elapsed(object sender, ElapsedEventArgs e)
        {
            ConfigurationManager.RefreshSection("appSettings");
            timer.Interval = double.Parse(ConfigurationManager.AppSettings["IntervalInMilliseconds"]);
            string[] Services = ConfigurationManager.AppSettings["CommaDelimitedOrderedServicesNames"].Split(new char[] { ',' });
            for (int i = 0; i &lt; Services.Length; i++)
            {
                try
                {
                    string CurrentService = Services[i].Trim();
                    using (ServiceController serviceController = new ServiceController(CurrentService))
                    {
                        if (serviceController.Status == ServiceControllerStatus.Stopped)
                        {
                            serviceController.Start();
                        }
                    }
                }
                catch
                {
                    //Yes, it's never stops
                }

            }

        }

        protected override void OnStop()
        {
            timer.Enabled = false;
        }
    }
}</pre>
<p></code></p>
<p>App.config file should be as follows</p>
<p><code><br />
</code></p>
<p><code></p>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:1674px;width:1px;height:1px;">&lt;?xml version="1.0" encoding="utf-8"?&gt;</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:1674px;width:1px;height:1px;">&lt;configuration&gt;</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:1674px;width:1px;height:1px;">&lt;appSettings&gt;</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:1674px;width:1px;height:1px;">&lt;add key="IntervalInMilliseconds" value="1000" /&gt;</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:1674px;width:1px;height:1px;">&lt;add key="CommaDelimitedOrderedServicesNames" value="CoolingService, Metal Quality" /&gt;</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:1674px;width:1px;height:1px;">&lt;/appSettings&gt;</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:1674px;width:1px;height:1px;">&lt;/configuration&gt;</div>
<p>&lt;?xml version="1.0" encoding="utf-8"?&gt;</p>
<p>&lt;configuration&gt;</p>
<p>&lt;appSettings&gt;</p>
<p>&lt;add key="IntervalInMilliseconds" value="1000" /&gt;</p>
<p>&lt;add key="CommaDelimitedOrderedServicesNames" value="CoolingService, Metal Quality" /&gt;</p>
<p>&lt;/appSettings&gt;</p>
<p>&lt;/configuration&gt;</p>
<p></code></p>
<h3>Security Issues</h3>
<p>Service that that starts another service and this service should be run under the same username. Otherwise Service would not be able to run it.</p>
<p>Hope, someone will use it.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/er2v.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/er2v.wordpress.com/25/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/er2v.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/er2v.wordpress.com/25/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/er2v.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/er2v.wordpress.com/25/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/er2v.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/er2v.wordpress.com/25/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/er2v.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/er2v.wordpress.com/25/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/er2v.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/er2v.wordpress.com/25/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/er2v.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/er2v.wordpress.com/25/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=er2v.wordpress.com&amp;blog=7353710&amp;post=25&amp;subd=er2v&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://er2v.wordpress.com/2009/06/10/windows-service-restarting-itself/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/85f8230bca7e598f925d0819eba8aaf4?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">er2v</media:title>
		</media:content>

		<media:content url="http://img-fotki.yandex.ru/get/3506/er-v.5/0_2482b_983471de_L.jpg" medium="image">
			<media:title type="html">Service recovery</media:title>
		</media:content>
	</item>
		<item>
		<title>32bit ODBC driver on 64bit Vista surprises</title>
		<link>http://er2v.wordpress.com/2009/05/26/vista-odbc-64bit-surprises/</link>
		<comments>http://er2v.wordpress.com/2009/05/26/vista-odbc-64bit-surprises/#comments</comments>
		<pubDate>Tue, 26 May 2009 14:36:50 +0000</pubDate>
		<dc:creator>er2v</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://er2v.wordpress.com/?p=23</guid>
		<description><![CDATA[Once upon a time I&#8217;ve decided to install old 32bit ODBC driver on my 64bit Vista and write and run .Net project, that use it. There were not 64bit driver available so I had no choice.  After passing thru installation of driver without any problems surprises have begun. First big surprise was when I had [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=er2v.wordpress.com&amp;blog=7353710&amp;post=23&amp;subd=er2v&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Once upon a time I&#8217;ve decided to install old 32bit ODBC driver on my 64bit Vista and write and run .Net project, that use it. There were not 64bit driver available so I had no choice. </p>
<p>After passing thru installation of driver without any problems surprises have begun. First big surprise was when I had tried to open Data Sources(ODBC) and to create System DSN.  There were not such a driver. I tried a lot of things, even writing directly to registry &#8211; no result. Finaly I&#8217;ve descovered that there is a folder C:\Windows\SysWOW64 and there is a file odbcad32.exe that is for 32 bit. When you open Administration-&gt;Data Sources(ODBC) it&#8217;s opensC:\Windows\System32\odbcad32.exe  wich works only with 64 bit drivers. So first problem was solved. I was able to create datasource with C:\Windows\SysWOW64\odbcad32.exe.</p>
<p>Second surprise was that Visual Studio project was not able to acees this data source. The problem was in build configuration. After changing active solution platform in Build-&gt;Configuration manager from Any CPU to x86 everething started working just fine. </p>
<p>Hope it helpfull for someone.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/er2v.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/er2v.wordpress.com/23/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/er2v.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/er2v.wordpress.com/23/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/er2v.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/er2v.wordpress.com/23/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/er2v.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/er2v.wordpress.com/23/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/er2v.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/er2v.wordpress.com/23/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/er2v.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/er2v.wordpress.com/23/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/er2v.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/er2v.wordpress.com/23/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=er2v.wordpress.com&amp;blog=7353710&amp;post=23&amp;subd=er2v&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://er2v.wordpress.com/2009/05/26/vista-odbc-64bit-surprises/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/85f8230bca7e598f925d0819eba8aaf4?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">er2v</media:title>
		</media:content>
	</item>
		<item>
		<title>Install Trac on 64 bit Windows and run it under IIS7 fast cgi.</title>
		<link>http://er2v.wordpress.com/2009/04/15/install_trac_on_64_bit_windows_and_run_it_under_iis7_fast_cgi/</link>
		<comments>http://er2v.wordpress.com/2009/04/15/install_trac_on_64_bit_windows_and_run_it_under_iis7_fast_cgi/#comments</comments>
		<pubDate>Wed, 15 Apr 2009 22:02:36 +0000</pubDate>
		<dc:creator>er2v</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[trac iis7 fastcgi python]]></category>

		<guid isPermaLink="false">http://er2v.wordpress.com/?p=4</guid>
		<description><![CDATA[As a windows user, I realy like to download latest versions of sofware, because they have bugfixes ( and brand new bugs I also love everething that is 64bit, and as an ASP.NET developer I love IIS7. So when I decided to install trac to organise our team&#8217;s development process, I&#8217;ve opened http://trac.edgewall.org/wiki/TracOnWindows and started from [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=er2v.wordpress.com&amp;blog=7353710&amp;post=4&amp;subd=er2v&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>As a windows user, I realy like to download latest versions of sofware, because they have bugfixes ( and brand new bugs <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  I also love everething that is 64bit, and as an ASP.NET developer I love IIS7. So when I decided to install <a href="http://trac.edgewall.org/" target="_blank">trac </a> to organise our team&#8217;s development process, I&#8217;ve opened <a href="http://trac.edgewall.org/wiki/TracOnWindows">http://trac.edgewall.org/wiki/TracOnWindows</a> and started from the begin. This article is some kind of the step by step tutorial of how to make it 64 bit IIS7 fast cgi.</p>
<h2>Simple things</h2>
<p>If you are looking for trac, that means that you are already know what svn is. You&#8217;ll need subversion client, such as <a href="http://tortoisesvn.net/downloads">http://tortoisesvn.net/downloads</a>. I&#8217;m pretty shure you already have it. Second thing you need is Visual Studio VC++ to cmpile sources. If you don&#8217;t have it &#8211; you can do the following:</p>
<p>1. Download and install trial professional edition <a href="http://www.microsoft.com/visualstudio/en-us/try/trial-software.mspx">http://www.microsoft.com/visualstudio/en-us/try/trial-software.mspx</a> &#8211; I hope 90 days will be enough to install trac <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>2. Donload free express version <a href="http://www.microsoft.com/express/vc/">http://www.microsoft.com/express/vc/</a> and do the magic guided by <a href="http://jenshuebel.wordpress.com/2009/02/12/visual-c-2008-express-edition-and-64-bit-targets/">http://jenshuebel.wordpress.com/2009/02/12/visual-c-2008-express-edition-and-64-bit-targets/</a></p>
<p>The last thing create folder C:\src4trac\ &#8211; for sources. There will by lot of them <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />   Shourely you can create any folder you like.</p>
<h2>Install Python</h2>
<p>First, that I&#8217;ve read was that I need Python. I was surprised that trac is written on Python. I&#8217;ve never used python before, but alway&#8217;s whanted to try. So without bothering myself with reading of what I need I went  to www.python.org and downloaded 64 bit 2.6.2 python installer. I have not noticed</p>
<blockquote><p><em>Notes regarding 64 bit Python:</em></p>
<ul>
<li><a class="wiki" href="http://trac.edgewall.org/wiki/SetupTools"><em>SetupTools</em></a><em> does not yet provide an install that works with 64-bit Python, it&#8217;s nevertheless possible to use the easy-install-script.py (see </em><a class="ext-link" href="http://bugs.python.org/setuptools/issue2"><span class="icon"><em> </em></span><em>http://bugs.python.org/setuptools/issue2</em></a><em>).</em></li>
<li><em>The Subversion project does not provide amd64 or ia64 setup executables, so if you want to use Subversion integration, you&#8217;ll need to either compile the bindings yourself, or use the x86 version of Python.</em></li>
<li><em>It&#8217;s generally hard to find pre-compiled extensions, so you most often have to compile them yourself (e.g. for Genshi, Mercurial, the bindings for the DB backends) <span style="font-style:normal;"> </span></em></li>
</ul>
</blockquote>
<p>But I realy heapy about not noticed that. I&#8217;ve had very intersting week <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>So, go ahead, install 64 bit Python 2.6.2 or later.</p>
<h2>Install easy_install</h2>
<p>The second thing we&#8217;ll not be able to enjoy trac without is easy_install. Easy install is cool thing, it&#8217;s helps install different python programs easily. So you can type in command line<br />
<code><br />
easy_install trac<br />
</code><br />
and it will download and install trac and everething trac needs. You can learn more about this tool here <a href="http://peak.telecommunity.com/DevCenter/EasyInstall">http://peak.telecommunity.com/DevCenter/EasyInstall</a>. Pretty cool, but it&#8217;s not so easy to install easy_install on 64bits <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> . See <span class="icon"><span style="font-style:normal;"><a class="ext-link" href="http://bugs.python.org/setuptools/issue2"> </a></span></span><span style="font-style:normal;"><a class="ext-link" href="http://bugs.python.org/setuptools/issue2">http://bugs.python.org/setuptools/issue2</a>. So let&#8217;s do the folowing. </span></p>
<ol>
<li>Create C:\src4trac\SetupTools folder and checkout with tortoisesvn from <a href="http://svn.python.org/projects/sandbox/branches/setuptools-0.6">http://svn.python.org/projects/sandbox/branches/setuptools-0.6</a></li>
<li>Download <a href="http://bugs.python.org/setuptools/file42/64bitlauncher.patch">64bitlauncher.patch</a> <a class="ext-link" href="http://bugs.python.org/setuptools/issue2">http://bugs.python.org/setuptools/issue2</a> to C:\src4trac\SetupTools folder and apply it (context menu -&gt; tortisesvn-&gt;apply patch)</li>
</ol>
<p><em><span style="font-style:normal;">Now you have cli-64.exe and gui-64.exe files in C:\src4trac\SetupTools\setuptools directory. Open command line (press winkey-r and type cmd) and type</span></em><br />
<code><br />
cd C:\src4trac\SetupTools\setuptools<br />
rename cli.exe cli-old.exe<br />
rename cli-64.exe cli.exe<br />
rename gui.exe gui-old.exe<br />
rename gui-64.exe gui.exe</code></p>
<p>go to  C:\src4trac\SetupTools\ typing<br />
<code><br />
cd ..<br />
</code><br />
and now we can finaly  type<br />
<code><br />
python setup.py install</code></p>
<p>Type<br />
<code><br />
easy_install --help<br />
</code></p>
<p>and if you get error add C:\Python26\Scripts to the PATH environment variable and reload command line.</p>
<p>Congratulations we&#8217;ve overjumped first problem. It was not so hard, and now we can install trac itself <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<h2>Install Trac and Genshi</h2>
<p>If you have internet connection without proxy server &#8211; then simply type</p>
<p><code> easy_install trac<br />
</code></p>
<p>It will do all the job.</p>
<p>If you have proxy on computer you install trac or if you don&#8217;t have internet connection on this computer at all then download from other computer from <a href="http://trac.edgewall.org/wiki/TracDownload">http://trac.edgewall.org/wiki/TracDownload</a> zip or tar of laterst trac(not the installer) and put it&#8217;s unziped/untared content to C:\src4trac\Trac. After that download genshi tar or zip from <a href="http://genshi.edgewall.org/wiki/Download">http://genshi.edgewall.org/wiki/Download</a> and put  unziped/untared code to  C:\src4trac\Genshi. Now do the following</p>
<p><code><br />
cd C:\src4trac\trac<br />
easy_install .<br />
cd C:\src4trac\Genshi<br />
easy_install .</code></p>
<p>So that&#8217;s it! We have trac installed! But that&#8217;s only the beginning of the problems <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>But let&#8217;s forget about them for now and let&#8217;s do some checks,  if everething is alright.</p>
<h2>Checking if everething is ok till now</h2>
<p>Create folder C:\TracProjects. Type<br />
<code><br />
trac-admin c:\ TracProjects\TestProj initenv</code><br />
Ansver all questions. Actualy you can always press enter except in the path to the repository question where you should provide path to the subversion repository.<br />
<code><br />
tracd --port 8000 c:\TracProjects\TestProj<br />
</code><br />
Open http://localhost:8000/TestProj.<br />
It&#8217;s alive!!! Alive!!!<br />
If it&#8217;s not &#8211; then you have to reread all above very carefuly.</p>
<h2>Running Trac under IIS 7, fast cgi</h2>
<p>Standalone server is good, but hard to manage. So it&#8217;s much better to use some more powerful server such as IIS. We can run it trac as CGI but it&#8217;s not an option &#8211; too slow. The very reasonable way to make it run under IIS is it&#8217;s new FastCGI module. But <a href="http://trac.edgewall.org/wiki/TracFastCgi" target="_blank">here</a> we can read</p>
<blockquote><p><strong><em>Note for Windows:</em></strong><em> Trac&#8217;s FCGI does not run under Windows, as Windows does not implement </em><tt><em>Socket.fromfd</em></tt><em>, which is used by </em><tt><em>_fcgi.py</em></tt><em>. If you want to connect to IIS, your choice may be </em><a title="TracOnWindowsIisAjp in The Trac Project" href="http://trac.edgewall.org/intertrac/TracOnWindowsIisAjp"><em>AJP</em></a><em>.</em></p></blockquote>
<p>As for me AJP is realy strange thing and not an option &#8211; I want FastCGI.  So if trac&#8217;s fcgi does not support Windows, then we need to find other FCGI module for python. So let&#8217;s download  <a href="http://pypi.python.org/pypi/python-fastcgi">http://pypi.python.org/pypi/python-fastcgi </a>and put code to C:\src4trac\PyFCGI folder. Do you think it&#8217;s all? No. The most interesting part starts right now.</p>
<p>Download The Development Kit from <a href="http://www.fastcgi.com/drupal/node/5">http://www.fastcgi.com/drupal/node/5</a> and put the code to the C:\src4trac\FastCgiKit Open C:\src4trac\FastCgiKit\Win32\FastCgi.dsw. If you get error</p>
<blockquote><p><em>Connot load project due to a corrupt project file.</em></p></blockquote>
<p>on opening projects &#8211; you should open dsp files in the text editor that supports conversion between Unix format and windows format. <a href="http://notepad-plus.sourceforge.net/uk/site.htm">Notepad++</a> is the right thing. So after the conversion solution will open with all projects.</p>
<p>Visual studio will open.  Config_h project will be unavailable &#8211; it&#8217;s ok. Now you should open Main menu -&gt; Build-&gt; Configuration Manager</p>
<p>Set Active solution configuration: Release. Set Active Solution Platform x64. If there is only win32 option &#8211; click on &lt;New&gt; and in Type or select new platform: select x64, Copy settings from Win32.Leave checkbox about creation new platform checked. Cntrl-shift-B. Does not complile. Right.</p>
<p>open C:\src4trac\FastCgiKit\fcgi_config.h and comment following lines :<br />
<code><br />
#define HAVE_NETDB_H 1<br />
#define HAVE_SYS_PARAM_H 1<br />
#define HAVE_SYS_SOCKET_H 1<br />
#define HAVE_SYS_TIME_H 1</code></p>
<p>Now you are finally able to  compile the code <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Compiled? Good. So now you can fynaly install python-fastcgi. But first open C:\src4trac\PyFCGI\setup.py in editor and replace</p>
<p><code><br />
c_ext = Extension("fcgi", ["fastcgi/pyfcgi.c"], libraries=["fcgi"],<br />
include_dirs=["/usr/local/include"],<br />
library_dirs=["/usr/local/lib"],<br />
#extra_link_args=["-s"],<br />
)<br />
</code><br />
with<br />
<code><br />
c_ext = Extension("fcgi", ["fastcgi/pyfcgi.c"], libraries=["libfcgi"],<br />
include_dirs=["C:\src4trac\FastCgiKit\include"],<br />
library_dirs=["C:\src4trac\FastCgiKit\libfcgi\Release"],<br />
#extra_link_args=["-s"],<br />
)<br />
</code><br />
Be carefull about indents on copy/paste.</p>
<p>Now you can<br />
<code><br />
cd C:\src4trac\PyFCGI<br />
easy_install .</code></p>
<p>Copy libfcgi.dll from C:\src4trac\FastCgiKit\libfcgi\Release to C:\Python26\Lib\site-packages\python_fastcgi-1.1-py2.6-win-amd64.egg\fastcgi</p>
<p>For testing if it&#8217;s all right run in command line<br />
<code><br />
python<br />
import fastcgi</code></p>
<p>If it&#8217;s not &#8211; reread and redo.</p>
<h3>Changing code of trac <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </h3>
<p>Create  C:\Python26\Lib\site-packages\trac-0.11.4-py2.6.egg\trac\cgi-bin directory and a file trac.fcgi with the following content:</p>
<p><code> </code></p>
<p><code></p>
<pre>#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (C) 2003-2009 Edgewall Software
# Copyright (C) 2003-2004 Jonas Borgström
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://trac.edgewall.org/wiki/TracLicense.
#
# This software consists of voluntary contributions made by many
# individuals. For the exact contribution history, see the revision
# history and logs, available at http://trac.edgewall.org/log/.
#
# Author: Jonas Borgström 

import os

try:
    os.environ['TRAC_ENV'] = "C:/TracProjects/TestProj"
    from trac.web import fcgi_frontend
    fcgi_frontend.run()
except SystemExit:
    raise
except Exception, e:
    print 'Content-Type: text/plain\r\n\r\n',
    print 'Oops...'
    print
    print 'Trac detected an internal error:'
    print
    print e
    print
    import traceback
    import StringIO
    tb = StringIO.StringIO()
    traceback.print_exc(file=tb)
    print tb.getvalue()</pre>
<p></code><br />
As you can remember C:/TracProjects/TestProj is the place where we&#8217;ve created test environment for trac. Pretty long way <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  I&#8217;m tired of typing alredy <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
There is not  much left to do. Now open C:\tracbackup\trac-0.11.4-py2.6.egg\trac\web\fcgi_frontend.py file and replace it&#8217;s code with following:</p>
<p><code> </code></p>
<p><code></p>
<pre>#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C)2005-2009 Edgewall Software
# Copyright (C) 2005 Matthew Good
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://trac.edgewall.org/wiki/TracLicense.
#
# This software consists of voluntary contributions made by many
# individuals. For the exact contribution history, see the revision
# history and logs, available at http://trac.edgewall.org/log/.
#
# Author: Matthew Good

import pkg_resources

from trac import __version__ as VERSION
from trac.web.main import dispatch_request

import fastcgi

def run():
    s = fastcgi.ThreadedWSGIServer(dispatch_request, workers=1)
    s.serve_forever()

if __name__ == '__main__':
    run()
    pkg_resources.require('Trac==%s' % VERSION)</pre>
<p></code></p>
<p>There is a time for looking if we are on the right way.<br />
Run from command line<br />
<code><br />
python C:\Python26\Lib\site-packages\trac-0.11.4-py2.6.egg\trac\cgi-bin\trac.fcgi<br />
</code><br />
and you should get<br />
unknown listenType (0)<br />
If you do &#8211; then it&#8217;s greate! If you get indent errors -read <a href="http://www.secnetix.de/olli/Python/block_indentation.hawk">http://www.secnetix.de/olli/Python/block_indentation.hawk</a> <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  If some other error &#8211; reread and redo.</p>
<p>One more last thing you need to do. Open C:\tracbackup\trac-0.11.4-py2.6.egg\trac\web\api.py find</p>
<p><code> </code></p>
<p><code></p>
<pre>path_info = property(fget=lambda self: self.environ.get('PATH_INFO', '').decode('utf-8'),
                            doc='Path inside the application')</pre>
<p></code><br />
and replace it with</p>
<p><code> </code></p>
<p><code></p>
<pre>    path_info = property(fget=lambda self: self.environ.get('PATH_INFO','').decode('utf-8').replace(self.environ.get('SCRIPT_NAME', ''), ''),
                     doc='Path inside the application')</pre>
<p></code></p>
<h3>Configure IIS7</h3>
<p>Create application pull, named trac and without managed code. Create appliction named trac in the default web site called trac aimed on C:\Python26\Lib\site-packages\trac-0.11.4-py2.6.egg\trac\htdocs in trac application pool.<br />
Create virtual directory in your trac appliction called cgi-bin pointed on C:\Python26\Lib\site-packages\trac-0.11.4-py2.6.egg\trac\cgi-bin.</p>
<p>In trac application open Handler Mappings, click Add module mapping&#8230;  and  fullfill form with the following values:</p>
<p>Request Path: *trac.fcgi</p>
<p>Module: FastCgiModule</p>
<p>Executable(optional):  c:\Python26\python.exe|C:\Python26\Lib\site-packages\trac-0.11.4-py2.6.egg\trac\cgi-bin\trac.fcgi</p>
<p>Yes it&#8217;s right. With | symbol. Last field is name &#8211; feel free in naming it as you want <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Open your browser. Deep breath.</p>
<p>http://localhost/trac/cgi-bin/trac.fcgi</p>
<p>If it works &#8211; you are lucky. If not &#8211; set rights on folder c:\Python26 for</p>
<p>NETWORK SERVICES<br />
IUSR_MACHINENAME</p>
<p>There is one more posible bug. Open C:\Python26\Lib\site-packages. There is folders wich ends on .egg. If there is files wich ends with .egg &#8211; it&#8217;s zip archive. Unzip it to the folder with exactly same name wich have file in the same folder. For example if you have</p>
<p>C:\Python26\Lib\site-packages\genshi-0.5.1-py2.6-win-amd64.egg file &#8211; you should inzip it&#8217;c content to the C:\Python26\Lib\site-packages\genshi-0.5.1-py2.6-win-amd64.egg folder. This bug is about PYTHON_EGG_CACHE environment variable. Google it if you want:)</p>
<p>So now &#8211; it should work. Trac on IIS 7 on fast cgi! Wow! We are greate. Is it the end of our journey? No.</p>
<h3>Security</h3>
<p>To be completely heappy &#8211; we need to be able to login. First of all turn on Basic Authentification for trac application in Autherization in IIS management console.<br />
After that open C:\Python26\Lib\site-packages\trac-0.11.4-py2.6.egg\trac\htdocs\web.config file and add</p>
<p>&lt;location path=&#8221;cgi-bin/trac.fcgi/login&#8221;&gt;<br />
&lt;system.webServer&gt;<br />
&lt;security&gt;<br />
&lt;authorization&gt;<br />
&lt;add accessType=&#8221;Deny&#8221; users=&#8221;?&#8221; /&gt;<br />
&lt;/authorization&gt;<br />
&lt;/security&gt;<br />
&lt;/system.webServer&gt;<br />
&lt;/location&gt;</p>
<p>as a first level child of &lt;configuration&gt; tag. Actualy you can configure security in any way you like, per user or per role.</p>
<h2>Trac and Subversion</h2>
<p>Trac and subversion are made for each other <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />   You can read <a href="http://trac.edgewall.org/wiki/TracSubversion">http://trac.edgewall.org/wiki/TracSubversion</a> about it. This article is for unix. As a Windows user we will do everething in our way <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> .<br />
Actualy when you need to connect to the subversion repository from trac &#8211; you need python bindings of subversion&#8217;s dll&#8217;s so Trac could do all subversion can. Happyly subversion project include everething you need for such bindings.</p>
<blockquote><p>Note. When you compile subversion python bindings &#8211; you will get subversion + subversion python bindings. Someone can deside to use this compiled subversion binaries not onle for bindings, but for the subversion itself too. I recomend not to do so and do the following &#8211; compile subversion bindings for python and use them for trac. But for the subversion functionality itself get subversion binaries from http://subversion.tigris.org/getting.html#windows and instal subversion, create repository and checkin something there and live heapyly. Why? Becouse if you compile them for truck only &#8211; you don&#8217;t need ssl libraries, berkley db libraries and so on, becouse truck will not use them anyway. You can use minimal number of subversion satellite projects &#8211; so the less code you&#8217;ll need to compile &#8211; the less problems you&#8217;ll get <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p></blockquote>
<p>If you already have subversion 1.x.y. installed then you need to create bindings of 1.x.y. We will make 64bit bindings. Don&#8217;t worry &#8211; it does not matters how many bits have your installed subversion.  If you don&#8217;t have subversion yet &#8211; download the version you like and install it.  Create repository. If you don&#8217;t cnow how &#8211; read http://svnbook.red-bean.com/en/1.1/ch01s05.html (till the end;))</p>
<p>I have had subversion version 1.5.2 so I had to make my bindings for this version. So let&#8217;s do so. First create folder C:\src4trac\svnTheGreate &#8211; to show our respect for subversion <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> . Checkout http://svn.collab.net/repos/svn/tags/1.5.2 Planty of files.<br />
So while you are reading C:\src4trac\svnTheGreate\subversion\bindings\swig\INSTALL &#8211; I&#8217;ll go get some cofee. It will take you some time <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
So welcome back. As you&#8217;ve read, you need http://www.swig.org/. Download http://prdownloads.sourceforge.net/swig/swigwin-1.3.39.zip for example and unzip it to C:\src4trac\swig folder. After that download APR from http://apr.apache.org/download.cgi and unzip it to the C:\src4trac\svnTheGreate\apr folder. Download latest APR -util and put it to the C:\src4trac\svnTheGreate\apr-util folder. So let&#8217;s compile them. In 64 bit. Let-s start from apr.<br />
It&#8217;s simple. Release. x64. Build.<br />
Now open  C:\src4trac\svnTheGreate\apr-util\aprutil.dsw. There will be 4 projects that contains iconv in name. They will be unawalable. Never mind. Open C:\src4trac\svnTheGreate\apr-util\include\apu.hw file and set #define APU_HAVE_APR_ICONV      0 instead of 1.<br />
So Release, x64. Build.<br />
Dont worry about _bdb_ projects &#8211; you just don&#8217;t need them. 6 project&#8217;s will fail. Not more.<br />
Now you should do the folowing.</p>
<p>Copy folders Release and LibR from C:\src4trac\svnTheGreate\apr-util\x64 to C:\src4trac\svnTheGreate\apr-util\<br />
Copy folders Release and LibR from C:\src4trac\svnTheGreate\apr-util\x64 to C:\src4trac\svnTheGreate\apr-util\<br />
Copy folder LibR from C:\src4trac\svnTheGreate\apr-util\xml\expat\lib\x64 to C:\src4trac\svnTheGreate\apr-util\xml\expat\lib\</p>
<p>Download Zlib.  http://www.zlib.net &#8211; and unzip it to the  C:\src4trac\svnTheGreate\zlib folder. We do not need to compile it. It will be compiled later with bindings.<br />
Download Neon http://www.webdav.org/neon/ and unzip it to C:\src4trac\svnTheGreate\Neon</p>
<p>Open comand line type</p>
<p><code><br />
cd C:\src4trac\svnTheGreate<br />
gen-make.py -t vcproj --with-swig="C:\src4trac\swig" --vsnet-version=2008<br />
</code></p>
<p>and look how does magic happens.</p>
<p>Open C:\src4trac\svnTheGreate\subversion_vcnet.sln and compile it. Release! 64bit!</p>
<p>All java perl and ruby projects will fail &#8211; do not worry, we don&#8217;t need them. But if libsvn_fs fails &#8211; this is fatal.<br />
If it&#8217;s not compile &#8211; reread. You must be mised something. Is apr and apr-util compiled in 64 bits? Have you moved folders from x64 and so on.</p>
<p>Now create c:\src4trac\BindingsInstaller.bat</p>
<p><code> </code></p>
<p><code>@echo off<br />
SETLOCAL<br />
::Standard commission<br />
SET _svn=C:\src4trac\svnTheGreate\<br />
SET _psb=C:\Python26\Lib\site-packages\</p>
<p>rmdir /q %_psb%svn<br />
rmdir /q %_psb%libsvn</p>
<p>md %_psb%svn<br />
md %_psb%libsvn</p>
<p>xcopy %_svn%subversion\bindings\swig\python\svn\*.py %_psb%svn<br />
xcopy %_svn%subversion\bindings\swig\python\*.py %_psb%libsvn<br />
xcopy %_svn%Release\subversion\bindings\swig\python\*.dll %_psb%libsvn</p>
<p>cd %_psb%libsvn</p>
<p>ren _client.dll _client.pyd<br />
ren _core.dll _core.pyd<br />
ren _delta.dll _delta.pyd<br />
ren _diff.dll _diff.pyd<br />
ren _fs.dll _fs.pyd<br />
ren _ra.dll _ra.pyd<br />
ren _repos.dll _repos.pyd<br />
ren _wc.dll _wc.pyd</p>
<p></code></p>
<p><code>xcopy %_svn%Release\subversion\libsvn_client\*.dll %_psb%libsvn<br />
xcopy %_svn%Release\subversion\libsvn_delta\*.dll %_psb%libsvn<br />
xcopy %_svn%Release\subversion\libsvn_diff\*.dll %_psb%libsvn<br />
xcopy %_svn%Release\subversion\libsvn_fs\*.dll %_psb%libsvn<br />
xcopy %_svn%Release\subversion\libsvn_fs_fs\*.dll %_psb%libsvn<br />
xcopy %_svn%Release\subversion\libsvn_fs_util\*.dll %_psb%libsvn<br />
xcopy %_svn%Release\subversion\libsvn_ra\*.dll %_psb%libsvn<br />
xcopy %_svn%Release\subversion\libsvn_ra_local\*.dll %_psb%libsvn<br />
xcopy %_svn%Release\subversion\libsvn_ra_neon\*.dll %_psb%libsvn<br />
xcopy %_svn%Release\subversion\libsvn_ra_svn\*.dll %_psb%libsvn<br />
xcopy %_svn%Release\subversion\libsvn_repos\*.dll %_psb%libsvn<br />
xcopy %_svn%Release\subversion\libsvn_subr\*.dll %_psb%libsvn<br />
xcopy %_svn%Release\subversion\libsvn_wc\*.dll %_psb%libsvn<br />
xcopy %_svn%\Release\subversion\bindings\swig\python\libsvn_swig_py\*dll %_psb%libsvn<br />
xcopy %_svn%apr\Release\*.dll %_psb%libsvn<br />
xcopy %_svn%apr-util\Release\*.dll %_psb%libsvn<br />
</code></p>
<p>Run it. Two folders should appear in C:\Python26\Lib\site-packages. They are svn and libsvn with following content</p>
<p>svn\<br />
client.py<br />
core.py<br />
core.pyc<br />
delta.py<br />
diff.py<br />
fs.py<br />
ra.py<br />
repos.py<br />
wc.py<br />
__init__.py<br />
__init__.pyc</p>
<p>libsvn\<br />
client.py<br />
core.py<br />
core.pyc<br />
delta.py<br />
diff.py<br />
fs.py<br />
libapr-1.dll<br />
libaprutil-1.dll<br />
libsvn_client-1.dll<br />
libsvn_delta-1.dll<br />
libsvn_diff-1.dll<br />
libsvn_fs-1.dll<br />
libsvn_ra-1.dll<br />
libsvn_repos-1.dll<br />
libsvn_subr-1.dll<br />
libsvn_swig_py-1.dll<br />
libsvn_wc-1.dll<br />
ra.py<br />
repos.py<br />
wc.py<br />
_client.pyd<br />
_core.pyd<br />
_delta.pyd<br />
_diff.pyd<br />
_fs.pyd<br />
_ra.pyd<br />
_repos.pyd<br />
_wc.pyd<br />
__init__.py<br />
__init__.pyc</p>
<p>svn should start working now</p>
<h2>The End</h2>
<p>I&#8217;ve spent 2 weeks to find the ways. Nothing worked from the first time, and there were no any infomation via google. So I&#8217;ve decided to write my experience down in a very detailed way. I know, that it just can&#8217;t be too detailed. This article is valuable for the following reasons: Trac on IIS 7 fast cgi &#8211; no information in internet at all. Second reason is detailed instructions on subversion python bindings 64 bits. It has it&#8217;s tricks like x64 directories.  Thank you for spending your time on reading this tutorial. Hope it was usefull. Comment please <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/er2v.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/er2v.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/er2v.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/er2v.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/er2v.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/er2v.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/er2v.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/er2v.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/er2v.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/er2v.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/er2v.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/er2v.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/er2v.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/er2v.wordpress.com/4/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=er2v.wordpress.com&amp;blog=7353710&amp;post=4&amp;subd=er2v&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://er2v.wordpress.com/2009/04/15/install_trac_on_64_bit_windows_and_run_it_under_iis7_fast_cgi/feed/</wfw:commentRss>
		<slash:comments>20</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/85f8230bca7e598f925d0819eba8aaf4?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">er2v</media:title>
		</media:content>
	</item>
	</channel>
</rss>
