hmemcpy / agentmulder Goto Github PK
View Code? Open in Web Editor NEW** THIS PLUGIN IS NO LONGER MAINTAINED. PLEASE FOLLOW ERNICOMMUNITY FOR UPDATES **
Home Page: https://github.com/ERNICommunity/AgentMulder
License: MIT License
** THIS PLUGIN IS NO LONGER MAINTAINED. PLEASE FOLLOW ERNICOMMUNITY FOR UPDATES **
Home Page: https://github.com/ERNICommunity/AgentMulder
License: MIT License
For example:
AllTypes.From*.BasedOn<IFoo>()
- should note that the type will only be resolved directly, not via IFoo.
This is on a certain .sln that you have access to, wink wink, nodge nodge.
See Issue #25
when press "Registered Components" (on first Random) next message shown "No components matching this registration were found"
if "Registered Components" should shows all components or for the line only?
static void UnityDemoConstructorWithArray()
{
IUnityContainer container = new UnityContainer();
container.RegisterType<Random, Random>(
new InjectionConstructor()); // use default constructor for new Random()
container.RegisterType<Random, MyRandom>(
new InjectionConstructor()); // use default constructor for new Random()
container.RegisterType<MyServiceWithArray>
(new InjectionConstructor(
new ResolvedParameter<Random[]>()));
MyServiceWithArray myService = container.Resolve<MyServiceWithArray>();
foreach (Random random in myService.Randoms)
{
Console.WriteLine("Next: " + random.Next());
}
}
Add support for .Scan from Ninject.Extensions.Conventions
Add support for binding ToProvider (see NHibernate provider example)
Please add support for TinyIOC
Thanks
I had to manually copy the plugins folder from 7.0 to 7.1 (I did a repair with the installer?), however resharper complains that the version of AgentMulder that I am using references version 7.
Is this something that I can work around, or does the package need to be rebuilt?
This requires changes in the highlighting. Similarly how navigate to inheritance works, steal the code from there :)
Requires several changes, mainly using a .NET 3.5 version of MEF, and targeting all assemblies to .NET 3.5.
Encountered the following error in VS 2010 SP1 with R# 5.1 (5.1.3000.12):
Could not load plugins from the "C:\Users....\Agent Mulder" folder.
Could not load type 'JetBrains.Application.PluginSupport.PluginVendorAttribute' from assembly 'JetBrains.Platform.Resharper.Shell, Version=5.1.3000.12, Culture=neutral, PublicKeyToken=1010a0d8d6380325'.
Ninject.Extensions.Conventions has a nice convention that ISomeType
is implemented by SomeType
(drop the I, look for class in the same namespace & assembly). In theory, this need not be bound to Ninject, but rather a "generic convenion IoC" based on that rule.
This will allow adding support for things like MEF (#38)
Awesome idea! I would love to see autofac support, if I get the time/motivation I might send a few PR's :)
If I use ToFactory in Ninject as example below, I get a "Class 'Foo' is never instantiated" on the class Foo.
public class Foo
{}
public interface IFactory
{
Foo CreateFoo()
}
Bind.ToFactory();
Foo myFoo = _myFactory.CreateFoo()
I installed AgentMulder on my German VS2010 SP1 with R# 7.1.2.
Although the plugin is activated, it does not work. Only effect is that some R# menus (eg. Navigate To) get extremely slow (3-4 seconds to open)
Hi,
I'm using version 1.0.4.2 with R# 6.1.1000.82, and the following errors are listed in the plugins dialog:
Error PluginLoader: The file “C:\WINNT\Profiles\bristm\Application Data\JetBrains\ReSharper\v6.1\vs10.0\Plugins\AgentMulder\v7.0\Plugins\AgentMulder\AgentMulder.ReSharper.Domain.dll” references product version 7.0 which is incompatible with currently running 6.1
Error PluginLoader: The file “C:\WINNT\Profiles\bristm\Application Data\JetBrains\ReSharper\v6.1\vs10.0\Plugins\AgentMulder\v7.0\Plugins\AgentMulder\AgentMulder.ReSharper.Domain.dll” references product version 7.0.78.129 which newer than currently running 6.1.1000.82
Error PluginLoader: The file “C:\WINNT\Profiles\bristm\Application Data\JetBrains\ReSharper\v6.1\vs10.0\Plugins\AgentMulder\v7.0\Plugins\AgentMulder\AgentMulder.ReSharper.Plugin.dll” references product version 7.0 which is incompatible with currently running 6.1
Error PluginLoader: The file “C:\WINNT\Profiles\bristm\Application Data\JetBrains\ReSharper\v6.1\vs10.0\Plugins\AgentMulder\v7.0\Plugins\AgentMulder\AgentMulder.ReSharper.Plugin.dll” references product version 7.0.78.129 which newer than currently running 6.1.1000.82
Error PluginLoader: The file “C:\WINNT\Profiles\bristm\Application Data\JetBrains\ReSharper\v6.1\vs10.0\Plugins\AgentMulder\v7.0\Plugins\AgentMulder\Containers\AgentMulder.Containers.Autofac.dll” references product version 7.0 which is incompatible with currently running 6.1
Error PluginLoader: The file “C:\WINNT\Profiles\bristm\Application Data\JetBrains\ReSharper\v6.1\vs10.0\Plugins\AgentMulder\v7.0\Plugins\AgentMulder\Containers\AgentMulder.Containers.Autofac.dll” references product version 7.0.78.129 which newer than currently running 6.1.1000.82
Error PluginLoader: The file “C:\WINNT\Profiles\bristm\Application Data\JetBrains\ReSharper\v6.1\vs10.0\Plugins\AgentMulder\v7.0\Plugins\AgentMulder\Containers\AgentMulder.Containers.CastleWindsor.dll” references product version 7.0 which is incompatible with currently running 6.1
Error PluginLoader: The file “C:\WINNT\Profiles\bristm\Application Data\JetBrains\ReSharper\v6.1\vs10.0\Plugins\AgentMulder\v7.0\Plugins\AgentMulder\Containers\AgentMulder.Containers.CastleWindsor.dll” references product version 7.0.78.129 which newer than currently running 6.1.1000.82
I removed the v7.0 folder and everything seems to be working fine.
Cheers.
Description:
When concrete class bound by ninject and its implementation also
Code sample:
interface IEntity {}
class Entity : IEntity {} // here is an issue
class SubEntity : Entity {}
// Ninject configuration
Bind<IEntity>().To<Entity>() // here is an issue
Bind<IEntity>().To<SubEntity>()
Environment:
I'd love for AgentMulder to support the design-time xml-based method of configuring Unity. Currently only the fluent interface is supported
Trying to click on Resharper -> Navigate no menu appears and no other menu from Resharper cannot be accessed anymore.
Agent Mulder don't work at all and no IoC registration will be displayed.
JetBrains ReSharper 7.1.1 C# Edition
Build 7.1.1000.900 on 2012-12-13T14:22:48
Licensed to: XXX
Plugins: 4
#1. “StyleCop (4.7.42.0)” v4.7.1000.0 by http://stylecop.codeplex.com
#2. “Agent Johnson” v2.0.5.0 by “Jakob Christensen”
#3. “Agent Mulder plugin for ReSharper” v1.0.5.0 by “Igal Tabachnik”
#4. AgentSmith v1.6.1.0 by http://code.google.com/p/agentsmithplugin/
Visual Studio 11.0.51106.1.
Copyright © 2003–2013 JetBrains s.r.o. All rights reserved.
I have a very simple repository test using NinJect, but it appears that AgentM is not working at all. All the "old" ReSharper warnings and error messages are still displayed :(
AgentM: 1.0.3.0, ReSharper: 6.1.1000.82 VS: 10.0.40219.1 NinJect: 4.0.30319 - No other Resharper plug-ins installed.
Am I missing something obvious?
NinJect binding:
private static void registerServices(IKernel kernel)
{
kernel.Bind<IPageRepository>().To<PageRepository>();
}
Repository and Interface:
public interface IPageRepository : IRepository<Page>
{
Page GetSingle(int id);
}
public class PageRepository : Repository<Context, Page>, IPageRepository // Class PageRepository is never instantiated
{
public Page GetSingle(int id)
{
return GetAll().FirstOrDefault(x => x.Id == id);
}
}
Usage:
public partial class PageController : Controller
{
private readonly IPageRepository m_repository;
public PageController(IPageRepository repository) // Constructor PageController is never used
{
this.m_repository = repository;
}
Hi,
It seems like that using AgentMulder is causing some typing performance problems.
I've created a performance snapshot and jetbrains opened a bug for it which can be found here:
http://youtrack.jetbrains.com/issue/RSPL-4924
If it helps i can provide it to you somehow, it's about 60 Mb and I think you need Jetbrains dottrace to open it.
Br,
Daniel
Please add support for StructureMap IOC container
So AM can show me that/where my class is registered in the container. That's nice. Now, how about taking this to the next level by providing some additional information.
lifestyle is the most obvious/useful one - put a nice icon, or color for the most common lifestyles so that I can immediately see if the class I'm looking at ends up as a singleton, transient, per web-request or some other lifestyle.
Hi,
as the current version of ReSharper 8 EAP already supports extension gallery it would be fine to find it there
Br, Daniel
I am not getting any information on my types (Unity).
It is very hard to say what is happening: does Unity support work correctly? Is it just something weird about my solution?
Some kind of log or a list of detected frameworks somewhere would have been very useful.
Based on the thesis that the container should be the preferred method of accessing concrete implementations it would be awesome if Agent Mulder could raise a warning if a class which is found to be registered in the container also is explicitly instantiated somewhere in the code.
Check this blog post for a more thorough explanation: http://blog.diktator.org/index.php/2013/02/06/ioc-containers-vs-resharper-vs-agent-mulder/
You should Tag stable releases so they can be downloaded as zip from Github.
Could you please add the support for Microsoft Unity?
If I use Value Origins on a dependency and it is originally injected by a DI container, that should be visually indicated as a special node in the "Value Origins" tree
.NET 4.0, Visual Studio 2010 Ultimate (10.0.40219.1 SP1Rel), ReSharper 6.1.37.86, Ninject 3.0.1.10 via nuget.
I am still getting a warning for the 'Foo' class, with this code:
using System;
using Ninject;
using Ninject.Modules;
namespace MulderNinject
{
class Program
{
static void Main()
{
using (IKernel kernel = new StandardKernel(new TestModule()))
{
var foo = kernel.Get<IFoo>();
foo.Bar();
}
}
}
class TestModule : NinjectModule
{
public override void Load()
{
Bind<IFoo>().To<Foo>();
}
}
interface IFoo
{
void Bar();
}
class Foo : IFoo
{
public void Bar()
{
Console.WriteLine("Bar");
}
}
}
"Leaked solution detected" is being thrown by ReSharper.
@citizenmatt, your help would be appreciated :)
It would be awesome if we could get support for Ninject Conventions registration-by-convention.
We register all our classes across all our assemblies like so:
IKernel kernel = new StandardKernel(new NinjectSettings { LoadExtensions = true});
kernel.Bind(t => t.FromAssembliesMatching("Application.Namespace.*")
.SelectAllClasses()
.BindAllInterfaces());
This loads all Application.Namespace.*.dll assemblies and registers all interfaces on all classes.
We then Rebind any interfaces requiring special treatment.
kernel.Rebind<ICacheManager>().To<CacheManager>().InSingletonScope();
Thanks
Are there any plans for VB support? If not, it should probably be mentioned somewhere. Thanks!
Having a signature like:
public Foo(IBar bar) {}
Have IBar
highlighted (perhaps by using an underline like the MVC views), clicking on which would take you to where the concrete type is being instantiated (either directly or via DI container)
If you load the TestApplication solution directly, opening any interfaces (such as ICommon.cs) throws an exception with a NullReferenceException, because the assembly in Windsor's FromAssemblyNamed method is trying to load "TestProject", which doesn't exist in the solution. The null module should mean that registration isn't valid and not added to the list.
I think the whole point of IoC support is to do this and, furthermore, to do this en masse. What I mean is that instead of new Foo()
you could give options to refactor it to either container.Resolve<Foo>()
or -- and this is tricky -- to have Foo
injected into the containing class.
Having a refactoring, you could easily do a Code Cleanup module that could perform this change on the whole solution. The net result would be epic: anyone who's just starting with IoC can refactor their whole codebase to use IoC in just one click.
That's my dream IoC feature, anyway.
It's wonderful. We really need it!
Autofac.Integration.Mvc.RegisterControllers and Autofac.Integration.WebApi.RegisterApiControllers should probably be supported
This was introduced as a heuristic in the cache builder, it scans the using
directives of a file to see if it refers to any containers. However, if a container type is prefixed with a FQN instead of a using, it will not work.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.