urasandesu / Prig

Prig is a lightweight framework for test indirections in .NET Framework.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Build is failing after adding Prig to Project and adding a stub

MichaelSafro opened this issue · comments

Hi all,

This is what I get when trying to compile. Not sure why it is happening, but suggestions are appreciated.

Regards,

Mike

error MSB3073: The command "cmd /c " "%VS140COMNTOOLS%VsDevCmd.bat" & %windir%\SysNative\WindowsPowerShell\v1.0\powershell.exe -ExecutionPolicy Bypass -NoLogo -NoProfile -File "%URASANDESU_PRIG_PACKAGE_FOLDER%\tools\Invoke-PilotStubber.ps1" -ReferenceFrom "@('%URASANDESU_PRIG_PACKAGE_FOLDER%\lib\Urasandesu.NAnonym.dll','%URASANDESU_PRIG_PACKAGE_FOLDER%\lib\Urasandesu.Prig.Framework.dll')" -AssemblyFrom "C:\Windows\Microsoft.Net\assembly\GAC_64\mscorlib\v4.0_4.0.0.0__b77a5c561934e089\mscorlib.dll" -TargetFrameworkVersion v4.6 -KeyFile "%URASANDESU_PRIG_PACKAGE_FOLDER%\tools\Urasandesu.Prig.snk" -OutputPath "D:\XXX-GIT\Source\XXX.DDD.Dal.Test\bin\Debug." -Settings "D:\XXX-GIT\Source\XXX.DDD.Dal.Test\mscorlib.v4.0.30319.v4.0.0.0.prig" -BuildTarget BeforeBuild "" exited with code -1.

Actually noticed, that this is happening, when I am adding a Stub Setting, referencing a method that I am trying to test.. When I try to build using standard stub it seems to build fine. Any idea?

Thank you for the reporting!

Actually noticed, that this is happening, when I am adding a Stub Setting, referencing a method that I am trying to test.. When I try to build using standard stub it seems to build fine.

Could you tell me your Stub Settings File contents? When I consider the error message, it will be located at D:\RMS-GIT\Source\Pason.Rms.Dal.Test\mscorlib.v4.0.30319.v4.0.0.0.prig.

You might have a mistake to configure the Stub Settings File because you say that standard Indirection Stub Setting can be built. For example, you wanted to add the stub for Process.GetCurrentProcess, so you wrote the setting into mscorlib.v4.0.30319.v4.0.0.0.prig. However, this case cannot build. Because Indirection Stub Setting can only write into the Stub Settings File that belongs to the assembly. In this case, you have to write the setting into System.v4.0.30319.v4.0.0.0.prig.

Ah, I see... Thank you very much Akira! It might be exactly the case, because I was indeed modifying mscorlib.v4.0.30319.v4.0.0.0.prig. I will have another look and let you know if the fix I plan trying worked out.

This looks like there have been no problems. I will close this issue. If you still have another problem, please reopen.