I've created a sample app to get an idea on .Net Core with Web -> ConsoleApp(Package)
. I've resolved all the dependency issues but when I try to compile natively with
dotnet-compile --native
it's returning this error:
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.
The expected is to get exe file. Even normal dotnet publish isn't working fully as I'm only getting dll, pdb files. Exe is not getting published.
Can I convert this app to single .exe file ?I'm trying using x64 native command prompt to run the command.
Please suggest.
Edit: Tried installing the new installer but no luck. But dnu publish is working fine.
I want the output as exe and dlls or native exe only but sadly fails.