Author Topic: The problem of fakes generation for AcDbMng.dll and AcMng.dll assemblies  (Read 1708 times)

0 Members and 1 Guest are viewing this topic.

Andrey Bushman

  • Swamp Rat
  • Posts: 864
MS Visual Studio 2015 Enterprise
AutoCAD 2009 SP3

I am learning Microsoft Fakes Framework. I create new Unit Test Project, add AcDbMng.dll and AcMng.dll assemblies of AutoCAD 2009 into my project, and through their context menu call the "Add Fakes Assembly". Now I launch my project building and get 128 errors... For example:

Quote
    It wasn't succeeded to find type or a name of a name space of "ICollection" (perhaps, there is no directive of using or an assembly reference). [c:\users\andrey\documents\visual studio 2015\Projects\msfakes\obj\Debug\Fakes\adm\f.csproj] msfakes c:\users\andrey\documents\visual studio 2015\Projects\msfakes\f.cs 206092

    It wasn't succeeded to find type or a name of a name space of "IDictionary" (perhaps, there is no directive of using or an assembly reference). [c:\users\andrey\documents\visual studio 2015\Projects\msfakes\obj\Debug\Fakes\adm\f.csproj] msfakes c:\users\andrey\documents\visual studio 2015\Projects\msfakes\f.cs 206119

    The modifier "override" is not valid for this item. [c: \ users \ andrey \ documents \ visual studio 2015 \ Projects \ msfakes \ obj \ Debug \ Fakes \ adm \ f.csproj] msfakes c: \ users \ andrey \ documents \ visual studio 2015 \ Projects \ msfakes \ f. cs 206119

Such error messages are not clear for me. I tried to change the target .Net Framework platform: .Net 4.6 and .Net 3.5, but I get the same messages.

Quote
ICollection, IDictionary, modifier "override"...

I don't understand, what relation they have to these assemblies, because they are defined in the platform assemblies instead of AcDbMng.dll and AcMng.dll.

Anybody has idea about such behaviour?

UPD
Maybe Autodesk uses own interfaces with the same names and I am to add some additional assemblies of AutoCAD for Microsoft Fakes Framework using?
« Last Edit: January 01, 2016, 02:08:02 PM by Andrey Bushman »

Andrey Bushman

  • Swamp Rat
  • Posts: 864
Re: The problem of fakes generation for AcDbMng.dll and AcMng.dll assemblies
« Reply #1 on: January 01, 2016, 02:25:57 PM »
If I generate the fake only for `AcMng.dll` then I haven't errors. But if I generate the fake also for `AcDbMng.dll` then I get these problems. Also, at this case in the Solution Explorer I see the `AcMgd.17.2.0.0.Fakes` appeared, but I don't see something like `AcDbMgd.17.2.0.0.Fakes`:


Andrey Bushman

  • Swamp Rat
  • Posts: 864
Re: The problem of fakes generation for AcDbMng.dll and AcMng.dll assemblies
« Reply #2 on: January 02, 2016, 04:33:04 AM »
My question is closed.

This problem can be solved through the `AcDbMgd.fakes` file editing. For example:

Code - XML: [Select]
  1. <Fakes xmlns="http://schemas.microsoft.com/fakes/2011/">
  2.   <Assembly Name="AcDbMgd" Version="17.2.0.0"/>
  3.   <StubGeneration>
  4.     <Clear/>
  5.   </StubGeneration>
  6.   <ShimGeneration>
  7.     <Clear/>
  8.     <Add Namespace="Autodesk.AutoCAD.DatabaseServices"/>
  9.   </ShimGeneration>
  10. </Fakes>

More detailed info about the `fakes`-format is here.