Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/314.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/visual-studio/7.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# ClickOnce静默安装程序不';无法识别通过NuGet包引用的库_C#_Visual Studio_Clickonce_Silent Installer_Valueinjecter - Fatal编程技术网

C# ClickOnce静默安装程序不';无法识别通过NuGet包引用的库

C# ClickOnce静默安装程序不';无法识别通过NuGet包引用的库,c#,visual-studio,clickonce,silent-installer,valueinjecter,C#,Visual Studio,Clickonce,Silent Installer,Valueinjecter,我在Visual Studio 2015下设置了C#winforms项目。在同一解决方案下,我还有3个不同的windows服务项目。 我使用Omu.valueinjector将参数自动映射到类 我已经添加了一个安装程序项目,它基本上是在内部使用Click Once,并将所有依赖项添加到其中 我还使用MVP模式实现了该项目的UI安装。 和单独的类来处理静默安装程序。请参见下面的代码示例 早些时候,当我运行静默安装程序时,我遇到了与NLog dll相关的错误,因此我通过nuget packager解

我在Visual Studio 2015下设置了C#winforms项目。在同一解决方案下,我还有3个不同的windows服务项目。 我使用Omu.valueinjector将参数自动映射到类

我已经添加了一个安装程序项目,它基本上是在内部使用Click Once,并将所有依赖项添加到其中

我还使用MVP模式实现了该项目的UI安装。 和单独的类来处理静默安装程序。请参见下面的代码示例

早些时候,当我运行静默安装程序时,我遇到了与NLog dll相关的错误,因此我通过nuget packager解决了这个问题,并将此dll包含在project=>properties=>Application Files下。。。 但现在在修复NLog库之后,我得到Omu.valueinjector dll的文件未找到错误(文件未找到排序错误)

我确实遵循了与NLog类似的步骤,但运气不佳

下面是program.cs文件下的代码

[STAThread]
public static void Main(string[] args)
{
    if(args == null || args.Length <=0){
        Application.EnableVisualStyles();
        Application.SetCompatibleTextRenderingDefault(false);
        Application.Run(new Installer(args) { IsSilentInstall = false });
    }
    else
        new SilentInstaller(args) { IsSilentInstall = true; };
}
[STAThread]
公共静态void Main(字符串[]args)
{
如果(args==null | | args.Length
public class SilentInstaller
{
    public SilentInstaller(string[] args)
    {            
        var run = OnOpen;
        if (run != null) run(args);
        //run?.Invoke(args);

        var install = OnInstall;
        install?.Invoke();

        var close = OnClose;
        close?.Invoke();
    }

    public event Action<string[]> OnOpen;
    public event Action OnInstall;
    public event Action OnClose;
}