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

net5.0-windows fails because of WPF/XAML bug #14

Closed
archi-Doc opened this issue Nov 23, 2020 · 5 comments
Closed

net5.0-windows fails because of WPF/XAML bug #14

archi-Doc opened this issue Nov 23, 2020 · 5 comments
Labels
wontfix This will not be worked on

Comments

@archi-Doc
Copy link

Hi,
I tried ThisAssenbly for a console app, and it worked perfectly.
But didn't work for a windows app.

error CS0103: The name 'ThisAssembly' does not exist in the current context

csproj file is

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>net5.0-windows</TargetFramework>
    <UseWPF>true</UseWPF>
    <LangVersion>9.0</LangVersion>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="ThisAssembly" Version="1.0.0" />
  </ItemGroup>

</Project>

Looks like ThisAssemly generates correct code and I can see the generated code, but windows app can't reference those code.

@kzu kzu added bug Something isn't working good first issue Good for newcomers wontfix This will not be worked on and removed bug Something isn't working good first issue Good for newcomers labels Nov 30, 2020
@kzu
Copy link
Member

kzu commented Nov 30, 2020

This is due to a bug in WPF: dotnet/wpf#3404.
The workaround is https://docs.microsoft.com/en-us/aspnet/core/grpc/troubleshoot?view=aspnetcore-3.0#wpf-projects-unable-to-generate-grpc-c-assets-from-proto-files (basically use a class library instead, quite the #fail).

Since this is not something we can fix in this project, I'm going to tentatively close it. Please do reopen if there is an actual fix at some point and we need to do something on this project.

Thanks!

@kzu kzu closed this as completed Nov 30, 2020
@kzu
Copy link
Member

kzu commented Nov 30, 2020

This search shields a potential manual workaround alternative for your own repo: https://github.com/dotnet/arcade/search?q=_WpfTempProjectNuGetFilePathNoExt

@archi-Doc
Copy link
Author

Thanks for the reply.
I'll wait for Microsoft to resolve this issue.

@springy76
Copy link

Doesn't work within Blazor(server) apps as well.

@kzu
Copy link
Member

kzu commented Jan 29, 2021

@springy76 could you link to the relevant MS issue on their side too, in case they are aware, so others can also track that as needed?

@kzu kzu changed the title net5.0-windows net5.0-windows fails because of WPF/XAML bug Jan 29, 2021
@devlooped devlooped locked and limited conversation to collaborators Sep 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

3 participants