Skip to content
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

Cannot build for arm32 when use System.Device.Gpio in dotnet core preview 7 Web Application project. #646

Closed
yan0lovesha opened this issue Jul 31, 2019 · 8 comments
Labels
area-System.Device.Gpio Contains types for using general-purpose I/O (GPIO) pins bug Something isn't working

Comments

@yan0lovesha
Copy link

I want to use System.Device.Gpio in a Asp.Net core WebAssembly project. I am using dotnet core preview 7. The repro steps are as below:

  1. Create a solution in VS preview by using Asp.Net WebApplication Blazor WebAssembly template.
  2. Upgrade all nuget package to preview7 version if any is still preview6.
  3. In the Server side project, add reference to System.Device.Gpio.
  4. Save all.
  5. Run dotnet publish . -r linux-arm in the solution folder to build and publish the bits for linux-arm .

Then I see the error like "detected package downgrade from 4.3.0 to 4.0.1"

@joperezr
Copy link
Member

Can you please share a binlog of your project to try to see what is going on? To produce one, please run the following on a developer command prompt: msbuild yourSolution.sln /t:rebuild /bl:Build.binlog this will create a Build.binlog file, can you please attach that here so that we can investigate?

@joperezr joperezr added area-System.Device.Gpio Contains types for using general-purpose I/O (GPIO) pins bug Something isn't working labels Jul 31, 2019
@joperezr joperezr added this to the Future milestone Jul 31, 2019
@krwq
Copy link
Member

krwq commented Jul 31, 2019

@yan0lovesha please also share dotnet --info and what is the version of System.Device.Gpio you are using

@yan0lovesha
Copy link
Author

@joperezr @krwq , I attached 3 files for the result of binlog, dotnetinfo and dotnet_publish.

dotnet_publish.txt
dotnetinfo.txt
binlog.txt

@yan0lovesha
Copy link
Author

This is the correct binlog file.
Build.binlog.zip

@joperezr
Copy link
Member

joperezr commented Aug 1, 2019

The binlog that you provided doesn't have any warnings or errors about package downgrade, and they also don't have System.Device.Gpio as a reference. How are you trying to add the dependency to your project? Can you manually add the reference by editing the .csproj and then do a dotnet publish . -r linux-arm /bl:Build.binlog that way we can see exactly the repro of the issue and investigate.

@krwq
Copy link
Member

krwq commented Aug 1, 2019

I think sharing csproj + commands you are using to build and run (also mention OS and architecture of what was run where) should help us investigate

@yan0lovesha
Copy link
Author

yan0lovesha commented Aug 2, 2019

Sorry, I think I attached a wrong binlog file yesterday. That was generated before I add gpio reference. This one is the one with error message.

The command I am using to build is:
dotnet publish . -r linux-arm

binlog.zip

@joperezr
Copy link
Member

joperezr commented Aug 2, 2019

Ok I know what is going on. This isn't a problem with System.Device.Gpio package, it is actually caused by a NuGet bug and the fact that we don't yet have a good silent workaround in the sdk. Even if you remove the System.Device.Gpio package reference and try to rebuild with -r linux-arm you will hit the same issue, which would prove that System.Device.Gpio package is not the cause of this. For now, in order to fix this you have to manually add a reference to the new Microsoft.NETCore.Targets package into your project like:

  <ItemGroup>
    <PackageReference Include="Microsoft.AspNetCore.Blazor.Server" Version="3.0.0-preview7.19365.7" />
    <PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="3.0.0-preview7.19365.7" />
    <PackageReference Include="System.Device.Gpio" Version="0.1.0-prerelease.19376.1" />
    <PackageReference Include="Microsoft.NetCore.Targets" Version="2.1.0" />   <!--  Add this reference to your project -->
  </ItemGroup>

That would fix the issue. The two bugs I pointed you at (the nuget and the sdk bug) would need to get fixed in order for you not to need to add manually this package.
I have validated on my end that this workaround fixes your issue and given that there are already a couple bugs in the right repos to track this issue I'm going to close this one, but feel free to reopen if you think we should keep this open as well as if you need any help in getting your project working. Thanks a lot for reporting this again!

@joperezr joperezr closed this as completed Aug 2, 2019
@ghost ghost locked as resolved and limited conversation to collaborators Oct 14, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-System.Device.Gpio Contains types for using general-purpose I/O (GPIO) pins bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants