Comments (15)
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.
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.
@riverar I already have started an email thread with a couple folks. Waiting on responses.
from cswin32.
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.
@MSLukeWest is this an area you own as well?
from cswin32.
Am seeing same issue across WPF and WAProj (Packaging Project) too. It's like the source generators aren't running at all.
from cswin32.
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.
@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.
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.
Here's a repro that includes wapproj.
CsWin32WaprojDeployRepro.zip
- Select the packaging project
- Project > Publish > Create app packages
- Complete the wizard (Sideloading > Skip signing > x86 + x64 + arm64 > Installer URI https://example.org > Create
- 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.
@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.
@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.
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 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.
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)
- APPBARDATA should compile on AnyCPU HOT 2
- CsWin32 should avoid Unsafe.SkipInit when it doesn't exist in the compilation HOT 1
- WlanOpenHandle doesn't support SafeHandle HOT 1
- The API "Gdi32" is ambiguous HOT 4
- Add `GET_WHEEL_DELTA_WPARAM` macro
- `TASKDIALOGCONFIG.pfCallback` should use associated enum for `msg` parameter
- Broken `VariableLengthInlineArray<T>` after upgrade from 0.3.49-beta to 0.3.106 HOT 8
- NetFramework - Unsafe.SkipInit(out T value) unavailable HOT 3
- Inconsistent const in parameters of RmRegisterResources HOT 9
- LocalExternFunctions should use `DefaultDllImportSearchPaths`
- Code Quality: Use `WinMdRoot` instead of `winmdroot` to supress CS8981 (type name is ASCII lowercase only) HOT 5
- `PCWSTR` is not marked with `[GeneratedCode]`
- Many Win32 structs (HDC, HMONITOR, etc.) lack the IntPtr conversion operator.
- "Pointers cannot reference marshaled structures. Use ByRef instead" caused by VariableLengthInlineArray
- Latest WDK metadata fails to create DEVPKEY field
- Daily nuget feed not updating HOT 1
- MFTEnumEx signature incorrect
- `VirtualFreeEx` missing HOT 1
- Missing NtCreateThread and NtCreateThreadEx functions HOT 1
- Add an analyzer to catch inadvertent ephemeral delegates HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cswin32.