locked
Test Project fails to build once adding class to implement IReportServerCredentials RRS feed

  • Question

  • I currently have a web project that is in VS2010.  A test project was created for the web project with tests.  Everything built and tested fine until we added a class that implemented IReportServerCredentials.  As soon as that class is added, I receive a message that my dll for the web project could not be found.  (Could not load file or assembly.....The system cannot find the file specified.)   However, if you view the references in the project, you can see the reference there.  I've also confirmed that the reference does truly exist in that location with that specific version number. 

    If I comment out the code for the class and the two lines of code in the project that call the class, the test project builds with no issues.

    I'm using .NET Framwork 4.0.

    The class IReportServerCredentials is referecing Microsoft.ReportViewer.WebForms Version 10.0.0.0.

    Any ideas?  Help is greatly appreciated!!

    Thanks!

    Nikki


    Nikki Veit

    • Moved by Cathy Kong Wednesday, October 10, 2012 5:47 AM (From:Team Foundation Server - Build Automation)
    Tuesday, October 9, 2012 8:50 PM

Answers

  • Hi Nikki,

    Glad to receive your reply.

    I’m afraid that I didn’t have a good idea, you could send the project to jackzhai at Hotmail dot com, I will try to check it in my PC.

    I have not created any tests for the class IReportServerCredentials nor do I want to. The main project that was referenced for the test project had that class added. It was when that was added that the test project stopped building.

    If your unit test isn’t used to test the class, why did you add the class to the test project as the reference? As my understanding, if you create the unit test for an app, the whole app will be added to the test project as the reference, if so, we wouldn’t add other class in the app to the Test project. Maybe you could try to re-create a new test project for this app after you updated this app, and then check the result.

    Best Regards,


    Jack Zhai [MSFT]
    MSDN Community Support | Feedback to us

    • Marked as answer by veitn Monday, October 15, 2012 3:11 AM
    Monday, October 15, 2012 2:45 AM
    Moderator

