将我的.Net核心应用程序本机绑定到单个.exe的问题

时间:2016-04-05 04:28:32

标签: dnu asp.net5

我已经创建了一个示例应用,以便通过Web -> ConsoleApp(Package)了解.Net Core。我已经解决了所有依赖问题,但是当我尝试使用

进行原生编译时
dotnet-compile --native 

它正在返回此错误:

dotnet compile --native
Compiling DemoApp for DNXCore,Version=v5.0

Compilation succeeded.
    0 Warning(s)
    0 Error(s)

Time elapsed 00:00:09.2220793
Input Assembly: ..\Visual Studio 2015\Projects\DemoApp\
src\DemoApp\bin\Debug\dnxcore50\DemoApp.dll
libcpmt.lib(nothrow.obj) : error LNK2038: mismatch detected for '_MSC_VER': valu
e '1700' doesn't match value '1900' in Runtime.lib(RuntimeInstance.obj)
libcpmt.lib(newaop.obj) : error LNK2038: mismatch detected for '_MSC_VER': value
 '1700' doesn't match value '1900' in Runtime.lib(RuntimeInstance.obj)
Runtime.lib(objecthandle.obj) : error LNK2001: unresolved external symbol "void
__cdecl operator delete(void *,unsigned __int64)" (??3@YAXPEAX_K@Z)
Runtime.lib(stressLog.obj) : error LNK2001: unresolved external symbol "void __c
decl operator delete(void *,unsigned __int64)" (??3@YAXPEAX_K@Z)
Runtime.lib(gcwks.obj) : error LNK2001: unresolved external symbol "void __cdecl
 operator delete(void *,unsigned __int64)" (??3@YAXPEAX_K@Z)
Runtime.lib(handletablescan.obj) : error LNK2001: unresolved external symbol "vo
id __cdecl operator delete(void *,unsigned __int64)" (??3@YAXPEAX_K@Z)
Runtime.lib(module.obj) : error LNK2001: unresolved external symbol "void __cdec
l operator delete(void *,unsigned __int64)" (??3@YAXPEAX_K@Z)
Runtime.lib(allocheap.obj) : error LNK2001: unresolved external symbol "void __c
decl operator delete(void *,unsigned __int64)" (??3@YAXPEAX_K@Z)
Runtime.lib(gceewks.obj) : error LNK2001: unresolved external symbol "void __cde
cl operator delete(void *,unsigned __int64)" (??3@YAXPEAX_K@Z)
Runtime.lib(RestrictedCallouts.obj) : error LNK2001: unresolved external symbol
"void __cdecl operator delete(void *,unsigned __int64)" (??3@YAXPEAX_K@Z)
Runtime.lib(RuntimeInstance.obj) : error LNK2001: unresolved external symbol "vo
id __cdecl operator delete(void *,unsigned __int64)" (??3@YAXPEAX_K@Z)
Runtime.lib(CachedInterfaceDispatch.obj) : error LNK2001: unresolved external sy
mbol "void __cdecl operator delete(void *,unsigned __int64)" (??3@YAXPEAX_K@Z)
Runtime.lib(threadstore.obj) : error LNK2001: unresolved external symbol "void _
_cdecl operator delete(void *,unsigned __int64)" (??3@YAXPEAX_K@Z)
Runtime.lib(PalRedhawkMinWin.obj) : error LNK2001: unresolved external symbol "v
oid __cdecl operator delete(void *,unsigned __int64)" (??3@YAXPEAX_K@Z)
Runtime.lib(handletablecore.obj) : error LNK2001: unresolved external symbol __s
td_terminate
Runtime.lib(handletablecache.obj) : error LNK2001: unresolved external symbol __
std_terminate
Runtime.lib(handletablescan.obj) : error LNK2001: unresolved external symbol __s
td_terminate
Runtime.lib(RestrictedCallouts.obj) : error LNK2001: unresolved external symbol
__std_terminate
Runtime.lib(objecthandle.obj) : error LNK2001: unresolved external symbol __std_
terminate
Runtime.lib(stressLog.obj) : error LNK2001: unresolved external symbol __std_ter
minate
Runtime.lib(handletable.obj) : error LNK2001: unresolved external symbol __std_t
erminate
Runtime.lib(RuntimeInstance.obj) : error LNK2001: unresolved external symbol __s
td_terminate
Runtime.lib(CachedInterfaceDispatch.obj) : error LNK2001: unresolved external sy
mbol __std_terminate
Runtime.lib(startup.obj) : error LNK2001: unresolved external symbol __std_termi
nate
Runtime.lib(allocheap.obj) : error LNK2001: unresolved external symbol __std_ter
minate
Runtime.lib(gcwks.obj) : error LNK2019: unresolved external symbol __acrt_iob_fu
nc referenced in function printf
bootstrapper.lib(main.obj) : error LNK2001: unresolved external symbol __acrt_io
b_func
Runtime.lib(gcwks.obj) : error LNK2019: unresolved external symbol __stdio_commo
n_vfprintf referenced in function printf
bootstrapper.lib(main.obj) : error LNK2001: unresolved external symbol __stdio_c
ommon_vfprintf
bootstrapper.lib(main.obj) : error LNK2019: unresolved external symbol _Init_thr
ead_header referenced in function GetModuleSection
bootstrapper.lib(main.obj) : error LNK2019: unresolved external symbol _Init_thr
ead_footer referenced in function GetModuleSection
bootstrapper.lib(main.obj) : error LNK2019: unresolved external symbol __managed
__Main referenced in function main
bootstrapper.lib(main.obj) : error LNK2001: unresolved external symbol _Init_thr
ead_epoch
..\Visual Studio 2015\Projects\DemoApp\src\DemoApp\bin\
Debug\dnxcore50\native\DemoApp.exe : fatal error LNK1120: 8 unresolved externals

Linking of intermediate files failed.

预期是获取exe文件。即使是正常的 dotnet发布也没有完全正常工作,因为我只获取dll,pdb文件。 Exe没有发布。

No .exe file

我可以将此应用转换为单个.exe文件吗?我正在尝试使用x64本机命令提示符来运行该命令。

请建议。

编辑:尝试安装新的安装程序,但没有运气。 但 dnu发布工作正常。

dnu publish result

我希望输出只作为exe和dll或本机exe,但遗憾地失败了。

0 个答案:

没有答案