@@ -128,27 +128,22 @@ public void InnerExecute()
128128
129129 void CreateTempAssemblyInfo ( CachedVersion semanticVersion , Config configuration )
130130 {
131- var assemblyInfoBuilder = new AssemblyInfoBuilder
132- {
133- CachedVersion = semanticVersion
134- } ;
135- var assemblyInfo = assemblyInfoBuilder . GetAssemblyInfoText ( configuration ) ;
136131
137- string tempFileName ;
138- string tempDir ;
139132 if ( IntermediateOutputPath == null )
140133 {
141- tempDir = TempFileTracker . TempPath ;
142- tempFileName = string . Format ( "AssemblyInfo_{0}_{1}.g.cs" , Path . GetFileNameWithoutExtension ( ProjectFile ) , Path . GetRandomFileName ( ) ) ;
134+ var tempFileName = string . Format ( "AssemblyInfo_{0}_{1}.g.cs" , Path . GetFileNameWithoutExtension ( ProjectFile ) , Path . GetRandomFileName ( ) ) ;
135+ AssemblyInfoTempFilePath = Path . Combine ( TempFileTracker . TempPath , tempFileName ) ;
143136 }
144137 else
145138 {
146- tempDir = Path . Combine ( IntermediateOutputPath , "obj" , assemblyInfo ) ;
147- Directory . CreateDirectory ( tempDir ) ;
148- tempFileName = string . Format ( "GitVersionTaskAssemblyInfo.g.cs" ) ;
139+ AssemblyInfoTempFilePath = Path . Combine ( IntermediateOutputPath , "GitVersionTaskAssemblyInfo.g.cs" ) ;
149140 }
150141
151- AssemblyInfoTempFilePath = Path . Combine ( tempDir , tempFileName ) ;
142+ var assemblyInfoBuilder = new AssemblyInfoBuilder
143+ {
144+ CachedVersion = semanticVersion
145+ } ;
146+ var assemblyInfo = assemblyInfoBuilder . GetAssemblyInfoText ( configuration ) ;
152147 File . WriteAllText ( AssemblyInfoTempFilePath , assemblyInfo ) ;
153148 }
154149 }
0 commit comments