@@ -50,22 +50,27 @@ public async Task McpServerJson_VersionStamping()
5050}
5151""" ;
5252
53- string serverJsonPath = Path . Combine ( this . projectDirectory , "server.json" ) ;
53+ string serverJsonPath = Path . Combine ( this . projectDirectory , ".mcp" , "server.json" ) ;
54+ Directory . CreateDirectory ( Path . Combine ( this . projectDirectory , ".mcp" ) ) ;
5455 File . WriteAllText ( serverJsonPath , serverJsonContent ) ;
5556
5657 // Set PackageType to McpServer
5758 ProjectPropertyGroupElement propertyGroup = this . testProject . CreatePropertyGroupElement ( ) ;
5859 this . testProject . AppendChild ( propertyGroup ) ;
5960 propertyGroup . AddProperty ( "PackageType" , "McpServer" ) ;
6061
62+ this . testProject . AddItem ( "None" , @".mcp\server.json" , new Dictionary < string , string > { [ "Pack" ] = "true" , [ "PackagePath" ] = "/.mcp/" } ) ;
63+
6164 this . WriteVersionFile ( ) ;
6265 BuildResults result = await this . BuildAsync ( "NBGV_StampMcpServerJson" , logVerbosity : LoggerVerbosity . Detailed ) ;
6366
6467 // Verify the build succeeded
6568 Assert . Empty ( result . LoggedEvents . OfType < BuildErrorEventArgs > ( ) ) ;
6669
6770 // Verify the stamped server.json was created
68- string stampedServerJsonPath = Path . Combine ( this . projectDirectory , result . BuildResult . ProjectStateAfterBuild . GetPropertyValue ( "IntermediateOutputPath" ) , "server.json" ) ;
71+ string stampedServerJsonPath = result . BuildResult . ProjectStateAfterBuild . GetItems ( "None" )
72+ . Single ( pi => $ "{ pi . GetMetadataValue ( "FileName" ) } { pi . GetMetadataValue ( "Extension" ) } " == "server.json" )
73+ . GetMetadataValue ( "FullPath" ) ;
6974 Assert . True ( File . Exists ( stampedServerJsonPath ) , $ "Expected stamped server.json at: { stampedServerJsonPath } ") ;
7075
7176 // Verify the version was correctly stamped
0 commit comments