-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Failure publishing WPF app with RID can fail if intermediate path is overridden #366
Comments
We have had to do various workarounds for the wpf temp project. I agree it would be good to eliminate it. See https://github.com/dotnet/arcade/search?q=IsWpfTempPRoject&unscoped_q=IsWpfTempProject The idea I've had to do that would be to do something like multi-targeting where we build the same csproj, but change some global properties. I don't think this can just be a target in the same project evaluation as some of the targets need to run twice IIRC. |
Looking at it a little closer, I'm not sure it's right to pin this on the temp project entirely. I assume the goal of those statements in D.B. props is to account for projects in the same directory and make sure they each get thier own output and intermediate directories? However, outting these underneath Here's a different case that will hit the same error.
Same errors:
|
Correct. In the real scenario I took this from, there are two projects in the directory (one old-style csproj targeting NetFX and one new one targeting NetCore). It's an interim solution to allow using VS designers (via the old project) while porting to Core (via the new project). To avoid the globbing problem, the new csproj includes an explicit remove for anything under out\oldProject ( Thinking about the temporary csproj, I can see how this could be an issue since the original project is removed but the temp project isn't. From the developer's point of view, though, they've excluded the only other csproj that should be using the \out\ directory, so it's a confusing problem. I think it's ok to expect developers to know that shared output folders can mess up globbing includes, but it's not a good experience to drop unexpected projects in that exacerbate the problem by also writing to those output locations. A couple other items that seem odd about this:
|
|
@nguerrera are you taking this bug? |
@ryalanms & I have been talking about ways to eliminate the temp project being created on the disk. It’s something he’d need to prototype to be sure that our intended approach would actually work... |
Repro steps
dotnet new wpf
Directory.Build.props
in project directory:dotnet build
dotnet publish -r win10-x64 --self-contained
Expected result
Publish succeeds
Actual result
Errors such as:
It looks like these errors are due to the generated files being generated in two separate paths (one from the RID-less
dotnet build
, and the other from thedotnet publish
with the RID specified), but both are being included in the WPF temporary generated project (likely because the Directory.Build.props intermediate path depends on the project name, which changes for the temporary project).The best fix is probably to stop generating a temporary project, and instead call a target in the main project, if that's possible.
FYI @nguerrera
Thanks to @mjrousos for reporting this
The text was updated successfully, but these errors were encountered: