c#-显式的LoaderException(无法加载一个或多个请求的类型)

所以我正在使用基于插件的Intranet。我写了一个新的插件,现在想部署。该插件使用两个.dll参考(JenkinsClient(用于模型)和JenkinsClientApi(帮助器方法..))。 我都在VS 2019中将它们引用到了插件项目,主项目和intranet.PDK项目。 PDK项目包含一个PluginLoader类,该类将加载所有插件。

我们的文件夹结构:

Intranet.csproj

插件

  • “别名” .csproj

图书馆

  • intranet.pdk.csproj

我尝试使用“ local-copy:true”属性,并检查了版本是否正确。我尚未检查的内容例如是Intranet项目和JenkinsClient项目中的Newtonsoft.Json版本。这可能是个问题吗?

  <ItemGroup>
    <Reference Include="JenkinsClient">
      <HintPath>..\..\..\..\JenkinsClient\JenkinsClient\bin\Debug\JenkinsClient.dll</HintPath>
    </Reference>
    <Reference Include="JenkinsClientApi">
      <HintPath>..\..\..\..\JenkinsClient\JenkinClientApi\JenkinsClientApi\bin\Debug\netstandard2.0\JenkinsClientApi.dll</HintPath>
      <Private>true</Private>
    </Reference>
  </ItemGroup>

我们自己进行发布。重要的部分如下所示:


//publishes witout .net core runtime store (includes all asp.net core libraries) and uses precompiled views
ExecutePublish($"publish --no-restore /p:MvcRazorCompileonPublish=true /p:PublishWithAspNetCoretargetManifest=false -c Release -o \"{_settings.OutPath}\" \"{Path.Combine(_settings.SourcePath,"src","FutureNet")}\"");
//publishes witout precompiled views (adds views and refs to the output)
ExecutePublish($"publish --no-restore /p:MvcRazorCompileonPublish=false -c Release -o \"{_settings.OutPath}\" \"{Path.Combine(_settings.SourcePath,"FutureNet")}\"");

我只会收到类似以下的错误消息: “无法加载文件或程序集'JenkinsClient,版本= 1.0.0.0,文化=中性,PublicKeyToken =空”。

我不明白的是,错误msg中的版本和文化是正确的。

有人可以帮助我吗?我对引用的引用正确吗?

petar29 回答:c#-显式的LoaderException(无法加载一个或多个请求的类型)

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/3145005.html

大家都在问