urasandesu / Prig

Prig is a lightweight framework for test indirections in .NET Framework.
Other
117 stars 21 forks source link

Error load dependency #56

Closed inbar-tenengroup closed 8 years ago

inbar-tenengroup commented 8 years ago

Hello,

While trying to mock the methods InstallPrintQueue of the object PrintServer I'm getting the error: An exception of type 'System.IO.FileNotFoundException' occurred in TgPrinterManager.Tests.dll but was not handled in user code

Additional information: Could not load file or assembly 'System.Printing.v4.0.30319.v4.0.0.0.AMD64.Prig, Version=0.0.0.0, Culture=neutral, PublicKeyToken=f3c5adb85221ac4f' or one of its dependencies. The system cannot find the file specified.

Code

    public static void InstallPrintQueue(Exception exceptionToThrow = null)
        {
            PPrintServer.InstallPrintQueueStringStringStringArrayStringPrintPropertyDictionary().Body = (a, b, c, d, e, f) => ThrowOrReturnEmptyQueue(exceptionToThrow);
            PPrintServer.InstallPrintQueueStringStringStringArrayStringPrintQueueAttributes().Body = (a, b, c, d, e, f) => ThrowOrReturnEmptyQueue(exceptionToThrow);
            PPrintServer.InstallPrintQueueStringStringStringArrayStringPrintQueueAttributesPrintQueueStringPropertyInt32Int32().Body = (a, b, c, d, e, f, g, h, i) => ThrowOrReturnEmptyQueue(exceptionToThrow);
            PPrintServer.InstallPrintQueueStringStringStringArrayStringPrintQueueAttributesStringStringStringStringInt32Int32().Body = (a, b, c, d, e, f, g, h, i, j, k, l) => ThrowOrReturnEmptyQueue(exceptionToThrow);
        }

XML Generation command

$TargetReferencedAssembly.GetTypes() | ? { $_.Name -eq 'PrintServer' } | pfind -m 'InstallPrintQueue' | pget | clip

XML

System.Printing.v4.0.30319.v4.0.0.0.txt

urasandesu commented 8 years ago

Thank you for the reporting! I investigated it, and I found that it only reproduced in Visual Studio 2015 Update 1. Is your environment also same?

