locked
TFS/VS 2015 build server does not generate Fakes assemblies RRS feed

  • Question

  • I am in the process of getting our solution to work with Visual Studio 2015. Everything is working locally but when I build the solution on a build server then it fails because it can't find various Fakes assemblies:

    Could not resolve this reference. Could not locate the assembly
    "ModelInterfaces.0.0.0.4.Fakes". Check to make sure the assembly
    exists on disk. If this reference is required by your code, you may get
    compilation errors.

    The assembly in question is one of our privately build assemblies that are part of the solution and there are no errors/warnings in the log that indicates that the generation failed, however the assembly is not in the output folder so that error does not lie.

    Build server has TFS 2015 configured for XAML build and VS 2015 Enterprise. Unit test project is .Net 4.5.1 and the project under test is 4.0. It builds perfectly and tests passes on our current build servers (TFS 2013.4 and VS 2013.4) and locally on a machine with only Visual Studio 2015 installed.

    Fakes configuration file looks like this:

    <Fakes xmlns="http://schemas.microsoft.com/fakes/2011/" Diagnostic="true" Verbosity="Verbose">
      <Assembly Name="ModelInterfaces" Version="0.0.0.4"/>
      <StubGeneration>
        <Clear/>
        <Add FullName="IHelpViewer"/>
      </StubGeneration>
      <ShimGeneration>
        <Clear/>
      </ShimGeneration>
    </Fakes>

    Any hints to a solution is welcome!


    Tore Østergaard
    Oticon A/S, Denmark


    • Edited by 2re Wednesday, August 26, 2015 8:43 AM Added a little more information
    • Moved by Tina-Shi Thursday, August 27, 2015 6:52 AM related to the TFS build
    Tuesday, August 25, 2015 3:24 PM

Answers

  • Hi Starain

    Thanks for your reply.

    We have been looking a little bit more on the problem and it seems related to our custom build flow that calls an old version of msbuild. By setting the ToolPlatform to 14.0 we managed to get our builds running again.


    Tore Østergaard
    Oticon A/S, Denmark

    Monday, August 31, 2015 9:11 AM

All replies

  • I have downgraded the test project so that it is also .Net 4.0 - but still the same problem.

    By the way, my example above specifies version "0.0.0.4", but I see the same problem for Fakes assemblies without the version specified.


    Tore Østergaard
    Oticon A/S, Denmark

    Wednesday, August 26, 2015 2:04 PM
  • Hi,

    Since this issue is related to the TFS Build, so we will move this case to the TFS build forum, you will get better support.

    Best Regards,


    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, August 27, 2015 6:51 AM
  • Hi,

    Base on my test with fake test in VS2015 and TFS 2015, it works fine (tests pass too). What’s the result if you run that fake test in VS2015 directly in your test agent machine? Could you reproduce that issue in a new project?

    This is my code:

      [TestClass()]
        public class StockFeedTests
        {
            [TestMethod()]
            public void GetSharePriceTest()
            {
                IStockFeed stockFeed = new Fakes.StubIStockFeed()
                {
                    GetSharePriceString = (company) => { return 1234; }
                };
                var componentUnderTest = new StockAnalyzer(stockFeed);
                int actualValue = componentUnderTest.GetContosoPrice();
                Assert.AreEqual(1234, actualValue);
            }
        }

    Regards

    Starain


    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.

    Friday, August 28, 2015 2:11 AM
    Moderator
  • Hi Starain

    Thanks for your reply.

    We have been looking a little bit more on the problem and it seems related to our custom build flow that calls an old version of msbuild. By setting the ToolPlatform to 14.0 we managed to get our builds running again.


    Tore Østergaard
    Oticon A/S, Denmark

    Monday, August 31, 2015 9:11 AM