The problem of fakes generation for AcDbMng.dll and AcMng.dll assemblies

The problem of fakes generation for AcDbMng.dll and AcMng.dll assemblies

Anonymous
Not applicable
694 Views
2 Replies
Message 1 of 3

The problem of fakes generation for AcDbMng.dll and AcMng.dll assemblies

Anonymous
Not applicable

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:

> 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.

> 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? How can I fix it?

0 Likes
Accepted solutions (1)
695 Views
2 Replies
Replies (2)
Message 2 of 3

Anonymous
Not applicable

Maybe Autodesk uses own interfaces with the same names and I am to add some additional assemblies of AutoCAD for Microsoft Fakes Framework using?

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:

 

0.png

0 Likes
Message 3 of 3

Anonymous
Not applicable
Accepted solution

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

 

<Fakes xmlns="http://schemas.microsoft.com/fakes/2011/">
  <Assembly Name="AcDbMgd" Version="17.2.0.0"/>
  <StubGeneration>
    <Clear/>
  </StubGeneration>
  <ShimGeneration>
    <Clear/>
    <Add Namespace="Autodesk.AutoCAD.DatabaseServices"/>
  </ShimGeneration>
</Fakes>

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

 

 

0 Likes