For your information, the issue was not been reproduced in Visual Studio 2013, and in Visual Studio 2015(Update 1 isn't applied), another problem was occurred. I think that this is difficult problem :sweat:

urasandesu commented 8 years ago

We report the progress as below. Each log is outputted when URASANDESU_CPPANONYM_LOGGING_SEVERITY environment variable is 0(See also Command Line Reference).

Visual Studio 2013(Expected behavior)

Loading System.Printing.v4.0.30319.v4.0.0.0.AMD64.Prig

2016/01/08 12:37:53.423809,DEBUG,00000x3a9c,12210,0x00001974,"Loading Module: System.Printing.v4.0.30319.v4.0.0.0.AMD64.Prig","Weaver.cpp",371,"long __cdecl CWeaverDetail::CWeaverImpl::ModuleLoadFinishedCore(unsigned __int64,long)=>Weaver.cpp,349"
2016/01/08 12:37:53.423809,DEBUG,00000x3a9c,12212,0x00001974,"        Candidate modules: ""C:\Users\Akira\Documents\Visual Studio 2013\Projects\ClassLibrary30\ClassLibrary30\bin\Debug\System.Printing.v4.0.30319.v4.0.0.0.AMD64.Prig.dll""","Weaver.cpp",391,"long __cdecl CWeaverDetail::CWeaverImpl::ModuleLoadFinishedCore(unsigned __int64,long)=>Weaver.cpp,349","if (!modName.empty())=>Weaver.cpp,376","if (!candidateIndDllPaths.empty())=>Weaver.cpp,384"
2016/01/08 12:37:53.423809,DEBUG,00000x3a9c,12213,0x00001974,"                Getting modifiable IMetaDataImport2...","C:\Users\Akira\Desktop\Prig\Swathe\Urasandesu.Swathe\Urasandesu/Swathe/Profiling/BaseClassPimpl/BaseAssemblyProfilerPimpl.hpp",113,"long __cdecl CWeaverDetail::CWeaverImpl::ModuleLoadFinishedCore(unsigned __int64,long)=>Weaver.cpp,349","if (!modName.empty())=>Weaver.cpp,376","if (!candidateIndDllPaths.empty())=>Weaver.cpp,384","class Urasandesu::Swathe::Metadata::BaseClass::BaseAssemblyGenerator<struct Urasandesu::Swathe::AutoGen::Metadata::DefaultClassApiHolder::DefaultAssemblyGeneratorApiHolder> *__cdecl Urasandesu::Swathe::Profiling::BaseClassPimpl::BaseAssemblyProfilerPimpl<struct Urasandesu::Swathe::AutoGen::Profiling::DefaultClassPimplApiHolder::DefaultAssemblyProfilerPimplApiHolder>::GetAssemblyGenerator(class Urasandesu::Swathe::Metadata::BaseClass::BaseMetadataDispenser<struct Urasandesu::Swathe::AutoGen::Metadata::DefaultClassApiHolder::DefaultMetadataDispenserApiHolder> *)=>C:\Users\Akira\Desktop\Prig\Swathe\Urasandesu.Swathe\Urasandesu/Swathe/Profiling/BaseClassPimpl/BaseAssemblyProfilerPimpl.hpp,98","if (!m_pAsmGen)=>C:\Users\Akira\Desktop\Prig\Swathe\Urasandesu.Swathe\Urasandesu/Swathe/Profiling/BaseClassPimpl/BaseAssemblyProfilerPimpl.hpp,105"
2016/01/08 12:37:53.424809,DEBUG,00000x3a9c,12214,0x00001974,"                ModuleID : 0x7FFA989B6CC0","C:\Users\Akira\Desktop\Prig\Swathe\Urasandesu.Swathe\Urasandesu/Swathe/Profiling/BaseClassPimpl/BaseAssemblyProfilerPimpl.hpp",114,"long __cdecl CWeaverDetail::CWeaverImpl::ModuleLoadFinishedCore(unsigned __int64,long)=>Weaver.cpp,349","if (!modName.empty())=>Weaver.cpp,376","if (!candidateIndDllPaths.empty())=>Weaver.cpp,384","class Urasandesu::Swathe::Metadata::BaseClass::BaseAssemblyGenerator<struct Urasandesu::Swathe::AutoGen::Metadata::DefaultClassApiHolder::DefaultAssemblyGeneratorApiHolder> *__cdecl Urasandesu::Swathe::Profiling::BaseClassPimpl::BaseAssemblyProfilerPimpl<struct Urasandesu::Swathe::AutoGen::Profiling::DefaultClassPimplApiHolder::DefaultAssemblyProfilerPimplApiHolder>::GetAssemblyGenerator(class Urasandesu::Swathe::Metadata::BaseClass::BaseMetadataDispenser<struct Urasandesu::Swathe::AutoGen::Metadata::DefaultClassApiHolder::DefaultMetadataDispenserApiHolder> *)=>C:\Users\Akira\Desktop\Prig\Swathe\Urasandesu.Swathe\Urasandesu/Swathe/Profiling/BaseClassPimpl/BaseAssemblyProfilerPimpl.hpp,98","if (!m_pAsmGen)=>C:\Users\Akira\Desktop\Prig\Swathe\Urasandesu.Swathe\Urasandesu/Swathe/Profiling/BaseClassPimpl/BaseAssemblyProfilerPimpl.hpp,105"
2016/01/08 12:37:53.430816,DEBUG,00000x3a9c,12215,0x00001974,"        Find detour module: C:\Users\Akira\Documents\Visual Studio 2013\Projects\ClassLibrary30\ClassLibrary30\bin\Debug\System.Printing.v4.0.30319.v4.0.0.0.AMD64.Prig.v4.0.30319.v0.0.0.0.AMD64.Prig.dll.","Weaver.cpp",401,"long __cdecl CWeaverDetail::CWeaverImpl::ModuleLoadFinishedCore(unsigned __int64,long)=>Weaver.cpp,349","if (!modName.empty())=>Weaver.cpp,376","if (!candidateIndDllPaths.empty())=>Weaver.cpp,384"
  1. Try to find System.Printing.v4.0.30319.v4.0.0.0.AMD64.Prig.v4.0.30319.v0.0.0.0.AMD64.Prig.dll.
  2. It doesn't exist. So, Prig does nothing and performs next action.

Loading System.Printing

2016/01/08 12:37:53.444826,DEBUG,00000x3a9c,12223,0x00001974,"Loading Module: System.Printing","Weaver.cpp",371,"long __cdecl CWeaverDetail::CWeaverImpl::ModuleLoadFinishedCore(unsigned __int64,long)=>Weaver.cpp,349"
2016/01/08 12:37:53.444826,DEBUG,00000x3a9c,12225,0x00001974,"        Candidate modules: ""C:\Users\Akira\Documents\Visual Studio 2013\Projects\ClassLibrary30\ClassLibrary30\bin\Debug\System.Printing.v4.0.30319.v4.0.0.0.AMD64.Prig.dll""","Weaver.cpp",391,"long __cdecl CWeaverDetail::CWeaverImpl::ModuleLoadFinishedCore(unsigned __int64,long)=>Weaver.cpp,349","if (!modName.empty())=>Weaver.cpp,376","if (!candidateIndDllPaths.empty())=>Weaver.cpp,384"
2016/01/08 12:37:53.444826,DEBUG,00000x3a9c,12226,0x00001974,"                Getting modifiable IMetaDataImport2...","C:\Users\Akira\Desktop\Prig\Swathe\Urasandesu.Swathe\Urasandesu/Swathe/Profiling/BaseClassPimpl/BaseAssemblyProfilerPimpl.hpp",113,"long __cdecl CWeaverDetail::CWeaverImpl::ModuleLoadFinishedCore(unsigned __int64,long)=>Weaver.cpp,349","if (!modName.empty())=>Weaver.cpp,376","if (!candidateIndDllPaths.empty())=>Weaver.cpp,384","class Urasandesu::Swathe::Metadata::BaseClass::BaseAssemblyGenerator<struct Urasandesu::Swathe::AutoGen::Metadata::DefaultClassApiHolder::DefaultAssemblyGeneratorApiHolder> *__cdecl Urasandesu::Swathe::Profiling::BaseClassPimpl::BaseAssemblyProfilerPimpl<struct Urasandesu::Swathe::AutoGen::Profiling::DefaultClassPimplApiHolder::DefaultAssemblyProfilerPimplApiHolder>::GetAssemblyGenerator(class Urasandesu::Swathe::Metadata::BaseClass::BaseMetadataDispenser<struct Urasandesu::Swathe::AutoGen::Metadata::DefaultClassApiHolder::DefaultMetadataDispenserApiHolder> *)=>C:\Users\Akira\Desktop\Prig\Swathe\Urasandesu.Swathe\Urasandesu/Swathe/Profiling/BaseClassPimpl/BaseAssemblyProfilerPimpl.hpp,98","if (!m_pAsmGen)=>C:\Users\Akira\Desktop\Prig\Swathe\Urasandesu.Swathe\Urasandesu/Swathe/Profiling/BaseClassPimpl/BaseAssemblyProfilerPimpl.hpp,105"
2016/01/08 12:37:53.444826,DEBUG,00000x3a9c,12227,0x00001974,"                ModuleID : 0x7FFA989195B8","C:\Users\Akira\Desktop\Prig\Swathe\Urasandesu.Swathe\Urasandesu/Swathe/Profiling/BaseClassPimpl/BaseAssemblyProfilerPimpl.hpp",114,"long __cdecl CWeaverDetail::CWeaverImpl::ModuleLoadFinishedCore(unsigned __int64,long)=>Weaver.cpp,349","if (!modName.empty())=>Weaver.cpp,376","if (!candidateIndDllPaths.empty())=>Weaver.cpp,384","class Urasandesu::Swathe::Metadata::BaseClass::BaseAssemblyGenerator<struct Urasandesu::Swathe::AutoGen::Metadata::DefaultClassApiHolder::DefaultAssemblyGeneratorApiHolder> *__cdecl Urasandesu::Swathe::Profiling::BaseClassPimpl::BaseAssemblyProfilerPimpl<struct Urasandesu::Swathe::AutoGen::Profiling::DefaultClassPimplApiHolder::DefaultAssemblyProfilerPimplApiHolder>::GetAssemblyGenerator(class Urasandesu::Swathe::Metadata::BaseClass::BaseMetadataDispenser<struct Urasandesu::Swathe::AutoGen::Metadata::DefaultClassApiHolder::DefaultMetadataDispenserApiHolder> *)=>C:\Users\Akira\Desktop\Prig\Swathe\Urasandesu.Swathe\Urasandesu/Swathe/Profiling/BaseClassPimpl/BaseAssemblyProfilerPimpl.hpp,98","if (!m_pAsmGen)=>C:\Users\Akira\Desktop\Prig\Swathe\Urasandesu.Swathe\Urasandesu/Swathe/Profiling/BaseClassPimpl/BaseAssemblyProfilerPimpl.hpp,105"
2016/01/08 12:37:53.452830,DEBUG,00000x3a9c,12228,0x00001974,"        Find detour module: C:\Users\Akira\Documents\Visual Studio 2013\Projects\ClassLibrary30\ClassLibrary30\bin\Debug\System.Printing.v4.0.30319.v4.0.0.0.AMD64.Prig.dll.","Weaver.cpp",401,"long __cdecl CWeaverDetail::CWeaverImpl::ModuleLoadFinishedCore(unsigned __int64,long)=>Weaver.cpp,349","if (!modName.empty())=>Weaver.cpp,376","if (!candidateIndDllPaths.empty())=>Weaver.cpp,384"
2016/01/08 12:37:53.453831,DEBUG,00000x3a9c,12229,0x00001974,"            Detour module: C:\Users\Akira\Documents\Visual Studio 2013\Projects\ClassLibrary30\ClassLibrary30\bin\Debug\System.Printing.v4.0.30319.v4.0.0.0.AMD64.Prig.dll is found. Start to modify the module.","Weaver.cpp",407,"long __cdecl CWeaverDetail::CWeaverImpl::ModuleLoadFinishedCore(unsigned __int64,long)=>Weaver.cpp,349","if (!modName.empty())=>Weaver.cpp,376","if (!candidateIndDllPaths.empty())=>Weaver.cpp,384","if (candidateIndDllPaths.find(targetIndDllPath) != candidateIndDllPaths.end())=>Weaver.cpp,406"
  1. Try to find System.Printing.v4.0.30319.v4.0.0.0.AMD64.Prig.dll.
  2. It exists. So, Prig performs procedures to detour.

app_20160108_VS2013.zip

Visual Studio 2015 Update 1(This issue's behavior)

Loading System.Printing.v4.0.30319.v4.0.0.0.AMD64.Prig

2016/01/08 02:10:30.121054,DEBUG,00000x238c,17791,0x00002338,"Loading Module: System.Printing.v4.0.30319.v4.0.0.0.AMD64.Prig","Weaver.cpp",371,"long __cdecl CWeaverDetail::CWeaverImpl::ModuleLoadFinishedCore(unsigned __int64,long)=>Weaver.cpp,349"
2016/01/08 02:10:30.121054,DEBUG,00000x238c,17793,0x00002338,"        Candidate modules: ""C:\Users\Akira\Documents\Visual Studio 2015\Projects\ClassLibrary1\ClassLibrary1\bin\Debug\System.Printing.v4.0.30319.v4.0.0.0.AMD64.Prig.dll""","Weaver.cpp",391,"long __cdecl CWeaverDetail::CWeaverImpl::ModuleLoadFinishedCore(unsigned __int64,long)=>Weaver.cpp,349","if (!modName.empty())=>Weaver.cpp,376","if (!candidateIndDllPaths.empty())=>Weaver.cpp,384"
2016/01/08 02:10:30.121054,DEBUG,00000x238c,17794,0x00002338,"                Getting modifiable IMetaDataImport2...","C:\Users\Akira\Desktop\Prig\Swathe\Urasandesu.Swathe\Urasandesu/Swathe/Profiling/BaseClassPimpl/BaseAssemblyProfilerPimpl.hpp",113,"long __cdecl CWeaverDetail::CWeaverImpl::ModuleLoadFinishedCore(unsigned __int64,long)=>Weaver.cpp,349","if (!modName.empty())=>Weaver.cpp,376","if (!candidateIndDllPaths.empty())=>Weaver.cpp,384","class Urasandesu::Swathe::Metadata::BaseClass::BaseAssemblyGenerator<struct Urasandesu::Swathe::AutoGen::Metadata::DefaultClassApiHolder::DefaultAssemblyGeneratorApiHolder> *__cdecl Urasandesu::Swathe::Profiling::BaseClassPimpl::BaseAssemblyProfilerPimpl<struct Urasandesu::Swathe::AutoGen::Profiling::DefaultClassPimplApiHolder::DefaultAssemblyProfilerPimplApiHolder>::GetAssemblyGenerator(class Urasandesu::Swathe::Metadata::BaseClass::BaseMetadataDispenser<struct Urasandesu::Swathe::AutoGen::Metadata::DefaultClassApiHolder::DefaultMetadataDispenserApiHolder> *)=>C:\Users\Akira\Desktop\Prig\Swathe\Urasandesu.Swathe\Urasandesu/Swathe/Profiling/BaseClassPimpl/BaseAssemblyProfilerPimpl.hpp,98","if (!m_pAsmGen)=>C:\Users\Akira\Desktop\Prig\Swathe\Urasandesu.Swathe\Urasandesu/Swathe/Profiling/BaseClassPimpl/BaseAssemblyProfilerPimpl.hpp,105"
2016/01/08 02:10:30.121054,DEBUG,00000x238c,17795,0x00002338,"                ModuleID : 0x7FFE18024F38","C:\Users\Akira\Desktop\Prig\Swathe\Urasandesu.Swathe\Urasandesu/Swathe/Profiling/BaseClassPimpl/BaseAssemblyProfilerPimpl.hpp",114,"long __cdecl CWeaverDetail::CWeaverImpl::ModuleLoadFinishedCore(unsigned __int64,long)=>Weaver.cpp,349","if (!modName.empty())=>Weaver.cpp,376","if (!candidateIndDllPaths.empty())=>Weaver.cpp,384","class Urasandesu::Swathe::Metadata::BaseClass::BaseAssemblyGenerator<struct Urasandesu::Swathe::AutoGen::Metadata::DefaultClassApiHolder::DefaultAssemblyGeneratorApiHolder> *__cdecl Urasandesu::Swathe::Profiling::BaseClassPimpl::BaseAssemblyProfilerPimpl<struct Urasandesu::Swathe::AutoGen::Profiling::DefaultClassPimplApiHolder::DefaultAssemblyProfilerPimplApiHolder>::GetAssemblyGenerator(class Urasandesu::Swathe::Metadata::BaseClass::BaseMetadataDispenser<struct Urasandesu::Swathe::AutoGen::Metadata::DefaultClassApiHolder::DefaultMetadataDispenserApiHolder> *)=>C:\Users\Akira\Desktop\Prig\Swathe\Urasandesu.Swathe\Urasandesu/Swathe/Profiling/BaseClassPimpl/BaseAssemblyProfilerPimpl.hpp,98","if (!m_pAsmGen)=>C:\Users\Akira\Desktop\Prig\Swathe\Urasandesu.Swathe\Urasandesu/Swathe/Profiling/BaseClassPimpl/BaseAssemblyProfilerPimpl.hpp,105"
2016/01/08 02:10:30.183555,ERROR,00000x238c,17797,0x00002338,"        C:\Users\Akira\Desktop\Prig\Swathe\Urasandesu.Swathe\Urasandesu/Swathe/Metadata/AssemblyResolver.h(165): Throw in function class boost::filesystem::path __cdecl Urasandesu::Swathe::Metadata::AssemblyResolverDetail::AssemblyResolver<class Urasandesu::Swathe::Fusion::BaseClass::BaseFusionInfo<struct Urasandesu::Swathe::AutoGen::Fusion::DefaultClassApiHolder::DefaultFusionInfoApiHolder> >::ResolveAssemblyPathBySearchDirectory(const class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > &) const
Dynamic exception type: class boost::exception_detail::clone_impl<class Urasandesu::CppAnonym::CppAnonymArgumentException>
std::exception::what: The designated assembly is not found: System.Printing.v4.0.30319.v4.0.0.0.AMD64.Prig
    Considering ""C:\Windows\system32""...

[struct Urasandesu::CppAnonym::tag_stack_trace * __ptr64] = at <Unknown Symbol> in C:\ProgramData\chocolatey\lib\Prig\tools\x64\Urasandesu.Prig.dll
at ?save_object_data@?$oserializer@Vxml_woarchive@archive@boost@@Vpath@filesystem@3@@detail@archive@boost@@UEBAXAEAVbasic_oarchive@234@PEBX@Z in C:\ProgramData\chocolatey\lib\Prig\tools\x64\Urasandesu.Prig.dll
at ?save_object_data@?$oserializer@Vxml_woarchive@archive@boost@@Vpath@filesystem@3@@detail@archive@boost@@UEBAXAEAVbasic_oarchive@234@PEBX@Z in C:\ProgramData\chocolatey\lib\Prig\tools\x64\Urasandesu.Prig.dll
at ?save_object_data@?$oserializer@Vxml_woarchive@archive@boost@@Vpath@filesystem@3@@detail@archive@boost@@UEBAXAEAVbasic_oarchive@234@PEBX@Z in C:\ProgramData\chocolatey\lib\Prig\tools\x64\Urasandesu.Prig.dll
at ?save_object_data@?$oserializer@Vxml_woarchive@archive@boost@@Vpath@filesystem@3@@detail@archive@boost@@UEBAXAEAVbasic_oarchive@234@PEBX@Z in C:\ProgramData\chocolatey\lib\Prig\tools\x64\Urasandesu.Prig.dll
at ?save_object_data@?$oserializer@Vxml_woarchive@archive@boost@@Vpath@filesystem@3@@detail@archive@boost@@UEBAXAEAVbasic_oarchive@234@PEBX@Z in C:\ProgramData\chocolatey\lib\Prig\tools\x64\Urasandesu.Prig.dll
at ?save_object_data@?$oserializer@Vxml_woarchive@archive@boost@@Vpath@filesystem@3@@detail@archive@boost@@UEBAXAEAVbasic_oarchive@234@PEBX@Z in C:\ProgramData\chocolatey\lib\Prig\tools\x64\Urasandesu.Prig.dll
at ?save_object_data@?$oserializer@Vxml_woarchive@archive@boost@@Vpath@filesystem@3@@detail@archive@boost@@UEBAXAEAVbasic_oarchive@234@PEBX@Z in C:\ProgramData\chocolatey\lib\Prig\tools\x64\Urasandesu.Prig.dll
at ?save_object_data@?$oserializer@Vxml_woarchive@archive@boost@@Vpath@filesystem@3@@detail@archive@boost@@UEBAXAEAVbasic_oarchive@234@PEBX@Z in C:\ProgramData\chocolatey\lib\Prig\tools\x64\Urasandesu.Prig.dll
at ?save_object_data@?$oserializer@Vxml_woarchive@archive@boost@@Vpath@filesystem@3@@detail@archive@boost@@UEBAXAEAVbasic_oarchive@234@PEBX@Z in C:\ProgramData\chocolatey\lib\Prig\tools\x64\Urasandesu.Prig.dll
at ?save_object_data@?$oserializer@Vxml_woarchive@archive@boost@@Vpath@filesystem@3@@detail@archive@boost@@UEBAXAEAVbasic_oarchive@234@PEBX@Z in C:\ProgramData\chocolatey\lib\Prig\tools\x64\Urasandesu.Prig.dll
at ?save_object_data@?$oserializer@Vxml_woarchive@archive@boost@@Vpath@filesystem@3@@detail@archive@boost@@UEBAXAEAVbasic_oarchive@234@PEBX@Z in C:\ProgramData\chocolatey\lib\Prig\tools\x64\Urasandesu.Prig.dll
at ?save_object_data@?$oserializer@Vxml_woarchive@archive@boost@@Vpath@filesystem@3@@detail@archive@boost@@UEBAXAEAVbasic_oarchive@234@PEBX@Z in C:\ProgramData\chocolatey\lib\Prig\tools\x64\Urasandesu.Prig.dll
at ?save_object_data@?$oserializer@Vxml_woarchive@archive@boost@@Vpath@filesystem@3@@detail@archive@boost@@UEBAXAEAVbasic_oarchive@234@PEBX@Z in C:\ProgramData\chocolatey\lib\Prig\tools\x64\Urasandesu.Prig.dll
at TranslateSecurityAttributes in C:\Windows\Microsoft.NET\Framework64\v4.0.30319\clr.dll
at GetHistoryFileDirectory in C:\Windows\Microsoft.NET\Framework64\v4.0.30319\clr.dll
at StrongNameTokenFromPublicKey in C:\Windows\Microsoft.NET\Framework64\v4.0.30319\clr.dll
at StrongNameTokenFromPublicKey in C:\Windows\Microsoft.NET\Framework64\v4.0.30319\clr.dll
at StrongNameTokenFromPublicKey in C:\Windows\Microsoft.NET\Framework64\v4.0.30319\clr.dll
at StrongNameTokenFromPublicKey in C:\Windows\Microsoft.NET\Framework64\v4.0.30319\clr.dll
at GetMetaDataInternalInterface in C:\Windows\Microsoft.NET\Framework64\v4.0.30319\clr.dll
at GetMetaDataInternalInterface in C:\Windows\Microsoft.NET\Framework64\v4.0.30319\clr.dll
at LogHelp_LogAssert in C:\Windows\Microsoft.NET\Framework64\v4.0.30319\clr.dll
at _CorExeMain in C:\Windows\Microsoft.NET\Framework64\v4.0.30319\clr.dll
at _CorExeMain in C:\Windows\Microsoft.NET\Framework64\v4.0.30319\clr.dll
at <Unknown Symbol> in C:\Windows\Microsoft.NET\Framework64\v4.0.30319\clrjit.dll
at <Unknown Symbol> in C:\Windows\Microsoft.NET\Framework64\v4.0.30319\clrjit.dll
at <Unknown Symbol> in C:\Windows\Microsoft.NET\Framework64\v4.0.30319\clrjit.dll
at <Unknown Symbol> in C:\Windows\Microsoft.NET\Framework64\v4.0.30319\clrjit.dll
at <Unknown Symbol> in C:\Windows\Microsoft.NET\Framework64\v4.0.30319\clrjit.dll
at <Unknown Symbol> in C:\Windows\Microsoft.NET\Framework64\v4.0.30319\clrjit.dll
at <Unknown Symbol> in C:\Windows\Microsoft.NET\Framework64\v4.0.30319\clrjit.dll
at <Unknown Symbol> in C:\Windows\Microsoft.NET\Framework64\v4.0.30319\clrjit.dll
at LogHelp_LogAssert in C:\Windows\Microsoft.NET\Framework64\v4.0.30319\clr.dll
at LogHelp_LogAssert in C:\Windows\Microsoft.NET\Framework64\v4.0.30319\clr.dll
at LogHelp_LogAssert in C:\Windows\Microsoft.NET\Framework64\v4.0.30319\clr.dll
at LogHelp_LogAssert in C:\Windows\Microsoft.NET\Framework64\v4.0.30319\clr.dll
at LogHelp_LogAssert in C:\Windows\Microsoft.NET\Framework64\v4.0.30319\clr.dll
at LogHelp_LogAssert in C:\Windows\Microsoft.NET\Framework64\v4.0.30319\clr.dll
at DllCanUnloadNowInternal in C:\Windows\Microsoft.NET\Framework64\v4.0.30319\clr.dll
at <Unknown Symbol> in C:\Windows\Microsoft.NET\Framework64\v4.0.30319\clr.dll
at <Unknown Symbol> in <Unknown Module>
at <Unknown Symbol> in <Unknown Module>
at <Unknown Symbol> in <Unknown Module>

","C:\Users\Akira\Desktop\Prig\Swathe\Urasandesu.Swathe\Urasandesu/Swathe/Profiling/ICorProfilerCallbackImpl.h",265,"long __cdecl CWeaverDetail::CWeaverImpl::ModuleLoadFinishedCore(unsigned __int64,long)=>Weaver.cpp,349","if (!modName.empty())=>Weaver.cpp,376","if (!candidateIndDllPaths.empty())=>Weaver.cpp,384"
  1. Try to get the architecture of System.Printing.v4.0.30319.v4.0.0.0.AMD64.Prig.dll. However, Prig searches C:\Windows\system32 for it.
  2. Rightly, it cannot. So, Prig throws an exception.

Loading System.Printing

  1. For some reason, Prig doesn't load System.Printing. It seems that this is cause of occurring System.IO.FileNotFoundException.

app_20160108_VS2015UP1.zip

Visual Studio 2015(Another problem)

Loading System.Printing.v4.0.30319.v4.0.0.0.AMD64.Prig

2016/01/08 04:52:23.552600,DEBUG,000000xa78,12292,0x00000b80,"Loading Module: System.Printing.v4.0.30319.v4.0.0.0.AMD64.Prig","Weaver.cpp",371,"long __cdecl CWeaverDetail::CWeaverImpl::ModuleLoadFinishedCore(unsigned __int64,long)=>Weaver.cpp,349"
2016/01/08 04:52:23.552600,DEBUG,000000xa78,12294,0x00000b80,"        Candidate modules: ""c:\users\akira\documents\visual studio 2015\Projects\ClassLibrary1\ClassLibrary1\bin\Debug\System.Printing.v4.0.30319.v4.0.0.0.AMD64.Prig.dll""","Weaver.cpp",391,"long __cdecl CWeaverDetail::CWeaverImpl::ModuleLoadFinishedCore(unsigned __int64,long)=>Weaver.cpp,349","if (!modName.empty())=>Weaver.cpp,376","if (!candidateIndDllPaths.empty())=>Weaver.cpp,384"
2016/01/08 04:52:23.552600,DEBUG,000000xa78,12295,0x00000b80,"                Getting modifiable IMetaDataImport2...","C:\Users\Akira\Desktop\Prig\Swathe\Urasandesu.Swathe\Urasandesu/Swathe/Profiling/BaseClassPimpl/BaseAssemblyProfilerPimpl.hpp",113,"long __cdecl CWeaverDetail::CWeaverImpl::ModuleLoadFinishedCore(unsigned __int64,long)=>Weaver.cpp,349","if (!modName.empty())=>Weaver.cpp,376","if (!candidateIndDllPaths.empty())=>Weaver.cpp,384","class Urasandesu::Swathe::Metadata::BaseClass::BaseAssemblyGenerator<struct Urasandesu::Swathe::AutoGen::Metadata::DefaultClassApiHolder::DefaultAssemblyGeneratorApiHolder> *__cdecl Urasandesu::Swathe::Profiling::BaseClassPimpl::BaseAssemblyProfilerPimpl<struct Urasandesu::Swathe::AutoGen::Profiling::DefaultClassPimplApiHolder::DefaultAssemblyProfilerPimplApiHolder>::GetAssemblyGenerator(class Urasandesu::Swathe::Metadata::BaseClass::BaseMetadataDispenser<struct Urasandesu::Swathe::AutoGen::Metadata::DefaultClassApiHolder::DefaultMetadataDispenserApiHolder> *)=>C:\Users\Akira\Desktop\Prig\Swathe\Urasandesu.Swathe\Urasandesu/Swathe/Profiling/BaseClassPimpl/BaseAssemblyProfilerPimpl.hpp,98","if (!m_pAsmGen)=>C:\Users\Akira\Desktop\Prig\Swathe\Urasandesu.Swathe\Urasandesu/Swathe/Profiling/BaseClassPimpl/BaseAssemblyProfilerPimpl.hpp,105"
2016/01/08 04:52:23.552600,DEBUG,000000xa78,12296,0x00000b80,"                ModuleID : 0x7FFDF9EAD378","C:\Users\Akira\Desktop\Prig\Swathe\Urasandesu.Swathe\Urasandesu/Swathe/Profiling/BaseClassPimpl/BaseAssemblyProfilerPimpl.hpp",114,"long __cdecl CWeaverDetail::CWeaverImpl::ModuleLoadFinishedCore(unsigned __int64,long)=>Weaver.cpp,349","if (!modName.empty())=>Weaver.cpp,376","if (!candidateIndDllPaths.empty())=>Weaver.cpp,384","class Urasandesu::Swathe::Metadata::BaseClass::BaseAssemblyGenerator<struct Urasandesu::Swathe::AutoGen::Metadata::DefaultClassApiHolder::DefaultAssemblyGeneratorApiHolder> *__cdecl Urasandesu::Swathe::Profiling::BaseClassPimpl::BaseAssemblyProfilerPimpl<struct Urasandesu::Swathe::AutoGen::Profiling::DefaultClassPimplApiHolder::DefaultAssemblyProfilerPimplApiHolder>::GetAssemblyGenerator(class Urasandesu::Swathe::Metadata::BaseClass::BaseMetadataDispenser<struct Urasandesu::Swathe::AutoGen::Metadata::DefaultClassApiHolder::DefaultMetadataDispenserApiHolder> *)=>C:\Users\Akira\Desktop\Prig\Swathe\Urasandesu.Swathe\Urasandesu/Swathe/Profiling/BaseClassPimpl/BaseAssemblyProfilerPimpl.hpp,98","if (!m_pAsmGen)=>C:\Users\Akira\Desktop\Prig\Swathe\Urasandesu.Swathe\Urasandesu/Swathe/Profiling/BaseClassPimpl/BaseAssemblyProfilerPimpl.hpp,105"
2016/01/08 04:52:23.555601,DEBUG,000000xa78,12297,0x00000b80,"        Find detour module: c:\users\akira\documents\visual studio 2015\Projects\ClassLibrary1\ClassLibrary1\bin\Debug\System.Printing.v4.0.30319.v4.0.0.0.AMD64.Prig.v4.0.30319.v0.0.0.0.AMD64.Prig.dll.","Weaver.cpp",401,"long __cdecl CWeaverDetail::CWeaverImpl::ModuleLoadFinishedCore(unsigned __int64,long)=>Weaver.cpp,349","if (!modName.empty())=>Weaver.cpp,376","if (!candidateIndDllPaths.empty())=>Weaver.cpp,384"
  1. Try to find System.Printing.v4.0.30319.v4.0.0.0.AMD64.Prig.v4.0.30319.v0.0.0.0.AMD64.Prig.dll.
  2. It doesn't exist. So, Prig does nothing and performs next action.

=> This behavior is same as Visual Studio 2013.

Loading System.Printing

2016/01/08 04:52:23.558602,DEBUG,000000xa78,12305,0x00000b80,"Loading Module: System.Printing","Weaver.cpp",371,"long __cdecl CWeaverDetail::CWeaverImpl::ModuleLoadFinishedCore(unsigned __int64,long)=>Weaver.cpp,349"
2016/01/08 04:52:23.558602,DEBUG,000000xa78,12307,0x00000b80,"        Candidate modules: ""c:\users\akira\documents\visual studio 2015\Projects\ClassLibrary1\ClassLibrary1\bin\Debug\System.Printing.v4.0.30319.v4.0.0.0.AMD64.Prig.dll""","Weaver.cpp",391,"long __cdecl CWeaverDetail::CWeaverImpl::ModuleLoadFinishedCore(unsigned __int64,long)=>Weaver.cpp,349","if (!modName.empty())=>Weaver.cpp,376","if (!candidateIndDllPaths.empty())=>Weaver.cpp,384"
2016/01/08 04:52:23.558602,DEBUG,000000xa78,12308,0x00000b80,"                Getting modifiable IMetaDataImport2...","C:\Users\Akira\Desktop\Prig\Swathe\Urasandesu.Swathe\Urasandesu/Swathe/Profiling/BaseClassPimpl/BaseAssemblyProfilerPimpl.hpp",113,"long __cdecl CWeaverDetail::CWeaverImpl::ModuleLoadFinishedCore(unsigned __int64,long)=>Weaver.cpp,349","if (!modName.empty())=>Weaver.cpp,376","if (!candidateIndDllPaths.empty())=>Weaver.cpp,384","class Urasandesu::Swathe::Metadata::BaseClass::BaseAssemblyGenerator<struct Urasandesu::Swathe::AutoGen::Metadata::DefaultClassApiHolder::DefaultAssemblyGeneratorApiHolder> *__cdecl Urasandesu::Swathe::Profiling::BaseClassPimpl::BaseAssemblyProfilerPimpl<struct Urasandesu::Swathe::AutoGen::Profiling::DefaultClassPimplApiHolder::DefaultAssemblyProfilerPimplApiHolder>::GetAssemblyGenerator(class Urasandesu::Swathe::Metadata::BaseClass::BaseMetadataDispenser<struct Urasandesu::Swathe::AutoGen::Metadata::DefaultClassApiHolder::DefaultMetadataDispenserApiHolder> *)=>C:\Users\Akira\Desktop\Prig\Swathe\Urasandesu.Swathe\Urasandesu/Swathe/Profiling/BaseClassPimpl/BaseAssemblyProfilerPimpl.hpp,98","if (!m_pAsmGen)=>C:\Users\Akira\Desktop\Prig\Swathe\Urasandesu.Swathe\Urasandesu/Swathe/Profiling/BaseClassPimpl/BaseAssemblyProfilerPimpl.hpp,105"
2016/01/08 04:52:23.558602,DEBUG,000000xa78,12309,0x00000b80,"                ModuleID : 0x7FFDF9ED1F78","C:\Users\Akira\Desktop\Prig\Swathe\Urasandesu.Swathe\Urasandesu/Swathe/Profiling/BaseClassPimpl/BaseAssemblyProfilerPimpl.hpp",114,"long __cdecl CWeaverDetail::CWeaverImpl::ModuleLoadFinishedCore(unsigned __int64,long)=>Weaver.cpp,349","if (!modName.empty())=>Weaver.cpp,376","if (!candidateIndDllPaths.empty())=>Weaver.cpp,384","class Urasandesu::Swathe::Metadata::BaseClass::BaseAssemblyGenerator<struct Urasandesu::Swathe::AutoGen::Metadata::DefaultClassApiHolder::DefaultAssemblyGeneratorApiHolder> *__cdecl Urasandesu::Swathe::Profiling::BaseClassPimpl::BaseAssemblyProfilerPimpl<struct Urasandesu::Swathe::AutoGen::Profiling::DefaultClassPimplApiHolder::DefaultAssemblyProfilerPimplApiHolder>::GetAssemblyGenerator(class Urasandesu::Swathe::Metadata::BaseClass::BaseMetadataDispenser<struct Urasandesu::Swathe::AutoGen::Metadata::DefaultClassApiHolder::DefaultMetadataDispenserApiHolder> *)=>C:\Users\Akira\Desktop\Prig\Swathe\Urasandesu.Swathe\Urasandesu/Swathe/Profiling/BaseClassPimpl/BaseAssemblyProfilerPimpl.hpp,98","if (!m_pAsmGen)=>C:\Users\Akira\Desktop\Prig\Swathe\Urasandesu.Swathe\Urasandesu/Swathe/Profiling/BaseClassPimpl/BaseAssemblyProfilerPimpl.hpp,105"
2016/01/08 04:52:23.562601,DEBUG,000000xa78,12310,0x00000b80,"        Find detour module: c:\users\akira\documents\visual studio 2015\Projects\ClassLibrary1\ClassLibrary1\bin\Debug\System.Printing.v4.0.30319.v4.0.0.0.x86.Prig.dll.","Weaver.cpp",401,"long __cdecl CWeaverDetail::CWeaverImpl::ModuleLoadFinishedCore(unsigned __int64,long)=>Weaver.cpp,349","if (!modName.empty())=>Weaver.cpp,376","if (!candidateIndDllPaths.empty())=>Weaver.cpp,384"
  1. Try to find System.Printing.v4.0.30319.v4.0.0.0.x86.Prig.dll.
  2. It doesn't exist. So, Prig does nothing and performs next action.

=> ??? Why x86 assembly is loaded to x64 process?

app_20160108_VS2015.zip

inbar-tenengroup commented 8 years ago

My environment is VS2013 Update 5

inbar-tenengroup commented 8 years ago

I found the solution for the issue. I had to set the default processor architecture to x64 through Test => Test settings => Default Processor Architecture.

urasandesu commented 8 years ago

I'm glad to hear that :laughing:

By the way, I found that the strange behavior in Visual Studio 2015 or later is really bug. I'm going to manage it as another issue, because your problem has been resolved.