public static IProjectMappingManager CreateManager(IServiceProvider serviceProvider, string fileName) { string filePath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, fileName); Assert.IsTrue(File.Exists(filePath), "Mapping file not found: " + filePath); // create a temp copy to avoid locks fileName = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, Path.ChangeExtension(Path.GetRandomFileName(), Path.GetExtension(fileName))); // Force mapping file to reload from disk since there is a singleton reference. File.Copy(filePath, fileName); IProjectMappingManager manager = new ProjectMappingManager(serviceProvider); manager.SetMappingFile(fileName); return manager; }
public static IProjectMappingManager CreateManager(IServiceProvider serviceProvider, string fileName) { string filePath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, fileName); Assert.IsTrue(File.Exists(filePath), "Mapping file not found: " + filePath); // create a temp copy to avoid locks fileName = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, Path.ChangeExtension(Path.GetRandomFileName(), Path.GetExtension(fileName))); // Force mapping file to reload from disk since there is a singleton reference. File.Copy(filePath, fileName); IProjectMappingManager manager = new ProjectMappingManager(serviceProvider); manager.SetMappingFile(fileName); return(manager); }