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

TargetFramework is not "undefined," but getting it is skipped for vcxproj #5565

Closed
Forgind opened this issue Jul 29, 2020 · 7 comments
Closed
Assignees
Milestone

Comments

@Forgind
Copy link
Member

Forgind commented Jul 29, 2020

Issue Description

We SkipGetTargetFrameworkProperties on .vcxproj by default, but we're not adding TargetFramework to UndefineProperties. This means that with cross-targeting, MSBuild can be confused when building the exact same project, lock the dll as it writes, and fail.

Steps to Reproduce

I think this will work, although I haven't actually tested it, since I don't want to download C++ 😄 :
Create a .vcxproj as normal
Specify TargetFrameworks="net462"
Build

Expected Behavior

It builds for net462 alone.

Actual Behavior

CL : fatal error C1083: Cannot open compiler intermediate file: ...
Permission denied

@Forgind Forgind added the bug label Jul 29, 2020
@Forgind Forgind added this to the Backlog milestone Jul 29, 2020
@BartoszKlonowski
Copy link
Contributor

I have a full C++ setup, so I can work on this.
@Forgind Please assign me to this item.

@rainersigwald
Copy link
Member

@BartoszKlonowski this is a pretty tricky area. Please check in after you get a repro and some idea of what to work on before sinking a bunch of time into it.

@BartoszKlonowski
Copy link
Contributor

@rainersigwald Thank you for that, I will.

@BartoszKlonowski
Copy link
Contributor

@Forgind I've tried to set the TargetFramework (and TargetFrameworks, as there's a difference) by specifying it like below:

  <PropertyGroup Label="Globals">
    <VCProjectVersion>16.0</VCProjectVersion>
    <Keyword>Win32Proj</Keyword>
    <ProjectGuid>{0024ce18-4706-418f-b3e6-f0d9bb50d143}</ProjectGuid>
    <RootNamespace>Examples</RootNamespace>
    <WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
    <TargetFrameworks>net462</TargetFrameworks>
  </PropertyGroup>

And when I ran the MSBuild without any more parameters, the build was just fine...

Please let me know if this is the reproduction scenario you were thinking about.


(I've also attached the full configuration, so you can verify it. Hope that helps!)
5565-Example-vcxproj.zip

@Forgind
Copy link
Member Author

Forgind commented Apr 8, 2021

I don't remember all the context for this, but looking at the description, I think I fixed this in 16.9 and forgot about it: #5838

If rainersigwald and I both forgot about that PR in the intervening months and should have closed this—sorry! I'll look more next week to see if we should just close this.

@BartoszKlonowski
Copy link
Contributor

@Forgind No problem if you've already fixed it. Just let me know once you'll double check the status 👍

@Forgind
Copy link
Member Author

Forgind commented Apr 19, 2021

I just chatted with rainersigwald offline, and we agreed we'd just forgotten to chase this down. Thanks for the reminder!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants