Selenium .NET Core 2.2发布的项目exe即使在Windows x64上也无法运行 [英] Selenium .NET core 2.2 published project exe not running even on Windows x64

查看:265
本文介绍了Selenium .NET Core 2.2发布的项目exe即使在Windows x64上也无法运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我构建和发布项目时,发布文件夹中生成的exe不会打开,然后在一秒钟内关闭。有人可以帮我解决错误吗?

When I build and publish project, the exe generated in the Published folder doesn't Open then closes within a sec. Can anyone help me to resolve the error ?

当我从CMD行运行exe时,我会收到此错误。

When I ran the exe from CMD line I am getting this error.

cd ..Path_to_Project\WebShopTestAutomation dotnet restore dotnet build dotnet test

已找到在应用程序依赖项清单(WebShopTestAutomation.deps.json)中指定的程序集,但具有不同的文件扩展名。

An assembly specified in the application dependencies manifest (WebShopTestAutomation.deps.json) has already been found but with a different file extension.

整个项目为< a href = https://github.com/SavitaMaurya/Selenium-Specflow-project-created-.net-core-2.2/tree/master rel = nofollow noreferrer>此处。请阅读README文件以了解并让我知道是否需要更多信息。

The full project is here. Please read the README file to understand and let me know if more information is required.

推荐答案

我遇到了同样的问题,结果变成在应用程序的.dps.json文件中,有关该应用程序的条目同时出现在库中,例如本例中的 MyApp:

I had the same problem and it turned out that, in the application's .dps.json file, an entry about the application was present both among the "libraries", like "MyApp" in this example:

{
   ...
   "targets": {
      ".NETCoreApp,Version=v3.0": {
         "MyApp/1.0.0": {           <-- No problem here
            ...
         }
      },
   ...
   "libraries": {
        "MyApp/1.0.0": {            <-- Problem here
           ...
        }
    }
    ...
}

只需从库中删除条目即可解决此问题。

Simply removing the entry from "libraries" solved the problem.

这篇关于Selenium .NET Core 2.2发布的项目exe即使在Windows x64上也无法运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