well after a few days with CookieSwap it seems a bit buggy, basically if you open two browser instances and then switch the CookieSwap profile it is updating both browser instances making it somewhat useless?
so I did some more googling and now using this technique
Initial Setup
- close all instances of firefox
- Start -> Run -> firefox.exe -ProfileManager
- create 5 or so profiles, I named them p1 - p5
Then when you want to use different profiles launch each one from the command line
- Start -> Run -> firefox.exe -P p1 -no-remote
each profile is totally distinct (history, cookies, etc...), only issue there does not seem to be an easy way to tell which profile you currently have open, I think I can live with that
The blog has moved to http://jessehouse.com/ ... Many google searches point here so I am leaving it operational, but there will be no new posts.
Thursday, April 24, 2008
Sunday, April 20, 2008
NAnt build with TFS changeset as revision number
This code sample is a nant script that
basically I just put together a few bits that I found on other blogs (should have saved the urls - doh!), most were related to using svn for source control and then I added in the code block for the c# stuff to query TFS.
A quick note about the linked CommonAssembly.cs file, visual studio has an option when you are adding an existing file to a project to select 'linked', click the arrow on the 'Add' button when you select your existing file
what this script does not do - get latest from TFS, I usually do that part manually or from ccnet
the c# bit that goes in the nant script block above
NOTE: see updated version of this code block
nant is awesome!
- deletes the CommonAssembly.cs file (linked to all projects)
- uses the nant asminfo task to recreate the CommonAssembly.cs file, but after we query TFS for the changeset (revision) number which is used in the version number
- build the solution in release mode using the ide.exe (there are other - better ways, but this one works)
- xcopy files to C:\temp\{app} and clean up all the source files
basically I just put together a few bits that I found on other blogs (should have saved the urls - doh!), most were related to using svn for source control and then I added in the code block for the c# stuff to query TFS.
A quick note about the linked CommonAssembly.cs file, visual studio has an option when you are adding an existing file to a project to select 'linked', click the arrow on the 'Add' button when you select your existing file
what this script does not do - get latest from TFS, I usually do that part manually or from ccnet
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<project name="YourApp" default="do-build" xmlns="http://nant.sf.net/release/0.85-rc4/nant.xsd"> | |
<!-- Version settings --> | |
<property name="project.config" value="release" /> | |
<property name="project.version.major" value="1" /> | |
<property name="project.version.minor" value="0" /> | |
<property name="project.version.build" value="0" /> | |
<property name="tfs.server" value="http://yourTFSserver:8080/" /> | |
<property name="tfs.fullpath" value="$/yourTeamProject/someDirectory/andSoOn/" /> | |
<property name="company" value="${project::get-name()}"/> | |
<property name="project" value="${project::get-name()}"/> | |
<property name="copyright" value="${company}, ${datetime::get-year(datetime::now())}"/> | |
<property name="temp-target-dir" value="C:\temp\yourApplication"/> | |
<!-- the public target --> | |
<target name="do-build" depends="version, compile-release, copy-to-temp-dir"/> | |
<target name="compile-release"> | |
<!-- delete the previous log files --> | |
<delete file="clean_log.txt" failonerror="false"></delete> | |
<delete file="compile_log.txt" failonerror="false"></delete> | |
<!-- clean --> | |
<echo message="Clean bins" /> | |
<exec program="c:\program files\microsoft visual studio 9.0\common7\ide\devenv.exe" workingdir="."> | |
<arg file="YourSolutionFileNameHere.sln" /> | |
<arg value="/out" /> | |
<arg value="clean_log.txt" /> | |
<arg value="/clean" /> | |
<arg value="${project.config}" /> | |
</exec> | |
<!-- build --> | |
<echo message="Build for ${project.config}" /> | |
<exec program="c:\program files\microsoft visual studio 9.0\common7\ide\devenv.exe" workingdir="."> | |
<arg file="YourSolutionFileNameHere.sln" /> | |
<arg value="/out" /> | |
<arg value="compile_log.txt" /> | |
<arg value="/rebuild" /> | |
<arg value="${project.config}" /> | |
</exec> | |
</target> | |
<target name="version"> | |
<property name="project.version.revision" value="0"/> | |
<!-- this block get the changesetid for this 'solution' and sets project.version.revision --> | |
<script language="C#"> | |
<references> | |
<include name="C:\someDirectoryWhereYouHaveThisDll\Microsoft.TeamFoundation.Client.dll" /> | |
<include name="C:\someDirectoryWhereYouHaveThisDll\TeamFoundation\Microsoft.TeamFoundation.VersionControl.Client.dll" /> | |
</references> | |
<imports> | |
<import namespace="Microsoft.TeamFoundation.Client" /> | |
<import namespace="Microsoft.TeamFoundation.VersionControl.Client" /> | |
</imports> | |
<code> | |
<![CDATA[ | |
public static void ScriptMain(Project project) | |
{ | |
// see c# code sample in next section... | |
} | |
]]> | |
</code> | |
</script> | |
<property name="project.version.full" value="${project.version.major}.${project.version.minor}.${project.version.build}.${project.version.revision}"/> | |
<echo message="MARKING THIS BUILD AS VERSION ${project.version.full}" /> | |
<delete file="CommonAssemblyInfo.cs" failonerror="false"/> | |
<asminfo output="CommonAssemblyInfo.cs" language="CSharp"> | |
<imports> | |
<import namespace="System" /> | |
<import namespace="System.Reflection" /> | |
<import namespace="System.Runtime.InteropServices" /> | |
</imports> | |
<attributes> | |
<attribute type="ComVisibleAttribute" value="false" /> | |
<attribute type="AssemblyVersionAttribute" value="${project.version.full}" /> | |
<attribute type="AssemblyFileVersionAttribute" value="${project.version.full}" /> | |
<attribute type="AssemblyCopyrightAttribute" value="${copyright}" /> | |
<attribute type="AssemblyProductAttribute" value="${project}" /> | |
<attribute type="AssemblyCompanyAttribute" value="${company}" /> | |
<attribute type="AssemblyConfigurationAttribute" value="${project.config}" /> | |
<attribute type="AssemblyInformationalVersionAttribute" value="${project.version.full}" /> | |
</attributes> | |
<references> | |
<include name="System.dll" /> | |
</references> | |
</asminfo> | |
</target> | |
<target name="copy-to-temp-dir"> | |
<mkdir dir="${temp-target-dir}" /> | |
<exec program="xcopy" verbose="true"> | |
<arg value=".\YourWebProjectDirectory" /> | |
<arg value="${temp-target-dir}" /> | |
<arg line="/e /r /y /q" /> | |
</exec> | |
<delete> | |
<!-- probably a better way to do this? --> | |
<fileset basedir="${temp-target-dir}"> | |
<include name="*.cs" /> | |
<include name="*/*.cs" /> | |
<include name="*.csproj*" /> | |
<include name="*/*.otherfiletypes" /> | |
</fileset> | |
</delete> | |
<!-- fix up the web.config --> | |
<echo message="update the configuration ${temp-target-dir}\web.config" /> | |
<xmlpoke | |
file="${temp-target-dir}\web.config" | |
xpath="/ns:configuration/ns:system.web/ns:customErrors/@mode" | |
value="On" | |
> | |
<namespaces> | |
<namespace prefix="ns" uri="http://schemas.microsoft.com/.NetConfiguration/v2.0" /> | |
</namespaces> | |
</xmlpoke> | |
</target> | |
</project> |
the c# bit that goes in the nant script block above
NOTE: see updated version of this code block
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static void ScriptMain(Project project) | |
{ | |
project.Log(Level.Info, "Connect to " + project.Properties["tfs.server"]); | |
TeamFoundationServer tfs = new TeamFoundationServer(project.Properties["tfs.server"]); | |
// Get a reference to Version Control. | |
Type type = typeof(VersionControlServer); | |
VersionControlServer versionControl = (VersionControlServer)tfs.GetService(type); | |
project.Log(Level.Info, "get changesetId for " + project.Properties["tfs.fullpath"]); | |
IEnumerable changeSets = versionControl.QueryHistory(project.Properties["tfs.fullpath"], VersionSpec.Latest, 0, RecursionType.Full, null, null, null, 1, true, false); | |
int latestChangesetId = 0; | |
// there is only one | |
foreach(Changeset c in changeSets) | |
{ | |
latestChangesetId = c.ChangesetId; | |
} | |
project.Log(Level.Info, "ChangesetId is " + latestChangesetId.ToString()); | |
project.Properties["project.version.revision"] = latestChangesetId.ToString(); | |
} |
nant is awesome!
FireFox and multiple cookies for the same site
I like FireFox but still use IE most of the time; one of the main reasons is during web application development I need to login to the same web application as different users at the same time, switching back and forth between each user account. IE makes it easy just open a new instance for each individual user account.
In the past I tried to find a solution for FireFox, but always came up short. Well today I did a google search and came up with two different ones!
both are FireFox extensions
In the past I tried to find a solution for FireFox, but always came up short. Well today I did a google search and came up with two different ones!
both are FireFox extensions
after a quik spin with both I am liking CookieSwap better
With CookiePie you right click on the individual tab to toggle seperate cookie sessions on or off; just didn't have good luck using it the way I would do stuff with IE
With CookieSwap you right click in the lower right hand status bar area of FireFox and can toggle between named profiles (default is Profile1, Profile2, Profile3) - this worked right out of the box as I would expect!
Subscribe to:
Posts (Atom)