Как добавить ссылку на динамически созданную сборку, которая была создана с помощью rosyln compilrt. После сборки файл создается в файловой системе.
string path = Path.Combine(tempDir, assemblyFileName);
var pdbFilePath = Path.Combine(tempDir, Path.GetFileNameWithoutExtension(assemblyFileName) + ".pdb");
emitResult = compilation.Emit(path, pdbFilePath);
При повторном запуске приложения возникают исключения.
Could not load file or assembly 'RunTimeRules.XRefRule' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
System.IO.FileLoadException: Could not load file or assembly 'Jpmc.Cib.Msr.RuleEngine.RunTimeRules.XRefRule' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
=== Pre-bind state information ===
LOG: DisplayName = Jpmc.Cib.Msr.RuleEngine.RunTimeRules.XRefRule
(Partial)
WRN: Partial binding information was supplied for an assembly:
WRN: Assembly Name: Jpmc.Cib.Msr.RuleEngine.RunTimeRules.XRefRule | Domain ID: 2
WRN: A partial bind occurs when only part of the assembly display name is provided.
WRN: This might result in the binder loading an incorrect assembly.
WRN: It is recommended to provide a fully specified textual identity for the assembly,
WRN: that consists of the simple name, version, culture, and public key token.
WRN: See whitepaper http://go.microsoft.com/fwlink/?LinkId=109270 for more information and common solutions to this issue.
LOG: Appbase = file:///C:/Projects/RE/Jpmc.Cib.Msr.RuleEngine/
LOG: Initial PrivatePath = C:\Projects\RE\Jpmc.Cib.Msr.RuleEngine\bin
Calling assembly : (Unknown).
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: C:\Projects\RE\Jpmc.Cib.Msr.RuleEngine\web.config
LOG: Using host configuration file: H:\IISExpress\config\aspnet.config
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).
LOG: Attempting download of new URL file:///C:/Users/I705472/AppData/Local/Temp/Temporary ASP.NET Files/vs/e110b058/8e2e9773/Jpmc.Cib.Msr.RuleEngine.RunTimeRules.XRefRule.DLL.
LOG: Attempting download of new URL file:///C:/Users/I705472/AppData/Local/Temp/Temporary ASP.NET Files/vs/e110b058/8e2e9773/Jpmc.Cib.Msr.RuleEngine.RunTimeRules.XRefRule/Jpmc.Cib.Msr.RuleEngine.RunTimeRules.XRefRule.DLL.
LOG: Attempting download of new URL file:///C:/Projects/RE/Jpmc.Cib.Msr.RuleEngine/bin/Jpmc.Cib.Msr.RuleEngine.RunTimeRules.XRefRule.DLL.
WRN: Comparing the assembly name resulted in the mismatch: NAME
ERR: Failed to complete setup of assembly (hr = 0x80131040). Probing terminated.
Эта сборка была динамически сгенерированной сборкой. Нужно ли включать в качестве части какой-либо одной существующей ссылки на проект? Поскольку на него не ссылаются нигде, кроме его части папки bin, поэтому он выдает исключение