0

In my solution, I have a project (let's say 'PRJ1' ) which has a type inside, say MyAttribute1 that implements UITypeEditor.

In another project,I reference PRJ1 and use MyAttribute1 as an attribute for a property.

The problem is, when I build the solution, prj1.dll does not copy in the final solution dir. This lead to CurrentDomain_AssemblyResolve to be fired. If I create a local field of type MyAttribut1e, everything is OK!

What is the problem? What I'm missing here?

Jaimesh
  • 841
  • 4
  • 25
  • 41
BHP
  • 443
  • 4
  • 13
  • MSBuild can only copy dependent assemblies when the assembly contains code that references types from such an assembly. That won't work when it uses Reflection, as you are apt to do when you use attributes. You must then help with a postbuild event that uses xcopy.exe to copy the assembly. Or change the build output directory. – Hans Passant May 28 '16 at 11:47
  • Well, thanks Hans, The point you mentioned finaly pointed me to this great post http://stackoverflow.com/questions/1132243/msbuild-doesnt-copy-references-dlls-if-using-project-dependencies-in-solution – BHP May 28 '16 at 15:48

1 Answers1

0

Sounds like you're not referencing the project as a project reference within the solution, but are directly referencing the .dll?

Try removing the reference from the project that is using your attribute, then add the reference again being careful to select the project from the projects section rather than browsing to the .dll

Dave
  • 474
  • 3
  • 17
  • I have referenced the project not the .dll. I also tested this scenario in another solution and the result was the same. – BHP May 28 '16 at 10:26