Solution Clone v1.1
A quick update to Solution Clone was posted today to handle some new file types created in the BizTalk Deployment Framework v5.0. You can find it here.
Posted in Projects | No Comments
A quick update to Solution Clone was posted today to handle some new file types created in the BizTalk Deployment Framework v5.0. You can find it here.
Posted in Projects | No Comments
public class TestFile : IDisposable
{
private bool _disposedValue = false;
private string _resourceName;
private string _fileName;
public TestFile(string resourceName) : this(null, resourceName) { }
public TestFile(string fileName, string resourceName)
{
if (fileName == null)
{
this.FileName = Path.GetTempFileName();
File.Delete(this.FileName);
}
else
this.FileName = fileName;
using (Stream s = LoadResourceFromAppDomain(resourceName))
using (StreamReader sr = new StreamReader(s))
using (StreamWriter sw = File.CreateText(this.FileName))
{
sw.Write(sr.ReadToEnd());
sw.Flush();
}
}
private Stream LoadResourceFromAppDomain(string resourceName)
{
Assembly[] appDomainAssemblies = AppDomain.CurrentDomain.GetAssemblies();
Stream outStream = null;
foreach (var lAssem in appDomainAssemblies)
{
outStream = lAssem.GetManifestResourceStream(resourceName);
if (outStream != null) return outStream;
}
throw new Exception(string.Format("Unable to find resource stream {0}",resourceName));
}
public string FileName
{
get { return _fileName; }
set
{
_fileName = value;
}
}
protected virtual void Dispose(bool disposing)
{
if (!this._disposedValue)
{
if (disposing)
{
if (File.Exists(_fileName))
{
File.Delete(_fileName);
}
}
}
this._disposedValue = true;
}
#region IDisposable Members
public void Dispose()
{
// Do not change this code.Put cleanup code in Dispose(bool disposing) above.
Dispose(true);
GC.SuppressFinalize(this);
}
#endregion
}
Posted in Projects | No Comments
I’ve had a little utility I’ve used on my consulting gigs from time to time that I wrote a while back, and I’ve finally decided it needed a home of its own. As you can read below, it allows me to keep fairly complex pre-built project structures, and then duplicate them with a click of a button, renaming them to whatever I need. You can download the latest release, or you can check out the project on CodePlex.
Project Description
A utility to allow you to clone an existing solution, renaming it as you do so, and updating references inside the various files.
Do you have a favorite project structure you setup every single time you start a new project? I surely did, and I got tired of having to re-create that structure every time. Especially since my structure was a complex many levels deep set of build files and other support files and projects I used when implementing the BizTalk Deployment Framework.
Tired of that work, because I'm a lazy programmer, I created this project that would duplicate an existing solution directory. I setup an archive project called SolutionNameHere, which contained projects like SolutionNameHere.Orchestrations, and then let this program translate every reference to "SolutionNameHere" in either a path or a filename (or even some file contents) to whatever new name I wanted.
At the current time, Solution Clone is aware of the following types of files within your projects that it does more than simply rename and move. These files will be modified to update any references to the old solution name as they are moved. These file types currently include:
This list will almost certainly be updated in future versions to include other types of files.
Posted in Projects | 3 Comments