All replies

  • Hi Nikki,

    Thanks for your post!

    I moved the thread to Visual Studio Team System - Testing forum for better response, because the issue is more related with VSTS Testing.

    Hope it helps!

    Best Regards,


    Cathy Kong [MSFT]
    MSDN Community Support | Feedback to us

    Wednesday, October 10, 2012 5:50 AM
  • Hi Nikki,

    Thank you for posting in the MSDN forum.

    Just to make this issue clearly, you are running a Unit test project, am I right? Do you mean you want to create private accessor when implementing IReportServerCredentials?

    If so, like this feedback: http://connect.microsoft.com/VisualStudio/feedback/details/622076/unit-test-cannot-create-private-accessor-when-implementing-ireportservercredentials.

    The private accessor generation feature is no longer supported as documented at http://blogs.msdn.com/b/vstsqualitytools/archive/2010/01/18/publicize-and-code-generation-for-visual-studio-2010.aspx.

    If I have misunderstood anything, please make free feel to let me know.

    Best Regards,


    Jack Zhai [MSFT]
    MSDN Community Support | Feedback to us

    Wednesday, October 10, 2012 9:20 AM
    Moderator
  • Jack,

    Yes, I am running a Unit test project.  I do not have a need to test the Report Viewer so I do not need to create a private accessor.  My issue is that my test project builds and works ok until I have the IReportServerCrentials in the project that I am referencing.  (It's a dll.)

    Thank you!

    Nikki


    Nikki Veit

    Thursday, October 11, 2012 2:24 AM
  • Hi Nikki,

    Not very sure how you create the unit test with the class IReportServerCredentials, but if it is a .dll file in a class library, and then you add it to the test project as the reference, you would check whether your .dll file is in the path of your class library. If you change anything in the class, I suggest you clean and rebuild your class project, and move the reference from the test project, and re-add it and check the result. In addition, right click the dll file in the references->properties, set the "Copy Local=True".

    If still no help, please attach your Visual Studio project, you can upload it to the sky driver, and then share the download link in your post. Please also show the whole error messages in your post.

    If there's any concern, please feel free to let me know.

    Best Regards,


    Jack Zhai [MSFT]
    MSDN Community Support | Feedback to us


    Thursday, October 11, 2012 5:58 AM
    Moderator
  • Jack,

    The test project was created by right-clicking on a function in the main project.  From there it brought up the wizard to select what items I wanted to create a test for and created a test project with the selected stubbed out tests.

    I have not created any tests for the class IReportServerCredentials nor do I want to.  The main project that was referenced for the test project had that class added.  It was when that was added that the test project stopped building.

    The exact error is:

    Description: Could not load file or assembly 'ASBR, Version=1.3.2.0,
    Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system
    cannot find the file specified.
    Project: ASBRTests

    However, when I look at the references to the test project, the ASBR.dll version 1.3.2 is showing as available and copy local is set to true.

    I have tried cleaning and rebuilding the main project.  Then removing and adding the dll of the main project to the test project.  Cleaning and building the test project.  Still receive the same error.

    Error Screen Shot

     Above is the image of the references in the test project and the error messgae when i build. Hopefully this will "show" it better than I am describing.

    I'm not familiar with SkyDrive but will check it out to see if that would be an option for me to post for you.

    Thanks again!

    Nik


    Nikki Veit

    Thursday, October 11, 2012 8:42 PM
  • Hi Nikki,

    A test project was created for the web project with tests. Everything built and tested fine until we added a class that implemented IReportServerCredentials.

    As you said that you create a unit test for a web app, the unit test could run well, if so, where did you add the class IReportServerCredentials? If it is a class in your web app, you would check whether your web app could work normally now. If your web app didn’t work, so we could make sure that it is not the unit test issue, it is related to your web app. So you would discuss this issue with your develop team, and find the rooted reason.

    Have a nice weekend,


    Jack Zhai [MSFT]
    MSDN Community Support | Feedback to us

    Friday, October 12, 2012 7:12 AM
    Moderator
  • Jack,

    Sorry it wasn't clear on where the IReportServerCredentials class was added....This class is in my main project.  My main project (web app) is working fine.  It is the test project that stopped building once this class was added to the web application. 


    Nikki Veit

    Sunday, October 14, 2012 3:37 PM
  • Hi Nikki,

    Glad to receive your reply.

    I’m afraid that I didn’t have a good idea, you could send the project to jackzhai at Hotmail dot com, I will try to check it in my PC.

    I have not created any tests for the class IReportServerCredentials nor do I want to. The main project that was referenced for the test project had that class added. It was when that was added that the test project stopped building.

    If your unit test isn’t used to test the class, why did you add the class to the test project as the reference? As my understanding, if you create the unit test for an app, the whole app will be added to the test project as the reference, if so, we wouldn’t add other class in the app to the Test project. Maybe you could try to re-create a new test project for this app after you updated this app, and then check the result.

    Best Regards,


    Jack Zhai [MSFT]
    MSDN Community Support | Feedback to us

    • Marked as answer by veitn Monday, October 15, 2012 3:11 AM
    Monday, October 15, 2012 2:45 AM
    Moderator
  • Hi Nikki,

    Glad to receive your reply.

    I’m afraid that I didn’t have a good idea, you could send the project to jackzhai at Hotmail dot com, I will try to check it in my PC.

    I have not created any tests for the class IReportServerCredentials nor do I want to. The main project that was referenced for the test project had that class added. It was when that was added that the test project stopped building.

    If your unit test isn’t used to test the class, why did you add the class to the test project as the reference? As my understanding, if you create the unit test for an app, the whole app will be added to the test project as the reference, if so, we wouldn’t add other class in the app to the Test project. Maybe you could try to re-create a new test project for this app after you updated this app, and then check the result.

    Best Regards,


    Jack Zhai [MSFT]
    MSDN Community Support | Feedback to us

    Jack,

    I created a new test project based on my main project and stubbed out the methods with the wizard.  I then took the old test project and copied my test procedures to it.  It the built successfully.  I'm not sure what happened to the old test project but this got me past my issue.  (I never added the IReportCrendentials class to the old test project.  It was just once that was added in the main project that the build would fail in the test project.  But if I removed the reference from my main project the test project would build.  Must have been some quirk with the old test project.)

    Thank you!


    Nikki Veit


    • Edited by veitn Monday, October 15, 2012 3:17 AM clarification
    Monday, October 15, 2012 3:14 AM