locked
Error 6 running test with Fakes in VS2013 Ultimate RRS feed

  • Question

  • I have VS2013 Ultimate, and working on a WP8.0 project 

    I added the Fakes Assembly. I did a very simple test but this error appears:

    Error 6 The type 'System.ComponentModel.IDataErrorInfo' exists in both 'c:\Program Files (x86)\Microsoft SDKs\Windows Phone\v8.0\Tools\MDILXAPCompile\Framework\System.dll' and and 'c:\Program Files (x86)\Microsoft SDKs\Windows Phone\v8.0\Tools\MDILXAPCompile\Framework\System.Windows.dll'

    I need to know how to fix this error.  Thanks. Below is the test I ran.

    using (ShimsContext.Create())
                {
                    //The ShimDateTime.NowGet replaces the real DateTime.Now value with our own DateTime value, which we have provided via the delegate.
                    ShimDateTime.NowGet = () => new DateTime(2012, 12, 21);
                    Assert.IsTrue(DateTime.Now == new DateTime(2012, 12, 21));
                }

    Friday, January 9, 2015 8:59 PM

All replies

  • Hi Tnesham,

    From my side, the issue occurred at System.ComponentModel.IDataErrorInfo type instead of test code. Please run the test again or debug the unit test to check which code line throws this error.

    Please make sure the WP8.0 project run fine from VS2013 if you want to test it.

    Which assembly did you add?

    Please add assembly for System.dll and use the following code:

    System.Fakes.ShimDateTime.NowGet =

                    () =>

                    { return new DateTime(2012, 12,21); };

    Thanks,


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Monday, January 12, 2015 8:05 AM
  • Thanks for the reply. The error has IDataErrorInfo exists in BOTH System.dll and Windows.dll, which implies System.dll is already added?

    The project runs fine. I did not add any assemblies other than Fakes. I have tried this with two different Solutions. 1. WP8.0 Phone project 2. Universal App. In both cases the Solution has multiple projects, and each has a PCL project. Next I will try to create a stand-alone Test Solution, and add projects to isolate the conflict.

    Here is the full error output

    Error 5 project compilation failed with exit code 1 C:\git\SUBCO-mob-windows\MYCO-NMA\MYCO\MYCO.SUBCO.Test\GENERATEFAKES MYCO.SUBCO.Test
    Error 10 project compilation failed with exit code 1 C:\git\SUBCO-mob-windows\MYCO-NMA\MYCO\MYCO.SUBCO.Test\GENERATEFAKES MYCO.SUBCO.Test
    Error 1 The type 'System.ComponentModel.IDataErrorInfo' exists in both 'c:\Program Files (x86)\Microsoft SDKs\Windows Phone\v8.0\Tools\MDILXAPCompile\Framework\System.dll' and 'c:\Program Files (x86)\Microsoft SDKs\Windows Phone\v8.0\Tools\MDILXAPCompile\Framework\System.Windows.dll' [C:\git\SUBCO-mob-windows\MYCO-NMA\MYCO\MYCO.SUBCO.Test\obj\Debug\Fakes\s\f.csproj] C:\git\SUBCO-mob-windows\MYCO-NMA\MYCO\MYCO.SUBCO.Test\f.cs 4736 98 MYCO.SUBCO.Test
    Error 2 The type 'System.ComponentModel.IDataErrorInfo' exists in both 'c:\Program Files (x86)\Microsoft SDKs\Windows Phone\v8.0\Tools\MDILXAPCompile\Framework\System.dll' and 'c:\Program Files (x86)\Microsoft SDKs\Windows Phone\v8.0\Tools\MDILXAPCompile\Framework\System.Windows.dll' [C:\git\SUBCO-mob-windows\MYCO-NMA\MYCO\MYCO.SUBCO.Test\obj\Debug\Fakes\s\f.csproj] C:\git\SUBCO-mob-windows\MYCO-NMA\MYCO\MYCO.SUBCO.Test\f.cs 4737 39 MYCO.SUBCO.Test
    Error 6 The type 'System.ComponentModel.IDataErrorInfo' exists in both 'c:\Program Files (x86)\Microsoft SDKs\Windows Phone\v8.0\Tools\MDILXAPCompile\Framework\System.dll' and 'c:\Program Files (x86)\Microsoft SDKs\Windows Phone\v8.0\Tools\MDILXAPCompile\Framework\System.Windows.dll' [C:\git\SUBCO-mob-windows\MYCO-NMA\MYCO\MYCO.SUBCO.Test\obj\Debug\Fakes\s\f.csproj] C:\git\SUBCO-mob-windows\MYCO-NMA\MYCO\MYCO.SUBCO.Test\f.cs 4736 98 MYCO.SUBCO.Test
    Error 7 The type 'System.ComponentModel.IDataErrorInfo' exists in both 'c:\Program Files (x86)\Microsoft SDKs\Windows Phone\v8.0\Tools\MDILXAPCompile\Framework\System.dll' and 'c:\Program Files (x86)\Microsoft SDKs\Windows Phone\v8.0\Tools\MDILXAPCompile\Framework\System.Windows.dll' [C:\git\SUBCO-mob-windows\MYCO-NMA\MYCO\MYCO.SUBCO.Test\obj\Debug\Fakes\s\f.csproj] C:\git\SUBCO-mob-windows\MYCO-NMA\MYCO\MYCO.SUBCO.Test\f.cs 4737 39 MYCO.SUBCO.Test
    Error 3 The type 'System.ComponentModel.ISupportInitialize' exists in both 'c:\Program Files (x86)\Microsoft SDKs\Windows Phone\v8.0\Tools\MDILXAPCompile\Framework\System.dll' and 'c:\Program Files (x86)\Microsoft SDKs\Windows Phone\v8.0\Tools\MDILXAPCompile\Framework\System.Windows.dll' [C:\git\SUBCO-mob-windows\MYCO-NMA\MYCO\MYCO.SUBCO.Test\obj\Debug\Fakes\s\f.csproj] C:\git\SUBCO-mob-windows\MYCO-NMA\MYCO\MYCO.SUBCO.Test\f.cs 5376 98 MYCO.SUBCO.Test
    Error 4 The type 'System.ComponentModel.ISupportInitialize' exists in both 'c:\Program Files (x86)\Microsoft SDKs\Windows Phone\v8.0\Tools\MDILXAPCompile\Framework\System.dll' and 'c:\Program Files (x86)\Microsoft SDKs\Windows Phone\v8.0\Tools\MDILXAPCompile\Framework\System.Windows.dll' [C:\git\SUBCO-mob-windows\MYCO-NMA\MYCO\MYCO.SUBCO.Test\obj\Debug\Fakes\s\f.csproj] C:\git\SUBCO-mob-windows\MYCO-NMA\MYCO\MYCO.SUBCO.Test\f.cs 5377 39 MYCO.SUBCO.Test
    Error 8 The type 'System.ComponentModel.ISupportInitialize' exists in both 'c:\Program Files (x86)\Microsoft SDKs\Windows Phone\v8.0\Tools\MDILXAPCompile\Framework\System.dll' and 'c:\Program Files (x86)\Microsoft SDKs\Windows Phone\v8.0\Tools\MDILXAPCompile\Framework\System.Windows.dll' [C:\git\SUBCO-mob-windows\MYCO-NMA\MYCO\MYCO.SUBCO.Test\obj\Debug\Fakes\s\f.csproj] C:\git\SUBCO-mob-windows\MYCO-NMA\MYCO\MYCO.SUBCO.Test\f.cs 5376 98 MYCO.SUBCO.Test
    Error 9 The type 'System.ComponentModel.ISupportInitialize' exists in both 'c:\Program Files (x86)\Microsoft SDKs\Windows Phone\v8.0\Tools\MDILXAPCompile\Framework\System.dll' and 'c:\Program Files (x86)\Microsoft SDKs\Windows Phone\v8.0\Tools\MDILXAPCompile\Framework\System.Windows.dll' [C:\git\SUBCO-mob-windows\MYCO-NMA\MYCO\MYCO.SUBCO.Test\obj\Debug\Fakes\s\f.csproj] C:\git\SUBCO-mob-windows\MYCO-NMA\MYCO\MYCO.SUBCO.Test\f.cs 5377 39 MYCO.SUBCO.Test


    • Edited by tnesham Monday, January 12, 2015 2:25 PM
    Monday, January 12, 2015 12:27 PM
  • Hi Tnesham,

    Could you please share us a sample which can reproduce your issue? You can send it to my mailbox: v-amanz@Microsoft.com

    Thanks,


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Tuesday, January 13, 2015 6:56 AM
  • Thanks for the offer, but by the time I create a smaller solution that exposes the issue, I probably won't have the issue. And I can't send the entire application. After I get around to creating a smaller issue that has the same issue, I'll send it to you. And if I find the issue because of that I'll post the resolution here.
    Wednesday, January 14, 2015 3:57 PM
  • OK, waiting for your good news:)

    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Thursday, January 15, 2015 8:49 AM