Permalink
Browse files

Fixes wrong unregistration of events in COM add-in and update binarie…

…s to a more stable version
  • Loading branch information...
1 parent daa6bab commit 0486a793f6564abbb15e523575abc946e3f282bd @serialseb serialseb committed Sep 14, 2011
Showing with 37 additions and 59 deletions.
  1. 0 demo/src/OpenWrap.Demo/OpenWrap.Demo_mm_cache.bin
  2. +2 −1 src/OpenWrap.Commands/Wrap/BuildWrapCommand.cs
  3. +3 −6 src/OpenWrap.VisualStudio.SolutionAddIn/OpenWrapVisualStudioAddIn.cs
  4. +9 −25 src/OpenWrap/Commands/Cli/ShellRunner.cs
  5. +1 −7 src/OpenWrap/Repositories/DirectoryExtensions.cs
  6. +17 −16 src/OpenWrap/Runtime/CurrentDirectoryEnvironment.cs
  7. +1 −0 src/OpenWrap/Services/ServiceRegistry.cs
  8. BIN wraps/openwrap/bin-net35/OpenWrap.VisualStudio.Shared.dll
  9. BIN wraps/openwrap/bin-net35/OpenWrap.VisualStudio.Shared.pdb
  10. BIN wraps/openwrap/bin-net35/OpenWrap.VisualStudio.SolutionAddIn.dll
  11. BIN wraps/openwrap/bin-net35/OpenWrap.VisualStudio.SolutionAddIn.pdb
  12. BIN wraps/openwrap/bin-net35/OpenWrap.dll
  13. BIN wraps/openwrap/bin-net35/OpenWrap.pdb
  14. BIN wraps/openwrap/build/OpenWrap.Build.Bootstrap.dll
  15. BIN wraps/openwrap/build/OpenWrap.Build.Bootstrap.pdb
  16. BIN wraps/openwrap/build/OpenWrap.Build.Tasks.dll
  17. BIN wraps/openwrap/build/OpenWrap.Build.Tasks.pdb
  18. BIN wraps/openwrap/commands/OpenWrap.Commands.dll
  19. BIN wraps/openwrap/commands/OpenWrap.Commands.pdb
  20. +3 −3 wraps/openwrap/openwrap.wrapdesc
  21. BIN wraps/openwrap/solution/OpenWrap.Resharper.450.dll
  22. BIN wraps/openwrap/solution/OpenWrap.Resharper.450.pdb
  23. BIN wraps/openwrap/solution/OpenWrap.Resharper.500.dll
  24. BIN wraps/openwrap/solution/OpenWrap.Resharper.500.pdb
  25. BIN wraps/openwrap/solution/OpenWrap.Resharper.510.dll
  26. BIN wraps/openwrap/solution/OpenWrap.Resharper.510.pdb
  27. BIN wraps/openwrap/solution/OpenWrap.Resharper.600.dll
  28. BIN wraps/openwrap/solution/OpenWrap.Resharper.600.pdb
  29. BIN wraps/openwrap/solution/OpenWrap.SolutionPlugins.VisualStudio.dll
  30. BIN wraps/openwrap/solution/OpenWrap.SolutionPlugins.VisualStudio.pdb
  31. +1 −1 wraps/openwrap/version
