Advertisement
Guest User

Untitled

a guest
Jul 17th, 2019
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. dotnet new console -o myconsoleapp
  2.  
  3. dotnet new xunit -o myconsoleapp.tests
  4.  
  5. dotnet add ./myconsoleapp.tests reference ./myconsoleapp
  6.  
  7. dotnet test ./myconsoleapp.tests
  8.  
  9. dotnet build ./myconsoleapp.tests
  10. dotnet ./myconsoleapp.tests/bin/Debug/netcoreapp2.2/myconsoleapp.dll
  11.  
  12. A fatal error was encountered. The library 'hostpolicy.dll' required to execute the application was not found in 'myconsoleapp.tests/bin/Debug/netcoreapp2.2/'.
  13. Failed to run as a self-contained app. If this should be a framework-dependent app, add the myconsoleapp.tests/bin/Debugnetcoreapp2.2/myconsoleapp.runtimeconfig.json file specifying the appropriate framework.
  14.  
  15. using(var sut = Process.Start(@"<path-to-the-executable>"))
  16. {
  17. sut.WaitForExit();
  18. var actual = sut.ExitCode;
  19. Assert.Equal(-1,actual);
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement