Skip to content

Commit 2f5edf0

Browse files
Move generated AssemblyInfo.g.cs file into obj folder instead of project folder
1 parent 27e1434 commit 2f5edf0

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

common/Labs.Head.props

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,6 @@
2222

2323
<ItemGroup>
2424
<Compile Include="$(RepositoryDirectory)common\GlobalUsings_WinUI.cs" />
25-
26-
<!-- Auto Generated Below -->
27-
<Compile Include="$(MSBuildProjectDirectory)\AssemblyInfo.g.cs" />
2825
</ItemGroup>
2926

3027
<PropertyGroup>
@@ -68,7 +65,12 @@
6865
</PropertyGroup>
6966

7067
<!-- https://stackoverflow.com/questions/10980249/msbuild-task-for-setting-custom-attribute-in-assemblyinfo-cs -->
68+
<!-- https://gist.github.com/KirillOsenkov/f20cb84d37a89b01db63f8aafe03f19b -->
7169
<Target Name="AddAssemblyAttributes" BeforeTargets="BeforeBuild">
70+
<PropertyGroup>
71+
<GeneratedAssemblyInfoPath>$(IntermediateOutputPath)AssemblyInfo.g.cs</GeneratedAssemblyInfoPath>
72+
</PropertyGroup>
73+
7274
<ItemGroup>
7375
<!-- Add our own AssemblyInfo.cs standard attributes -->
7476
<AssemblyAttributes Include="AssemblyTitle">
@@ -126,7 +128,11 @@
126128
</AssemblyAttributes>
127129
</ItemGroup>
128130

131+
<ItemGroup>
132+
<Compile Include="$(GeneratedAssemblyInfoPath)" />
133+
</ItemGroup>
134+
129135
<!-- Write out new auto-generated AssemblyInfo.g.cs file -->
130-
<WriteCodeFragment Language="C#" OutputFile="AssemblyInfo.g.cs" AssemblyAttributes="@(AssemblyAttributes)" /> <!-- TODO: Not sure if we can tuck this away into a better folder or just obj/bin? -->
136+
<WriteCodeFragment Language="C#" OutputFile="$(GeneratedAssemblyInfoPath)" AssemblyAttributes="@(AssemblyAttributes)" />
131137
</Target>
132138
</Project>

0 commit comments

Comments
 (0)