Git Product home page Git Product logo

Comments (15)

AArnott avatar AArnott commented on July 18, 2024 1

Yes, that's what's happening IIRC. At least for wapproj packaging, it had some really weird way of building the referenced project that blocked source generators from running. So ultimately, this isn't a CsWin32 bug at all -- It's just that Cswin32 is the first source generator used by some of these users so it got the blame. :|

from cswin32.

BennyBread avatar BennyBread commented on July 18, 2024 1

Thanks to mention "dotnet publish". I just managed to publish my real project. Yay!! 🥇 💯

The sample project also publishes without problems using this command line:

dotnet publish WpfCsWin32PublishApp.sln -f net8.0-windows -r win-x64 -o .\publish -p:PublishSingleFile=true --no-self-contained -p:PublishReadyToRun=true

But it would of course be very desirable for most users if this would also work via VS IDE... ;-)

from cswin32.

AArnott avatar AArnott commented on July 18, 2024 1

@riverar I already have started an email thread with a couple folks. Waiting on responses.

from cswin32.

BennyBread avatar BennyBread commented on July 18, 2024

I have created a small sample app in this repo to reproduce the issue: WpfCsWin32PublishApp

I am NOT trying to publish an Appx Package, just a simple publish to folder..

from cswin32.

AArnott avatar AArnott commented on July 18, 2024

@MSLukeWest is this an area you own as well?

from cswin32.

riverar avatar riverar commented on July 18, 2024

Am seeing same issue across WPF and WAProj (Packaging Project) too. It's like the source generators aren't running at all.

from cswin32.

riverar avatar riverar commented on July 18, 2024

Re: aforementioned issue, interestingly, publish outside VS IDE (e.g., MSBuild with VS and dotnet SDK) work fine. Starting to wonder if it's a VS IDE bug?

Re: Waproj, yeah. It's old junk sadly.

from cswin32.

MSLukeWest avatar MSLukeWest commented on July 18, 2024

@AArnott No, since this repro doesn't involve wapproj it's not something that's owned by my team. The build portion would be the dotnet sdk team.

However, I can tell you that the best way of investigating the root cause of an issue that repros when doing a publish in the IDE but not a 'dotnet publish'. I recommend installing this extension: https://marketplace.visualstudio.com/items?itemName=VisualStudioProductTeam.ProjectSystemTools2022, then turn on build logging and do the publish. You'll likely see that the 'publish' step is broken into a restore build and a publish build (based on what's in the publish profile), and you'll have a .binlog file for the failing publish.

from cswin32.

riverar avatar riverar commented on July 18, 2024

Removing AnyCPU from <Platforms> (or adding an explicit <Platforms> with non-AnyCPU targets) from the repro project above seems to alleviate the issue. So it's some weird handling--waves hands--around there.

from cswin32.

riverar avatar riverar commented on July 18, 2024

Here's a repro that includes wapproj.
CsWin32WaprojDeployRepro.zip

  1. Select the packaging project
  2. Project > Publish > Create app packages
  3. Complete the wizard (Sideloading > Skip signing > x86 + x64 + arm64 > Installer URI https://example.org > Create
  4. Observe error in Error List / Output window:
The name 'Windows' does not exist in the current context [...]
X:\CsWin32DeployRepro\WpfApp\MainWindow.xaml.cs	

from cswin32.

riverar avatar riverar commented on July 18, 2024

@MSLukeWest Is this something you can help investigate? I tried filing a VS Community bug but the site is broken and isn't allowing new submissions.

from cswin32.

riverar avatar riverar commented on July 18, 2024

@AArnott Would be great if you could help get some eyeballs on this. As it stands, no one can use the packaging project with CsWin32. I'm hard blocked on this 😢

Potentially dupe of #560 (comment)

from cswin32.

AArnott avatar AArnott commented on July 18, 2024

Here's a repro that includes wapproj.
CsWin32WaprojDeployRepro.zip

@riverar your repro zip crashes 7-Zip and Windows Explorer when I open it. Any idea why?

Also, you say it includes "wapproj" but the zip itself is named for "waproj" (only one 'p'). It turns out from what I understand, both of those are real and distinct project types. Which one are you struggling with?

from cswin32.

riverar avatar riverar commented on July 18, 2024

@riverar your repro zip crashes 7-Zip and Windows Explorer when I open it. Any idea why?

Probably the OS, here's a GitHub repo instead. https://github.com/riverar/3096bc50ded7

Also, you say it includes "wapproj" but the zip itself is named for "waproj" (only one 'p'). It turns out from what I understand, both of those are real and distinct project types. Which one are you struggling with?

Windows Application Packaging Project (wapproj).

I posted a workaround in #560 (comment) so if you want to keep this issue distinct for non-wapproj issues, happy to move the discussion there.

from cswin32.

AArnott avatar AArnott commented on July 18, 2024

if you want to keep this issue distinct for non-wapproj issues, happy to move the discussion there.

Yes, please.

from cswin32.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.