OmniSharp / omnisharp-sublime

C# IDE Plugin for Sublime Text 3
http://omnisharp-sublime.readthedocs.org/en/latest/
MIT License
551 stars 64 forks source link

Cannot Run Unit Tests if Build Output Directory is anything other than /bin/Debug/ #169

Closed MikeMangialardi closed 6 years ago

MikeMangialardi commented 9 years ago

When I try to run my unit tests through OmniSharp, I get the following error:

ProcessModel: Default    DomainUsage: Single
Execution Runtime: mono-3.5
Unhandled Exception:
System.IO.DirectoryNotFoundException: Could not find a part of the path "{Project Directory}/bin/Debug/{Name of Project}.dll".
  at System.IO.FileStream..ctor (System.String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, Boolean anonymous, FileOptions options) [0x00000] in <filename unknown>:0 
  at System.IO.FileStream..ctor (System.String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, Boolean isAsync, Boolean anonymous) [0x00000] in <filename unknown>:0 
  at System.IO.FileStream..ctor (System.String path, FileMode mode, FileAccess access) [0x00000] in <filename unknown>:0 
  at (wrapper remoting-invoke-with-check) System.IO.FileStream:.ctor (string,System.IO.FileMode,System.IO.FileAccess)
  at NUnit.Core.AssemblyReader.CalcHeaderOffsets () [0x00000] in <filename unknown>:0 
  at NUnit.Core.AssemblyReader..ctor (System.String assemblyPath) [0x00000] in <filename unknown>:0 
  at NUnit.Util.RuntimeFrameworkSelector.SelectRuntimeFramework (NUnit.Core.TestPackage package) [0x00000] in <filename unknown>:0 
  at NUnit.Util.DefaultTestRunnerFactory.GetTargetProcessModel (NUnit.Core.TestPackage package) [0x00000] in <filename unknown>:0 
  at NUnit.Util.DefaultTestRunnerFactory.MakeTestRunner (NUnit.Core.TestPackage package) [0x00000] in <filename unknown>:0 
  at NUnit.ConsoleRunner.ConsoleUi.Execute (NUnit.ConsoleRunner.ConsoleOptions options) [0x00000] in <filename unknown>:0 
  at NUnit.ConsoleRunner.Runner.Main (System.String[] args) [0x00000] in <filename unknown>:0 

where {Project Directory} is the directory where my project is located, and {Name of Project} is the name of the project.

I have a handful of solutions where I have changed the default build output directory in several of the .csproj files like so:

<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
    <DebugSymbols>true</DebugSymbols>
    <DebugType>full</DebugType>
    <Optimize>false</Optimize>
    <OutputPath>..\build\</OutputPath>
    <DefineConstants>DEBUG;TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
  </PropertyGroup>
  .... a bunch of other irrelevant stuff....
</Project>

It would be nice if OmniSharp looked at the .csproj file to determine where the output .dll is instead of assuming that it will be located in {project}/bin/Debug/

Rosalie241 commented 6 years ago

Closing due to inactivity.