This is a migrated thread and some comments may be shown as answers.

debugger could not locate the source file

5 Answers 730 Views
JustMock Free Edition
This is a migrated thread and some comments may be shown as answers.
ulaga
Top achievements
Rank 1
ulaga asked on 25 Aug 2011, 07:43 AM
Hi Telerik Team,

I have some couple of doubts in Telerik JustMock Trial Edition which i am trying to do sample project in order to startwith.Based on the success we will go for integration with bigger entity framework projects.



1.  Brief description of my tiny sample project:-  Here GetProjectsTest(), connects to database and returns the number of projects in the form of generic List and then i compared with existing project instance 'tom' which is then added to generic list. Suppose both hard coded value and the other which i get from database are equal then the result is passed.

My aim is to check whether i am able to work with project even when the database service is not available.


//sample code

using TestProject1; - This is the project where i am having all my classes.


 [TestMethod()]
        public void GetProjectsTest()
        {
            
           // Assert.IsFalse(Mock.IsProfilerEnabled);
            //Arrange
            Project tom = new Project() { ProjectID = 1, ProjectName = "iris" };

            List<Project> lstpers = new List<Project>();

            lstpers.Add(tom);

            //Mock.SetupStatic<ProjectManager>(Behavior.Strict);
            Mock.Arrange(() => ProjectManager.GetProjects()).Returns(lstpers);

            //Act + Assert
            Assert.AreEqual(ProjectManager.GetProjects(), lstpers);
        }



when i try to debug the above code , it throws the following errors:-

Locating source for 'c:\B\Basilisk\Basilisk CI Build\Sources\CodeBase\Telerik.JustMock\Mock.cs'. (No checksum.)
The file 'c:\B\Basilisk\Basilisk CI Build\Sources\CodeBase\Telerik.JustMock\Mock.cs' does not exist.
Looking in script documents for 'c:\B\Basilisk\Basilisk CI Build\Sources\CodeBase\Telerik.JustMock\Mock.cs'...
Looking in the projects for 'c:\B\Basilisk\Basilisk CI Build\Sources\CodeBase\Telerik.JustMock\Mock.cs'.
The file was not found in a project.
Looking in directory 'E:\Program Files\Microsoft Visual Studio 10.0\VC\crt\src\'...
Looking in directory 'E:\Program Files\Microsoft Visual Studio 10.0\VC\atlmfc\src\mfc\'...
Looking in directory 'E:\Program Files\Microsoft Visual Studio 10.0\VC\atlmfc\src\atl\'...
Looking in directory 'E:\Program Files\Microsoft Visual Studio 10.0\VC\atlmfc\include\'...
The debug source files settings for the active solution indicate that the debugger will not ask the user to find the file: c:\B\Basilisk\Basilisk CI Build\Sources\CodeBase\Telerik.JustMock\Mock.cs.
The debugger could not locate the source file 'c:\B\Basilisk\Basilisk CI Build\Sources\CodeBase\Telerik.JustMock\Mock.cs'.


2. Please explain step by step , so that i could understand what happens when i debug my code , when JustMock is disabled in Telerik Menu of Visual studio2010,

With Great Expectation
Ulaga

5 Answers, 1 is accepted

Sort by
0
Ricky
Telerik team
answered on 26 Aug 2011, 02:06 PM
Hi Ulaga,

Thanks again for reporting the problem.

However, while i tried the test with profiler enabled (Enable JustMock is grayed out) it passed as expected. Since static method mocking is done via profiler therefore it is usual to fail when turned off. In case of debugging it tries to step into the source but if you cancel, it will give you the following exception:

"There were some problems intercepting the mock call. Optionally, please make sure that you have turned on JustMock's profiler while mocking concrete members."

But in case you directly want to hit to the above exception. You can just remove the Telerik.JustMock.pdb from %Program_Files%\Libraries\ folder which will tell the debugger not to look for any further information when an exception is hit.

Hope this information is useful.

Kind Regards,
Mehfuz
the Telerik team

Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

0
ulaga
Top achievements
Rank 1
answered on 29 Aug 2011, 05:00 AM

hi Mehfuz,

