File tree Expand file tree Collapse file tree
src/PackageReferenceVersionToAttributeExtension Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -150,11 +150,10 @@ jobs:
150150 uses : actions/upload-artifact@v4
151151 # https://github.com/marketplace/actions/upload-a-build-artifact
152152 with :
153- name : PackageReferenceVersionToAttributeExtension -${{ env.VERSION }} ${{matrix.Configuration}}
153+ name : PackageReferenceVersionToAttribute -${{ env.VERSION }} ${{matrix.Configuration}}
154154 path : |
155155 .\src\PackageReferenceVersionToAttributeExtension\bin\${{matrix.Configuration}}\PackageReferenceVersionToAttributeExtension.vsix
156156 .\src\PackageReferenceVersionToAttributeTool\bin\${{matrix.Configuration}}\PackageReferenceVersionToAttribute.Tool.${{ env.SEM_VERSION }}.nupkg
157- if-no-files-found : error
158157
159158 - name : Publish GitHub Release
160159 if : ${{ matrix.Configuration == 'Release' && github.event.inputs.publishVsix == 'true' }}
@@ -174,7 +173,7 @@ jobs:
174173 run : dotnet nuget push .\src\PackageReferenceVersionToAttributeTool\bin\${{matrix.Configuration}}\PackageReferenceVersionToAttribute.Tool.${{ env.SEM_VERSION }}.nupkg --api-key ${{ secrets.NUGET_KEY }} --source https://api.nuget.org/v3/index.json
175174
176175 - name : Publish to Open VSIX
177- if : ${{ matrix.Configuration == 'Release' && github.event_name != 'pull_request' && (github.event.inputs.skipPublishNupkg == '' || github.event.inputs.skipPublishNupkg == 'false ') }}
176+ if : ${{ matrix.Configuration == 'Release' && github.event_name != 'pull_request' && (github.event.inputs.publishVsix == 'true ') }}
178177 run : |
179178 [Reflection.Assembly]::LoadWithPartialName("System.Web") | Out-Null
180179 $vsixFile = ".\src\PackageReferenceVersionToAttributeExtension\bin\${{matrix.Configuration}}\PackageReferenceVersionToAttributeExtension.vsix"
Original file line number Diff line number Diff line change 11# Change Log
22
3+ ## v1.0.1108.39 (November 8<sup >th</sup >, 2024)
4+
5+ - Fixed issue where the extension would create multiple output window panes
6+ - Fixed issue where exceptions were not being written to the output window pane
7+ - Fixed issue when trying to get the file name of unloaded projects
8+
39## v1.0.1105.37 (November 5<sup >th</sup >, 2024)
410
511- Added support for converting projects within sln files on the command line
Original file line number Diff line number Diff line change 55namespace PackageReferenceVersionToAttributeExtension . Logging
66{
77 using System ;
8+ using Microsoft . Extensions . DependencyInjection ;
89 using Microsoft . Extensions . Logging ;
910 using PackageReferenceVersionToAttributeExtension . Services ;
1011
@@ -13,9 +14,20 @@ namespace PackageReferenceVersionToAttributeExtension.Logging
1314 /// </summary>
1415 internal sealed class CustomLoggerProvider : ILoggerProvider , IDisposable
1516 {
17+ private readonly IServiceProvider serviceProvider ;
18+
19+ /// <summary>
20+ /// Initializes a new instance of the <see cref="CustomLoggerProvider"/> class.
21+ /// </summary>
22+ /// <param name="serviceProvider">The service provider.</param>
23+ public CustomLoggerProvider ( IServiceProvider serviceProvider )
24+ {
25+ this . serviceProvider = serviceProvider ;
26+ }
27+
1628 /// <inheritdoc/>
1729 public ILogger CreateLogger ( string categoryName )
18- => new OutputWindowLogger ( ) ;
30+ => this . serviceProvider . GetRequiredService < OutputWindowLogger > ( ) ;
1931
2032 /// <inheritdoc/>
2133 public void Dispose ( )
Original file line number Diff line number Diff line change @@ -35,6 +35,10 @@ public void Log<TState>(
3535 if ( formatter != null )
3636 {
3737 var message = formatter ( state , exception ) ;
38+ if ( exception != null )
39+ {
40+ message += " " + exception . ToString ( ) ;
41+ }
3842
3943 try
4044 {
Original file line number Diff line number Diff line change @@ -65,6 +65,7 @@ protected override void InitializeServices(IServiceCollection services)
6565 . AddSingleton < BaseCommand > ( )
6666 . AddSingleton < ProjectService > ( )
6767 . AddSingleton < ProjectConverter > ( )
68+ . AddSingleton < OutputWindowLogger > ( )
6869 . AddLogging ( configure =>
6970 {
7071 configure . ClearProviders ( ) ;
Original file line number Diff line number Diff line change 44
55namespace PackageReferenceVersionToAttributeExtension . Services
66{
7+ using System ;
78 using System . IO ;
89 using System . Linq ;
910 using System . Threading . Tasks ;
@@ -42,7 +43,18 @@ public async Task CheckOutFileAsync(string filePath)
4243 && ( ! this . dte . Solution . Projects . Cast < Project > ( ) . Any ( x =>
4344 {
4445 ThreadHelper . ThrowIfNotOnUIThread ( ) ;
45- return x . FileName == filePath ;
46+
47+ try
48+ {
49+ return x . FileName == filePath ;
50+ }
51+ catch ( NotImplementedException ex )
52+ {
53+ // ex. an unloaded project has type DteGenericProject
54+ // ex. Exception thrown: 'System.NotImplementedException' in Microsoft.VisualStudio.CommonIDE.dll
55+ this . logger . LogWarning ( ex , $ "Failed to get file name for project '{ x . Name } '.") ;
56+ return false ;
57+ }
4658 } ) ) ) )
4759 {
4860 return ;
You can’t perform that action at this time.
0 commit comments