Comments (17)
Seems duplicate to this: dotnet/roslyn#46300
from cswin32.
Just confirming that 0.1.370-beta works great with WinUI 3. Thank you!
from cswin32.
I am not familiar with WinUI 3. But the symptoms are very similar to #7. Can you try the workaround documented there to see if it helps? Otherwise, we may need to move your bug to the WinUI team.
from cswin32.
No, the workaround for #7 doesn't work here.
Seems that WinUI invokes legacy roslyn somehow.
from cswin32.
@huoyaoyuan Where can I get this WinUI project template you're talking about so I can test it? Any idea where we can file issues against it?
from cswin32.
https://github.com/microsoft/microsoft-ui-xaml
https://aka.ms/winui3/preview3-download
I can open issue myself there. They have been incompatible with several compiling stuff like dotnet build
, <Nullable>enable</Nullable>
.
If you have internal contacts, you may ask them about their interaction with roslyn and msbuild team. Thanks.
from cswin32.
I'm successfully using this with WinUI3. I've used this to have my WinUI3 app generate a tray icon, and clicking the tray icon will bring the WinUI3 window to the top.
Are you targeting Win32 or UWP?
from cswin32.
I'm targeting Win32.
from cswin32.
OK this is odd. Just created a new project and hit the same thing while compiling:
from cswin32.
Investigating some more: The reason it worked for me was I was building a class library. But the moment I add XAML to that class library, this error occurs.
from cswin32.
Yes. The #nullable
issue occurs too when I add XAML. So I suspect they have the same root cause.
from cswin32.
Seems like the XamlPrecompile
step isn't including the generated files, and thus fails:
from cswin32.
OK. So if XamlPrecompile
invokes csc with custom command line and may not respect csproj
, it's reasonable to report warning for no <Nullable>enable</Nullable>
.
from cswin32.
Not sure if this has already been mentioned, but it seems this is not specific to WinUI 3 - I get the same exact error when trying to use a source generator that interacts with a XAML-related file in any way on vanilla UWP (SDK 19041) as well 🤔
from cswin32.
@Sergio0694 Yes agreed. Not specific to this. It should probably be moved to the WinUI repo
from cswin32.
Some investigations led to dotnet/msbuild#6096, which may fix the WinUI problem.
from cswin32.
@AArnott That helps some.
As mentioned in email "offline", the code generator need to prefix usings with global::
or it'll clash with WinUI. (props to @chsienki for discovering this)
from cswin32.
Related Issues (20)
- Regression with `ReadFile` and `WriteFile` for `SafeHandle` HOT 1
- when wideCharOnly is true (default) specifying explicit ascii prefixed functions in NativeMethods.txt will result in it silently ignored
- IncludeAssets=all advice causes problems with NuGet packages HOT 7
- Why is `SHGetStockIconInfo` function is not supported by generator? HOT 1
- PROCESS_MITIGATION_REDIRECTION_TRUST_POLICY (I assume most PROCESS_MITIGATION_*) structs not fully generated HOT 2
- Using cswin32 projected types in class libraries results in CS0051 Inconsistent accessibility HOT 3
- CS8785 due to missing `System.Text.Encodings.Web` assembly in Dev16.11 HOT 4
- Size calculation with VariableLengthInlineArrays / More docs HOT 4
- GetModuleHandle with null parameter. HOT 2
- `FindFirstFileExFromApp` generate `void*` at `lpFindFileData` HOT 1
- How to create instance for `IDesktopWallpaper` COM interface HOT 3
- Add EntryPoint #865 IsElevationRequired HOT 1
- CS8785 when adding a locally built copy of Windows.Win32.winmd HOT 4
- structs with VariableLengthInlineArray and SizeOf(0) HOT 4
- CsWin32 generates `SafeHandle` parameter for `LPPROC_THREAD_ATTRIBUTE_LIST` in `CreateRemoteThreadEx` HOT 6
- SafeHandle overload should be generated for functions with `out` parameters HOT 5
- SetupDiGetDeviceInterfaceDetail() throws MashalDirectiveException "Pointers cannot reference marshaled structures" HOT 7
- COM Out arguments in DXGI/D3D11 are suddenly unmanaged HOT 4
- Publish WPF Desktop App not possible HOT 15
- IShellItemImageFactory.GetImage should return HRESULT HOT 1
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.