@@ -104,7 +104,8 @@ IEnumerable<ICommandOutput> Build()
var packageFilePath = destinationPath.GetFile(
PackageNameUtility.PackageFileName(packageName, generatedVersion.ToString()));
- var packageContent = GeneratePackageContent(_buildResults).Concat(
+ var packageContent = GeneratePackageContent(_buildResults)
+ .Concat(
GenerateVersionFile(generatedVersion),
GenerateDescriptorFile(packageDescriptorForEmbedding)
).ToList();
@@ -95,13 +95,10 @@ public void OnStartupComplete(ref Array custom)
{
}
- static ResolveEventHandler HandleSelfLoad()
+ static Assembly HandleSelfLoad(object src, ResolveEventArgs ev)
{
- return (src, ev) =>
- {
var currentAssembly = typeof(AddInAppDomainManager).Assembly;
return (new AssemblyName(ev.Name).Name == currentAssembly.GetName().Name) ? currentAssembly : null;
- };
}
string GetRootLocation(string fullName)
@@ -137,9 +134,9 @@ void LoadAppDomain()
// replace that with the location in the codebase we just registered, ensuring the correct version is loaded
var location = Type.GetTypeFromProgID(_progId).Assembly.Location;
- AppDomain.CurrentDomain.AssemblyResolve += HandleSelfLoad();
+ AppDomain.CurrentDomain.AssemblyResolve += HandleSelfLoad;
_appDomainManager = (IDisposable)_appDomain.CreateInstanceFromAndUnwrap(location, typeof(AddInAppDomainManager).FullName);
- AppDomain.CurrentDomain.AssemblyResolve -= HandleSelfLoad();
+ AppDomain.CurrentDomain.AssemblyResolve -= HandleSelfLoad;
_appDomain.DomainUnload += HandleAppDomainChange;
}
catch (Exception e)
@@ -1,26 +1,10 @@
using System;
using System.Collections.Generic;
-using System.Diagnostics.CodeAnalysis;
-using System.Linq;
-using Mono.Cecil;
using OpenFileSystem.IO;
using OpenFileSystem.IO.FileSystems.Local;
-using OpenRasta.Client;
using OpenWrap.Commands.Cli.Locators;
-using OpenWrap.PackageManagement;
-using OpenWrap.PackageManagement.AssemblyResolvers;
-using OpenWrap.PackageManagement.DependencyResolvers;
-using OpenWrap.PackageManagement.Deployers;
-using OpenWrap.PackageManagement.Exporters;
-using OpenWrap.PackageManagement.Exporters.Assemblies;
-using OpenWrap.PackageManagement.Exporters.Commands;
-using OpenWrap.Repositories;
-using OpenWrap.Repositories.FileSystem;
-using OpenWrap.Repositories.Http;
-using OpenWrap.Repositories.NuFeed;
using OpenWrap.Runtime;
using OpenWrap.Services;
-using OpenWrap.Tasks;
namespace OpenWrap.Commands.Cli
{
@@ -39,20 +23,20 @@ public static int Main(string[] args)
public static int Main(IDictionary<string, object> env)
{
var serviceRegistry = new ServiceRegistry().Override<IEnvironment>(() =>
- {
- var cdenv = new CurrentDirectoryEnvironment(LocalFileSystem.Instance.GetDirectory(env.CurrentDirectory()));
- if (env.SysPath() != null)
- cdenv.SystemRepositoryDirectory = LocalFileSystem.Instance.GetDirectory(new Path(env.SysPath()).Combine("wraps"));
- return cdenv;
- });
+ {
+ var cdenv = new CurrentDirectoryEnvironment(LocalFileSystem.Instance.GetDirectory(env.CurrentDirectory()));
+ if (env.SysPath() != null)
+ cdenv.SystemRepositoryDirectory = LocalFileSystem.Instance.GetDirectory(new Path(env.SysPath()).Combine("wraps"));
+ return cdenv;
+ });
var formatterType = env.Formatter();
- if(formatterType != null)
+ if (formatterType != null)
{
- serviceRegistry.Override<ICommandOutputFormatter>(() => (ICommandOutputFormatter)Activator.CreateInstance(Type.GetType(formatterType)));
+ serviceRegistry.Override(() => (ICommandOutputFormatter)Activator.CreateInstance(Type.GetType(formatterType)));
}
serviceRegistry.Initialize();
- return new ConsoleCommandExecutor(ServiceLocator.GetService<IEnumerable<ICommandLocator>>(), ServiceLocator.GetService<IEventHub>(),ServiceLocator.GetService<ICommandOutputFormatter>())
+ return new ConsoleCommandExecutor(ServiceLocator.GetService<IEnumerable<ICommandLocator>>(), ServiceLocator.GetService<IEventHub>(), ServiceLocator.GetService<ICommandOutputFormatter>())
.Execute(env.CommandLine(), env.ShellArgs());
}
#pragma warning restore 28
@@ -7,13 +7,7 @@ public static class DirectoryExtensions
{
public static IDirectory FindProjectRepositoryDirectory(this IDirectory root)
{
- // TODO: Review if we should not *only* take the wraps folder where the .wrapdesc is
- return root == null
- ? null
- : root.AncestorsAndSelf()
- .SelectMany(x => x.Directories("wraps"))
- .Where(x => x != null)
- .FirstOrDefault();
+ return root == null ? null : root.GetDirectory("wraps");
}
}
}
@@ -50,16 +50,20 @@ public IPackageRepository ProjectRepository
{
get
{
- TryInitializeProject(); return _projectRepository;
+ if (_projectRepository == null)
+ TryInitializeProject();
+
+ return _projectRepository;
}
+ set { _projectRepository = value; }
}
-
+
public IPackageRepository SystemRepository { get; private set; }
public IDirectory SystemRepositoryDirectory { get; set; }
public void Initialize()
{
-
+
FileSystem = LocalFileSystem.Instance;
SystemRepositoryDirectory = SystemRepositoryDirectory ?? FileSystem.GetDirectory(DefaultInstallationPaths.SystemRepositoryDirectory);
@@ -69,16 +73,16 @@ public void Initialize()
SystemRepository = new FolderRepository(SystemRepositoryDirectory)
{
- Name = "System repository"
+ Name = "System repository"
};
ConfigurationDirectory = FileSystem.GetDirectory(DefaultInstallationPaths.ConfigurationDirectory);
ExecutionEnvironment = new ExecutionEnvironment
{
- Platform = IntPtr.Size == 4 ? "x86" : "x64",
- Profile = Environment.Version.Major >= 4 ? "net40" : "net35"
+ Platform = IntPtr.Size == 4 ? "x86" : "x64",
+ Profile = Environment.Version.Major >= 4 ? "net40" : "net35"
};
}
@@ -96,19 +100,16 @@ void TryInitializeProjectRepository()
{
if (Descriptor.UseProjectRepository)
{
- var projectRepositoryDirectory = DescriptorFile.Parent.FindProjectRepositoryDirectory();
+ var projectRepositoryDirectory = DescriptorFile.Parent.FindProjectRepositoryDirectory().MustExist();
- if (projectRepositoryDirectory != null)
+ var repositoryOptions = FolderRepositoryOptions.AnchoringEnabled;
+ if (Descriptor.UseSymLinks)
+ repositoryOptions |= FolderRepositoryOptions.UseSymLinks;
+ _projectRepository = new FolderRepository(projectRepositoryDirectory, repositoryOptions)
{
- var repositoryOptions = FolderRepositoryOptions.AnchoringEnabled;
- if (Descriptor.UseSymLinks)
- repositoryOptions |= FolderRepositoryOptions.UseSymLinks;
- _projectRepository = new FolderRepository(projectRepositoryDirectory, repositoryOptions)
- {
- Name = "Project repository"
- };
- }
+ Name = "Project repository"
+ };
}
}
}
@@ -93,6 +93,7 @@ public ServiceRegistry()
Get<IPackageManager>().CommandExports(Get<IEnvironment>())
.SelectMany(x => x)
.Select(x => x.Descriptor)));
+
Register(() => new RuntimeAssemblyResolver());
Register<IPackageDescriptorMonitor>(() => new PackageDescriptorMonitor());
Register<ICommandOutputFormatter>(() => new ConsoleCommandOutputFormatter());
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,12 +1,12 @@
-depends: sharpziplib
+depends: sharpziplib = 0.86
depends: openfilesystem
depends: openwrap content
anchored: true
build: msbuild; profile=net35; project=src\OpenWrap\OpenWrap.csproj; project=src\OpenWrap.VisualStudio.Shared\OpenWrap.VisualStudio.Shared.csproj; project=src\OpenWrap.Build.Tasks\OpenWrap.Build.Tasks.csproj; project=src\OpenWrap.Commands\OpenWrap.Commands.csproj; project=src\OpenWrap.VisualStudio.SolutionPlugins\OpenWrap.SolutionPlugins.VisualStudio.csproj
name: openwrap
depends: tdnet-framework
use-symlinks: true
-depends: Mono.Cecil
+depends: Mono.Cecil = 0.9.4
directory-structure: src\*{scope: Tests=tests}*\**
directory-structure: src\{scope: Tests.VisualStudio=tests}\**
-version: 2.0.0.81011175
+version: 2.0.0.81138879
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
View
@@ -1 +1 @@
-2.0.0.81011175
+2.0.0.81138879

0 comments on commit 0486a79

Please sign in to comment.