i have removed Telerik.JustMock.pdb and also tried the same but the same error happens.

when debugging comes near Mock.Arrange() statement it throws the error as

Locating source for 'c:\B\Minotaur\JustMock CI Build\Sources\Telerik.CodeWeaver.Hook\Weaver.StaticClasses.cs'. (No checksum.)
The file 'c:\B\Minotaur\JustMock CI Build\Sources\Telerik.CodeWeaver.Hook\Weaver.StaticClasses.cs' does not exist.
Looking in script documents for 'c:\B\Minotaur\JustMock CI Build\Sources\Telerik.CodeWeaver.Hook\Weaver.StaticClasses.cs'...
Looking in the projects for 'c:\B\Minotaur\JustMock CI Build\Sources\Telerik.CodeWeaver.Hook\Weaver.StaticClasses.cs'.
The file was not found in a project.
Looking in directory 'E:\Program Files\Microsoft Visual Studio 10.0\VC\crt\src\'...
Looking in directory 'E:\Program Files\Microsoft Visual Studio 10.0\VC\atlmfc\src\mfc\'...
Looking in directory 'E:\Program Files\Microsoft Visual Studio 10.0\VC\atlmfc\src\atl\'...
Looking in directory 'E:\Program Files\Microsoft Visual Studio 10.0\VC\atlmfc\include\'...
The debug source files settings for the active solution indicate that the debugger will not ask the user to find the file: c:\B\Minotaur\JustMock CI Build\Sources\Telerik.CodeWeaver.Hook\Weaver.StaticClasses.cs.
The debugger could not locate the source file 'c:\B\Minotaur\JustMock CI Build\Sources\Telerik.CodeWeaver.Hook\Weaver.StaticClasses.cs'.

if i continue pressing F11 it asks for the following file(please see the screenshot for better understanding)each time it asks for differnt file

Additional details:-
Operating system :windows7,32 bit

IDE used:Visual studio2010

and also i have my project in E drive,but telerik dlls are installed in C drive.

Regards,
Ulaga

0
Ricky
Telerik team
answered on 29 Aug 2011, 08:50 AM
Hi Ulaga,

Thanks again for the reply. Here in the exception now you can see that it is looking for source in Telerik.CodeWeaver.Hook.dll

Locating source for 'c:\B\Minotaur\JustMock CI Build\Sources\Telerik.CodeWeaver.Hook\Weaver.StaticClasses.cs'. (No checksum.)


Therefore, please remove the Telerik.CodeWeaver.Hook.pdb as well from the same folder mentioned in my previous reply.

Generally, pdbs help you pin-point errors in case of exception or issues with JustMock so that in odd cases we can resolve your issue as fast as possible. However if you just don’t need that amount of detail feel free to remove the pdbs from Libraries folder.

Hope the information is useful.


Kind Regards,
Mehfuz
the Telerik team

Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

0
ulaga
Top achievements
Rank 1
answered on 29 Aug 2011, 11:23 AM
Hi Mehfuz,


It is working now with out errors. If i disable the justmock and execute my project means it is giving error as "There were some problems intercepting the mock call. Optionally, please make sure that you have turned on JustMock's profiler while mocking concrete members."

But i don't know how justmock will work, when database service is not working and also My aim is to check whether i am able to work with project even when the database service is not available.

At present if my database service is not running and if i run my project with justmock then it gives error as  "Network error".

So please explain me in what way the JUSTMOCK removes dependencies of Database.

Regards,
Ulaga
:
0
Ricky
Telerik team
answered on 01 Sep 2011, 09:28 AM
Hi Ulaga,

Thanks again for the reply. In case of mocking concrete members (static / final methods), the JM addin must be enabled and "Enable JustMock" must be grayed out. You also need to check if you are using a trial, it didn’t expired from the same menu.

Once everything is turned on and configured properly. You should not be having issues faking the Database layer.

Optionally you can send me a sample if you still having problems.

Kind Regards,
Mehfuz
the Telerik team

Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

Tags
JustMock Free Edition
Asked by
ulaga
Top achievements
Rank 1
Answers by
Ricky
Telerik team
ulaga
Top achievements
Rank 1
Share this question
or