-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Confusing error when using COMReference on Core #4332
Comments
From @Pilchie on Tuesday, 23 April 2019 16:24:09 @rainersigwald do you know the state of |
From @rainersigwald on Tuesday, 23 April 2019 18:07:39 It's not expected to work, but it should fail in a clearer way than this. I think that's a bug for Microsoft/MSBuild; I'll move this and describe what the problem is there. |
COM reference resolution currently only works when building with MSBuild.exe. That's tracked by #3986. You should be able to build successfully with MSBuild.exe (targeting .NET Core 3.0). This error is very confusing; we should instead give the error added in #3987, which should make the underlying problem clearer. This issue tracks the bad error, which I think is related to this: I think we're trying to load a task in a specific TaskHost environment that we can't satisfy, which means we can't emit the error from the new task. |
Reproed with @Forgind; this only happens when |
@rainersigwald Could use a little help understanding the problem and fix here. I am switching to JetBrains Rider on my home computer to give it a try, and when I build a project with ADOX.dll reference, I get errors like the one described here.
for the following MSBuild csproj snippet: <ItemGroup Condition=" '$(TargetFramework)' == 'net461' and '$(OS)' == 'Windows_NT' ">
<COMReference Include="ADOX.dll">
<Guid>00000600-0000-0010-8000-00aa006d2ea4</Guid>
<VersionMajor>6</VersionMajor>
<VersionMinor>0</VersionMinor>
<WrapperTool>tlbimp</WrapperTool>
<Lcid>0</Lcid>
<Isolated>false</Isolated>
</COMReference>
</ItemGroup> I then right clicked on the project, and explicitly added "Microsoft ADO Ext. 6.0 for DDL and Security 6.0.0", which generated nearly identical info: it added Is the only way to get this to work to install .net core 3.0+? I'm trying that now but I couldn't understand
And - I take it the improvements in the latest MSBuild assembly loader solve this problem, too? Edit: Ha. Re-reading the issue, I see @fubar-coder reported it and we're both literally referring to the same xml in the same project. |
After installing .NET SDK 3.1.101 x64, I now get this error:
I don't quite understand this message - not being difficult.
Is this supposed to be looking for an MSBuild.exe or is it a typo in the error message? |
I believe this line is incorrect in .NET Core context: I will open a ticket to discuss this message improvement separate from whether this issue fixes the originally reported problem. |
@jzabroski This bug (the confusing error message) should be fixed in MSBuild 16.5/SDK 3.1.200, which isn't out yet. |
@rainersigwald Sorry - but, can you (a) point me to the fix? (b) explain to me if there is a workaround / what the correct error message should be here? And thanks for your help. |
The change is here. rainersigwald recommended this error message: |
@Forgind Thanks for all your amazing work, and thanks @rainersigwald for your leadership in making this a much more usable/better product overall. Very impressed. |
@rainersigwald Is there any way I can stick a check for MSBuild at top of a .NET SDK project? I have stayed away from putting build targets in .NET SDK projects, with the assumption it isn't smart to do so, and put targets in a build.targets file instead. However, it would be nice to have an I was thinking |
@jzabroski Yes, you can add |
@rainersigwald I like where you're going. Saving the world from one footgun at a time. Somewhere on the Redmond campus there should be a slab of Golden Foot dedicated to your MSBuild sanitization. If refactoring MSBuild isn't an athletic achievement, I don't know what is. |
From @fubar-coder on Tuesday, 23 April 2019 07:16:19
I get an error which seems to be caused by the following
COMReference
project item:The error message roughly translates to something along the lines:
The "ResolveComReference" task couldn't be executed, because MSBuild couldn't create or connect to a task host with runtime "CLR4" and architecture "x86".
I also attached the build log.
build-log.zip
Copied from original issue: dotnet/installer#1690
The text was updated successfully, but these errors were encountered: