-
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
Having trouble with roll-forward #42478
Comments
Tagging subscribers to this area: @vitek-karas, @agocke |
RC1 or RC2? (I have tried the steps with hello world on latest RC2 and it worked for me.) |
Here is more info ... pi@raspberrypi:~/iot/src/devices/Common/Iot/Device/Multiplexing/samples $ export | grep DOTNET │
declare -x DOTNET_ROLL_FORWARD="LatestMajor" │
declare -x DOTNET_ROOT="/home/pi/dotnet3" │
pi@raspberrypi:~/iot/src/devices/Common/Iot/Device/Multiplexing/samples $ export | grep CORE │
declare -x COREHOST_TRACE="1" │
declare -x COREHOST_TRACEFILE="trace.txt" │
pi@raspberrypi:~/iot/src/devices/Common/Iot/Device/Multiplexing/samples $ cat GpioOutputSegment-driver.csproj │
<Project Sdk="Microsoft.NET.Sdk"> │
│
<PropertyGroup> │
<OutputType>Exe</OutputType> │
<TargetFramework>netcoreapp3.1</TargetFramework> │
<Nullable>enable</Nullable> │
</PropertyGroup> │
│
<ItemGroup> │
<ProjectReference Include="../Multiplexing.csproj" /> │
</ItemGroup> │
│
</Project> │
pi@raspberrypi:~/iot/src/devices/Common/Iot/Device/Multiplexing/samples $ whoami │
pi │
pi@raspberrypi:~/iot/src/devices/Common/Iot/Device/Multiplexing/samples $ ~/dotnet3/dotnet --version │
A compatible installed .NET Core SDK for global.json version [5.0.100-preview.6.20310.4] from [/home/pi/iot/global.json] was not found │
Install the [5.0.100-preview.6.20310.4] .NET Core SDK or update [/home/pi/iot/global.json] with an installed .NET Core SDK: │
3.1.403 [/home/pi/dotnet3/sdk] │
pi@raspberrypi:~/iot/src/devices/Common/Iot/Device/Multiplexing/samples $ ~/dotnet/dotnet --version │
5.0.100-rc.2.20471.15 │
pi@raspberrypi:~/iot/src/devices/Common/Iot/Device/Multiplexing/samples $ ./bin/Debug/netcoreapp3.1/GpioOutputSegment-driver │
Hello World │
^C │
pi@raspberrypi:~/iot/src/devices/Common/Iot/Device/Multiplexing/samples $ mv trace.txt trace3.txt │
pi@raspberrypi:~/iot/src/devices/Common/Iot/Device/Multiplexing/samples $ export DOTNET_ROOT=/home/pi/dotnet │
pi@raspberrypi:~/iot/src/devices/Common/Iot/Device/Multiplexing/samples $ ls $DOTNET_ROOT │
dotnet host LICENSE.txt packs sdk shared templates ThirdPartyNotices.txt │
pi@raspberrypi:~/iot/src/devices/Common/Iot/Device/Multiplexing/samples $ ./bin/Debug/netcoreapp3.1/GpioOutputSegment-driver │
Failed to create CoreCLR, HRESULT: 0x80070057 │
pi@raspberrypi:~/iot/src/devices/Common/Iot/Device/Multiplexing/samples $ mv trace.txt trace5.txt Built from this commit: richlander/iot@124131f |
This problem seems to arrive with Preview 6. pi@raspberrypi:~/iot/src/devices/Common/Iot/Device/Multiplexing/samples $ export DOTNET_ROOT=/home/pi/dotnet5p5
pi@raspberrypi:~/iot/src/devices/Common/Iot/Device/Multiplexing/samples $ ./bin/Debug/netcoreapp3.1/GpioOutputSegment-driver
Hello World
^C
pi@raspberrypi:~/iot/src/devices/Common/Iot/Device/Multiplexing/samples $ export DOTNET_ROOT=/home/pi/dotnet5p6
pi@raspberrypi:~/iot/src/devices/Common/Iot/Device/Multiplexing/samples $ ./bin/Debug/netcoreapp3.1/GpioOutputSegment-driver
Failed to create CoreCLR, HRESULT: 0x80070057
pi@raspberrypi:~/iot/src/devices/Common/Iot/Device/Multiplexing/samples $ ~/dotnet5p6/dotnet --version
5.0.100-preview.6.20318.15
pi@raspberrypi:~/iot/src/devices/Common/Iot/Device/Multiplexing/samples $ ~/dotnet5p5/dotnet --version
Could not execute because the application was not found or a compatible .NET SDK is not installed.
Possible reasons for this include:
* You intended to execute a .NET program:
The application '--version' does not exist.
* You intended to execute a .NET SDK command:
A compatible installed .NET SDK for global.json version [5.0.100-preview.6.20310.4] from [/home/pi/iot/global.json] was not found.
Install the [5.0.100-preview.6.20310.4] .NET SDK or update [/home/pi/iot/global.json] with an installed .NET SDK:
5.0.100-preview.5.20279.10 [/home/pi/dotnet5p5/sdk]
pi@raspberrypi:~/iot/src/devices/Common/Iot/Device/Multiplexing/samples $ cd
pi@raspberrypi:~ $ ~/dotnet5p5/dotnet --version
5.0.100-preview.5.20279.10 |
Here is an example app that is causing me trouble. |
I just built the led-blink project inside and outside the repo. Outside, it works. Inside, it does not. The two builds produce different results. See: pi@raspberrypi:~/iot/samples/led-blink $ ls bin/Debug/netcoreapp3.1/
Iot.Device.Bindings.dll led-blink.dll led-blink.xml System.Device.Gpio.xml Windows.Devices.DevicesLowLevelContract.winmd
Iot.Device.Bindings.xml led-blink.pdb Microsoft.Win32.SystemEvents.dll System.Drawing.Common.dll Windows.Foundation.FoundationContract.winmd
led-blink led-blink.runtimeconfig.dev.json runtimes System.IO.Ports.dll Windows.Foundation.UniversalApiContract.winmd
led-blink.deps.json led-blink.runtimeconfig.json System.Device.Gpio.dll UnitsNet.dll
pi@raspberrypi:~/iot/samples/led-blink $ ls ~/led-blink/bin/Debug/netcoreapp3.1/
led-blink led-blink.deps.json led-blink.dll led-blink.pdb led-blink.runtimeconfig.dev.json led-blink.runtimeconfig.json System.Device.Gpio.dll
pi@raspberrypi:~/iot/samples/led-blink $ The IoT msbuild assets are causing the build to be different and for WinRT assets to be included that don't otherwise exist. That leaves to believe that one of two things is happening:
The fact that Preview 5 works and Preview 6 doesn't seems very aligned with the timing of the WinRT breaking change. |
Could you please share the built binaries for these two version of the app? That should help greatly with both repro and figuring out what's wrong. |
Good idea. In the zip:
|
We're tripping over a runtime/src/coreclr/src/binder/applicationcontext.cpp Lines 265 to 280 in a0e1831
The deps file of led-blink2 has:
|
Thanks @sbomer. That was my guess. Can we generate a better error message? If so, this is something that I'd like to consider for .NET 5.0. The current error message isn't actionable. This is account for the breaking change we made. Separately, I think we should fix the dotnet/iot repo to "do the right thing". This project is one of the few that we have that is more like user code and could be used as a good example of best practice. |
@jkoritzinsky What are your thoughts here? This is the roll forward policy kicking in for a 3.x application that is moving to 5.0 and using WinRT. |
A better message would definitely be nice. Any of the errors created in this parsing code bubble up an HRESULT (E_INVALIDARG in a lot of cases), and the code in the host that prints the error doesn't know specifically what happened. I think we could improve the messages by using different error codes (or changing the host API), or printing the error from the runtime (but we'd have to make sure it doesn't get printed spuriously). Those feel a little risky to make for 5.0 at this point, IMO. |
@richlander How common do we expect this to be? I thought major version roll-forward was an explicit opt-in (i.e. advanced scenario). If that is true I might consider this the price of doing business. My reason for saying that is my desire to avoid creating an error code and message that would be removed in the next release. Removed because this is only going to be impacting us for a relatively short period of time (i.e. the transition from 3.x to 5.0). |
There might be a misperception of what this situation represents. I agree that we should not do anything at this late point for the roll-forward scenario. I was thinking that this might show up for apps that use old NuGet packages. However, in thinking about it more, those should get caught by the build system and not the host. That said, it was unfortunate that the trace didn't include the relevant error. That would be really nice to improve for 6.0. I assume that there are other error cases that are similarly not represented well in the trace. |
In terms of next steps, I assume the ball is in the dotnet/iot court to produce 5.0 assets. Might we start by including a |
We are in agreement there. I had assumed the trace would include the name of any assembly it didn't find. If that isn't true an issue should be filed.
I think so. That is one of those questions I assume @jkoritzinsky immediately knows the answer. |
That should be pretty easy to do while they wait to be unblocked by the Windows SDK team. (They're waiting on the Windows SDK team to strong-name their projection assembly.) |
I added #42607 for this purpose. I also added a tracking bug for dotnet/iot @ dotnet/iot#1193. I can now close this one. Thanks everyone for the help! |
My understanding is that the files are present so from host's point of view everything is OK - it's the runtime which refuses to load that file - this is essentially similar to having a corrupted assembly.
|
I am having trouble configuring roll-forward. I'm not sure what I'm missing.
I have no .NET installed globally on this machine.
I am working out of a clone of the dotnet/iot repo and using the toolset that it downloads/uses. It works great for the SDK. .NET 5.0 is much faster than I recall previous versions being, but that's separate. I hope it's true.
I then installed RC2 ...
The text was updated successfully, but these errors were encountered: