-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
[ARM32] Could not load file or assembly 'System.ComponentModel.Primitives, Version=4.2.0.0 #7308
Comments
@safern could you take a look at this? |
Yes will take a look at this later today @AlexGhiondea |
Any update on this @safern ? We're facing the same issue. |
I have the same issue... |
Here is my update from what I was able to investigate after getting a repro. The .NET Core Runtime for Ubuntu on ARM is a community developed project which is currently in beta and it uses some assemblies that aren't released yet, they are still in beta, such as: The error here is that the released .NET Core SDKs (1.1 or 1.0) are using the latest released assemblies which in We have a way to tell the runtime and cli to exclude the runtime assembly specific on execution from the
So if we do this for the assemblies that are causing the error it would be fix. So an example of the
We are working on driving this kind of issues to always use the latest version of the assembly but as of now that would be the workaround. So if you need to bring more dependencies to your project and you get that exception for that specific assembly or an assembly that is brought because other dependency depends on it (In this case it happened that with Sorry for the late update I was investigating and trying to find the best solution for you guys. |
@safern , that workaround didn't work for me unfortunatelly, I get error in project.lock.json and the VS reverts it to its original situation. |
@mne1991 what is the error you are getting in |
@safern Thank you for trying to help, actually what I am trying to is deploying the very basic template website, which visual studio 2015 generates when you create an ASP.Net Core Web Application. I just create that and try to public it to my RaspberyPi3, after publishing I copy everything published to my RPi3 (I tried to not change anything except the version in the file WebApplication1.runtime... to fit the .net core version), but I get the same error as mention in this issue. Could you try generting that? because the .json files are very long. Would take a look if you are able to get it running on RPi? thank you in advance! |
@mne1991 depending on the specific version of VS that you are using the templates might be different, so it would really help diagnosing your issue if you can provide the project.json (not the project.lock.json which is the very long one) and ideally the version of the CLI you are using which you can get by typing |
Bellow is my project.json file, and here is my .net version:
project.json:
|
Hey @mne1991 so I was able to run the sample app with your So your project json should look like this:
Hope this unblocks you! |
@safern Thank you for that and I really appreciate your help. I tried just to paste what you gave me in my project.json and then published the project and copied it to my RPi3, and then tried to start, but I get version error, therefore I edited my WebApplication.runtime.json file to fit my .net core version and then retried, and I get other exceptions: So here is the summery of what I have done:
|
Got it running on a Pi2, additionally to what @safern explained (big thanks!), you should also add:
And copy the netstandard1.7 version of The result: The only teeny tiny problem is that I can't get any response from it yet :) |
@safern @tomkuijsten Thank you very much for you!!! I got it working! I added this as well:
Just for the other people, don't forget that the default behaviour is to listen only on |
@safern Thanks for the update and help. I updated my project.json based on your info. The application is running for most parts but most important i am able to perform api request to the webserver on the RPi3. project.json
|
@mne1991 the steps you should follow to make it available from the outside: Add a file named {
"server.urls": "http://*:5102"
} Make sure the file is copied when publishing by adding it to the publishOptions in your "publishOptions": {
"include": [
"wwwroot",
"**/*.cshtml",
"appsettings.json",
"hosting.json",
"web.config"
]
}, Edit your main method in the var config = new ConfigurationBuilder()
.SetBasePath(Directory.GetCurrentDirectory())
.AddJsonFile("hosting.json", optional: true, reloadOnChange: true)
.Build();
var host = new WebHostBuilder()
.UseConfiguration(config)
.UseKestrel()
.UseContentRoot(Directory.GetCurrentDirectory())
.UseIISIntegration()
.UseStartup<Startup>()
.Build();
host.Run(); And finally, you should add a firewall rule to allow traffic through your post by entering in a powershell terminal: netsh advfirewall firewall add rule name="Open Port 5102" dir=in action=allow protocol=TCP localport=5102 Now use fiddler or any other tool to reach your api at |
Excellent work guys! 👍 Between these modifications and this I've managed to get an ASP.NET Core web application running on my RPi that can communicate with a Cortex-M3 microcontroller device over USB. This is something I've been hoping to achieve for several months and it's exciting to finally have something working. |
Great to know that this issue was sorted out. Special thanks to @safern @maartenmensink @tomkuijsten and @mne1991. I'll close this issue for now, since the new approach that we are working on is having one flat package that contains the right set of dependencies to avoid this sort of problems. |
Great that we could help and unblock you guys! Thanks for helping us sort out the issue with your feedback and tips!! Great to see that your .NET Core apps are working now. Thanks @maartenmensink for opening the issue and @tomkuijsten @mne1991 @TAGC for complementing the issue on how to get the web apps running and working! Thanks @joperezr for helping out! |
Was waiting for this moment since the announcement of Win10IoT for the Pi, big thanks to all the people at Microsoft and especially @safern for the initial investigation! |
@tomkuijsten Not only for Windows, but also for Linux ;) thanks for you all. |
True :) I put all the configuration steps together in a blog post to explain each step. |
@safern May I ask how you were able to know the version you had to use? for example here:
the error message has this version 4.2.0.0, how did you know that you needed to enter 4.3.0? |
Yes @mne1991 so the 4.2.0.0 is the assembly version that the runtime and/or your project is using, but the version in the To know what version to include in the |
@safern Thank you! So what I understand is: The version my application is using is 4.2.0.0, but when I move the app to another platform (RPi3), the CLR on RPi expects another version 4.3.0 (a newer one because this CLR on RPi is newer and is still beta and uses newer beta packages). therefore he doesn't use the packages available in my app, or did I misunderstand anything? |
No, the assembly is what your application is using. The package is what contains the assembly of the dependency you are referencing. So when you say on your
You're telling the dotnet cli that you depend on that package version (4.3.0) which will contain point to an assembly In this case since the runtime is on a beta and uses newer APIs from that assembly is using a 4.2.0.0 assembly version which is on a beta package that has not being released. So that is why we added the Makes sense? @mne1991 |
@safern. That is clear now! thanks! Just what is still unclear to me is:
So that means I can either use what the CLR uses, or I can just ignore what the CLR has and use what I included in my application by using |
Mainly yes. What
So basically it will exclude the assembly that your dotnet cli uses for runtime -- this will be the dotnet cli that you used to published your app not the one you are using in your RPi to run it. This being said, when running it will see it has a dependency on That made more clear? @mne1991 |
@safern Thank you very much! |
Hello! In the VS2017RC i've started a new web application project, and only modified the project.csproj to look like this:
The exception:
Can you please point me out to the right direction? |
@PArpad , please paste your project.json file. I will edit it to you to get it work. |
@mne1991 , My problem is that i don't have one, while working in VS2017. And according to the link below, i shouldn't have one, since it has been removed and replaced by the editable .csproj file. This is the reason i'm a bit lost, and looking for clarification. |
Hi @PArpad, the problem is the same but you have to exclude the Runtime assets on the
And delete the So your
|
@safern Thank you, it worked like a charm. Looking at what you modified, i was on a good path, just didn't mix the previous solution and the .csproj properly. |
I do not wish to barge into the conversation, but I have been following and trying out the solutions outlined in here, and the app works fine on RPI. However when I attempt to debug it in Visual Studio 2015, I'm getting an error stating
Why is it that even though we're specifically telling dotnet to ignore runtime version, it is checking for a specific version? |
Hi All, I followed the steps as mentioned but I am not able to access the Web API from outside. Please help me to unblock this. The details of my environment are as follows Microsoft Visual Studio Community 2017 Added hosting.json with following contents and also added firewall exception for the port. { |
I have a project that i am trying to get working on the RPi3 Ubuntu. I installed the latest and greatest based on https://github.com/dotnet/core/blob/master/samples/RaspberryPiInstructions.md
I am able to run the samples from https://github.com/dotnet/core/tree/master/samples without any issue but when i try to start our project i get the following stack trace
Stack Trace
Enviroment
Ubuntu 16.04 on Raspberry PI 3
runtime version : 1.2.0-beta-001291-00
project.json
Project.runtimeconfig.json
The text was updated successfully, but these errors were encountered: