0

Issue:

  • "Could not load file or assembly Razorlight...." during attempting to intaracting with CustomProject instance within the main solution

Prerequisites:

  • The main solution consumes custom project as nuget package
  • The custom project nuget package builded up as single dll (customProject.dll) with embedded references to dependent assemblies (etc. razorlight)
  • The custom project builded up as a single file due to includeReferencedProjects = true property from nugetpacksettings or nuspec configuration (not sure on 100 %)
  • Custom project nuget package has nuscpec configuration, to config output as single dll file
  • The custom project has dependency on 3-th party nuget packages with their dependencies (PackageA, PackageB .. etc.)
  • There no any other dlls in the main solution bin/Debug folder except customProject.dll after build

Intenstions: (Is it possible ?)

  • Manange the issue (Could not load file or assembly Razorlight). Thus have all nessacary dll in the MainSolution \bin folder in runtime (e.g razorlight.dll)
  • Not pollution the Main solution package.config & .csproj with a huge amount of unnessacary dependencies/ references from dependent packages (Razorlight, packageA, PackageB ... etc).
  • Wouldn't like to install Razorliaght or Itext7 nuget in the Main solution directly

enter image description here

AllmanTool
  • 1,384
  • 1
  • 16
  • 26
  • The main solution doesn't (usually) need to reference sub-dependent nugets, but they will still appear in your bin folder, as the customproject won't run without it. – Neil Mar 30 '22 at 20:05
  • There no any other dlls in the main solution bin/Debug folder except customProject.dll after build. It may happen due to includeReferencedProjects = true, but I'm not sure. So, do you insist that all dependent dll (e.g. razorlight.dll) should be appear on main solution /bin folder after build ? – AllmanTool Mar 30 '22 at 20:08
  • They should definitely appear in the main solution bin folder, otherwise how would the code run? (which is what you are seeing). – Neil Mar 30 '22 at 20:14
  • yes - so do I, but what is wrong then, where I can look into ? It's just blow my mind – AllmanTool Mar 30 '22 at 20:16

0 Answers0