Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Workaround for missing .deps files #27

Closed
snebjorn opened this issue Jun 9, 2017 · 2 comments
Closed

Workaround for missing .deps files #27

snebjorn opened this issue Jun 9, 2017 · 2 comments
Assignees

Comments

@snebjorn
Copy link

snebjorn commented Jun 9, 2017

Hi, I think it would be a good idea to add a section about fixing missing deps files in the setup guide.

If you're running your tests from another project than the web project you'll need to add this to the test project's .csproj file.

<!--
  Work around https://github.com/NuGet/Home/issues/4412. MVC uses DependencyContext.Load() which looks next to a .dll
  for a .deps.json. Information isn't available elsewhere. Need the .deps.json file for all web site applications.
-->
<Target Name="CopyDepsFiles" AfterTargets="Build" Condition="'$(TargetFramework)'!=''">
  <ItemGroup>
    <DepsFilePaths Include="$([System.IO.Path]::ChangeExtension('%(_ResolvedProjectReferencePaths.FullPath)', '.deps.json'))" />
  </ItemGroup>
  <Copy SourceFiles="%(DepsFilePaths.FullPath)" DestinationFolder="$(OutputPath)" Condition="Exists('%(DepsFilePaths.FullPath)')" />
</Target>

And if you're using xUnit you'll need to add this as well

<ItemGroup>
  <None Include="xunit.runner.json" CopyToOutputDirectory="PreserveNewest" />
</ItemGroup>

And a xunit.runner.json file

{
  "shadowCopy": false
}

It's a bug that is hopefully getting fixed. NuGet/Home#4412

@arnaudauroux
Copy link
Member

You are perfectly right! I plan to move the documentation to the wiki section and add more tips like this one ;)

@arnaudauroux arnaudauroux self-assigned this Jul 26, 2017
arnaudauroux added a commit that referenced this issue Aug 14, 2017
…tartupConfigurationService configuration)
@arnaudauroux
Copy link
Member

Fixed in 0.7.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants