新的.NET“ project.json”项目,将预构建的本机.dll复制到输出目录 [英] New .NET "project.json" project, copying pre-built native .dlls to the output directory

查看:74
本文介绍了新的.NET“ project.json”项目,将预构建的本机.dll复制到输出目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望将项目转换为使用 project.json 格式,但是仍要使用.NET CLR,直到第三方依赖项添加对CoreCLR的支持。

I'm looking to convert my project to use project.json format, but still using the .NET CLR until 3rd party dependencies add support for CoreCLR.

这样,我的内容目录中的文件的某些NuGet依赖项需要输出到正在运行的应用程序的bin目录中。

With that said, some of my NuGet dependencies of files in the "content" directory that need to be output into the bin directory of the running application.

由于project.json当前不支持NuGet内容,因此我将文件手动添加到了项目目录中。

Since project.json currently doesn't support NuGet content, I manually added the files to my project directory.

但是,当我运行该应用程序时,它仍然找不到这些本机程序集。如果我将这些程序集手动添加到 .dnx\runtimes\dnx-clr-win-x86.1.0.0-rc1-final\bin ,则我的应用程序可以正常运行,因此这些文件只是以某种方式放入应用程序PATH中。

However, when I run the application, it still can't find these native assemblies. If I add these assemblies manually to .dnx\runtimes\dnx-clr-win-x86.1.0.0-rc1-final\bin, my application runs fine, so it is just a matter of these files somehow getting put into the applications PATH.

那么,我该怎么做?在MSBuild中,存在复制到输出目录 =如果更新则复制。

So, how do I do it? In MSBuild, there was "Copy To Output Directory" = "Copy if newer".

推荐答案

您可以使用 postbuild 脚本来实现您想要的东西。

You can use a postbuild script to achive what you want.

这里是一个示例: https://github.com/aspnet/dnx/blob/2acce95b3f2ad4e924bc36ed .Compilation.CSharp.Abstractions / project.json#L21-L28

这篇关于新的.NET“ project.json”项目,将预构建的本机.dll复制到输出目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