Selenium .NET core 2.2 published project exe not running even on Windows x64

浪子不回头ぞ 提交于 2020-01-24 12:12:25

问题


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 ?

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

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

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

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


回答1:


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.



来源:https://stackoverflow.com/questions/56838166/selenium-net-core-2-2-published-project-exe-not-running-even-on-windows-x64

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!