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

How to specify assembly:ThemeInfo() with the new project system? #3588

Closed
lennartb- opened this issue May 28, 2018 · 2 comments
Closed

How to specify assembly:ThemeInfo() with the new project system? #3588

lennartb- opened this issue May 28, 2018 · 2 comments
Labels
Discussion/Question A discussion or question about the project that will not be treated as a bug or feature request.

Comments

@lennartb-
Copy link

I just migrated a pre-2017 csproj to the new 2017 format. I noticed that default styles specified in themes\generic.xaml were not automatically applied anymore, and after comparing to the old project found out that [assembly: ThemeInfo(ResourceDictionaryLocation.None, ResourceDictionaryLocation.SourceAssembly)] was omitted from the now auto-generated AssemblyInfo file. I know that you can add certain attributes, such as InternalsVisibleTo with an AssemblyAttribute in the csproj file, but apparently only strings are supported. Is it possible to somehow insert that without disabling GenerateAssemblyInfo (and continue using the normal AssemblyInfo)?

@davkean
Copy link
Member

davkean commented May 28, 2018

Assembly-level attributes can go in any file you want - you don't need to put them in a file called "AssemblyInfo.cs".

@davkean davkean added the Discussion/Question A discussion or question about the project that will not be treated as a bug or feature request. label May 28, 2018
@davkean davkean closed this as completed May 29, 2018
@psulek
Copy link

psulek commented Mar 13, 2023

Now (VS2022) you can do this:

<AssemblyAttribute Include="System.Windows.ThemeInfoAttribute">
	<_Parameter1>System.Windows.ResourceDictionaryLocation.None</_Parameter1>
	<_Parameter1_IsLiteral>true</_Parameter1_IsLiteral>
	<_Parameter2>System.Windows.ResourceDictionaryLocation.SourceAssembly</_Parameter2>
	<_Parameter2_IsLiteral>true</_Parameter2_IsLiteral>
</AssemblyAttribute>

Dont forget to add GenerateAssemblyInfo :

<PropertyGroup>
  <GenerateAssemblyInfo>true</GenerateAssemblyInfo>
</PropertyGroup>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Discussion/Question A discussion or question about the project that will not be treated as a bug or feature request.
Projects
None yet
Development

No branches or pull requests

3 participants