问题
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