-
Notifications
You must be signed in to change notification settings - Fork 509
LinkNative doesn't pull assemblies from Runtime Package Store #4444
Comments
I'll try the workaround mentioned in that issue and see what I get, will comment-and-close this if it resolves. |
Hi @markrendle! Having said that, I did build a set of simple ASP.NET Core 2.0 apps with CoreRT a few month ago. So, in order to help you to start playing with CoreRT, I took liberty to adjust my rd.xml and some very basic build scripts for your app. I hope that you don’t mind me doing it. :) You can find my files here: sergiy-k@9edc6df. As you can see, my rd.xml file is quite large, in part because I simply accumulated entries in it that were needed for different applications and some of the entries were added to work around bugs that we had in CoreRT a few months ago (which I did not have a chance to clean up). You might not need everything in it but I would not worry much about that unless you want to make your final executable as small as possible. I also did not use dotnet cli to build my apps because it was not possible at all at that time. Instead I invoked the ILC compiler and linker using response file from 'x64 Native Tools Command Prompt for VS'. Long story short, I was able to build and run your application using these scripts. Of course, I don’t know if everything works as expected. :) There were two small workarounds that I had to apply in your code to make the app start:
Here are the steps that I followed to build and run your app:
Yeah, I know, it’s not pretty but that’s where we are at this point. :( |
@markrendle , would you mind telling us more about how you expect AoT compilation to benefit shtik? We're definitely interested in gathering that kind of feedback to help us prioritize work. |
@morganbr ; I did the same experiment as markrendl a while back. (not on shtik though but another ASP.NET Core MVC application we wanted to run on a custom ARM-board) I guess having corert on asp.net core applications is a important since many practical workloads for .NET Core uses ASP.NET Core. Also this brings a new deployment/optimization model already available on competing stacks such as Go or Rust. I agree that probably in many scenarios a crossgened or even JIT:ed SCD is good enough, however being able to produce a single executable targeting a platform is a nice thing and would attract people not confortable with JIT:ing on resource constrained devices. |
@sergiy-k You are a hero! Thank you for taking the time to do all that, I'll try it out right away. @morganbr There are two main drivers for me wanting to AoT-compile Shtik:
The thing that I'm most excited about here is that my main reason for creating Shtik is that I can use it in my presentations on .NET Core, where it is both the presentation tool and the thing I'm talking about. And now I can add a whole section on CoreRT to my talks (which will definitely include a mention of how helpful you guys are 😄) |
@morganbr the most common scenario for me is to be able to release small/medium self contained single app/exe tools that I can redistribute easily. If you look at the Go language ecosystem, this platform has been very popular in the past years, and one of the reason being that it allows to compile to AoT natively. Nowadays, It is often the language/platform most commonly used for releasing useful executable without having to install a runtime (see projects like Extrapolating a bit from this, I believe that the lack of AoT in .NET is likely a reason for some companies to not adopt .NET and use a language like Go instead. Typically yesterday, I tried to use a Go program to generate markdown TOC with links from a github markdown file (here derived from another self contained shell here) but it was buggy with some markdown files. I developed a small tool with markdig called By being able to release a similar .NET tool (but much better and solid!) that you can use easily on Windows or Linux or MacOSX, people would start to see .NET differently to develop these kind of little useful programs... If I had time, I would lovely help CoreRT on this, but my OSS duty is already eating my whole spare time... so keep up this work on AoT, it is a fantastic opportunity for .NET! |
@sergiy-k Finally found the time to do this, and IT WORKS! Thanks! |
@markrendle, great to hear that it worked for you. If you'll have more time to play with it, then please let me know what are other issue that you'll find. We'll be happy to help. |
@sergiy-k I'll be experimenting some more with it this week, including seeing if I can trim the rd.xml file. I'll also try the new rd.xml syntax from #4775 and see if I can replace that code reference hack-around with an up-to-date build. Anything I achieve will be pushed to the shtik/cli repo and I'll post in this thread. |
Hey, @markrendle. With #4870 , shtik/cli should be publishable out of the box (as long as you identify the correct rd.xml file in your .csproj)! Give it a try and let us know if you run into any issues. |
Hi @A-And ; since your changes that allow using dotnet-cli for building (Nice!!) I cannot get a simple |
The |
@jkotas; checked my work-VM; turns out it built the "dotnet web" on Windows, not WSL. Never the less using the dotnet-tooling on this Windows environement I get:
..when trying to run the output exe after dotnet publish -r win-x64. Maybe this is my rd.xml not configured the right way. @A-And is not explicit in how to define the "correct rd.xml" in his comment. I just added it as Content in my csproj but maybe this is not the correct way. |
The file name needs to be specified in the RdXmlFile property otherwise the compiler won't see it. |
I think all issues here have been fixed. |
Before I start, I should say that I know the scenario I'm describing isn't remotely supported yet; I have just been exploring how unsupported it is. 😈
I'm working on a thing that will benefit greatly from CoreRT AOT compilation when it is ready, so I thought I'd try it and see how far it got. It's an ASP.NET Core 2.0 application that just uses Routing, Kestrel and various Extensions packages. No Controllers or Views whatsoever. I figured it might work a bit and I could provide feedback on any problems I encountered.
So here goes with the first one:
When I tried to build the
shtik/cli
console application with/t:/LinkNative
it did actually produce a runnableshtik.exe
file, but when I ran it it errored out with aCould not find assembly Microsoft.Extensions...
message. Obviously it failed to pull the various assemblies from the ASP.NET Core runtime package store during the build.As I say, I'm not expecting it to work, just flagging the issue for now.
Environment info:
Windows 10 x64
Visual Studio 2017.3 Native Tools command prompt
dotnet SDK 2.0.0
ASP.NET Core 2.0.0
CoreRT built from master branch as of about a week back.
The text was updated successfully, but these errors were encountered: