modelsbuilder / ModelsBuilder.Original

The Community Models Builder for Umbraco
MIT License
114 stars 49 forks source link

Bump Microsoft.CodeAnalysis version #102

Closed ryanlewis closed 8 years ago

ryanlewis commented 8 years ago

I've been squashing all the warnings in my project, and the following warning is my last remaining exception:

CSC : warning AD0001: Analyzer 'Microsoft.CodeAnalysis.CSharp.Analyzers.FixAnalyzers.CSharpFixerWithFixAllAnalyzer' threw an exception of type 'System.TypeInitializationException' with message 'The type initializer for 'Microsoft.CodeAnalysis.Analyzers.FixAnalyzers.FixerWithFixAllAnalyzer`1' threw an exception.'.

This appears to be an issue in 1.0.0 that has since been resolved. See https://github.com/dotnet/roslyn/issues/7276

zpqrtbnk commented 8 years ago

Are you trying to upgrade from Roslyn 1.0.0 to the next version?

ryanlewis commented 8 years ago

I've left Roslyn as it is in my project, just thought I'd leave an issue as a note. It's a very minor issue, of course.

zpqrtbnk commented 8 years ago

It's just... I'm not sure I understand what you are doing or what issue / situation your are facing.

You'll need to give me more details ;-)

ryanlewis commented 8 years ago

Apologies for the delay. The current Microsoft.CodeAnalysis.Analyzers package version used by Umbraco and the ModelsBuilder will result in compiler warnings in your solution. So, if you install Umbraco >=7.4 to your solution, you will get a compiler warning once compiled in Visual Studio. The warning is a result of the linked issue above.

1>------ Rebuild All started: Project: CodeAnalysisThrowaway, Configuration: Debug Any CPU ------
1>CSC : warning AD0001: Analyzer 'Microsoft.CodeAnalysis.CSharp.Analyzers.FixAnalyzers.CSharpFixerWithFixAllAnalyzer' threw an exception of type 'System.TypeInitializationException' with message 'The type initializer for 'Microsoft.CodeAnalysis.Analyzers.FixAnalyzers.FixerWithFixAllAnalyzer`1' threw an exception.'.
1>  CodeAnalysisThrowaway -> C:\dev\temp\CodeAnalysisThrowaway\CodeAnalysisThrowaway\bin\Debug\CodeAnalysisThrowaway.dll
========== Rebuild All: 1 succeeded, 0 failed, 0 skipped ==========

This compiler warning was a result of compiling https://github.com/ryanlewis/CodeAnalysisThrowaway.

I did a pass at removing all compiler warnings from my solution (removing unused variables, etc.) and this was the last remaining compiler warning.

Does this make more sense?

zpqrtbnk commented 8 years ago

My turn to apologize for the delay. So if I understand correctly, the ModelsBuilder depends on Microsoft.CodeAnalysis.CSharp.dll which contains some analyzers that run when your project builds, and fail, thus causing a warning that you'd like to get rid of?

If that is the case then the solution is to upgrade to Roslyn 1.x (the next, current version) and that is #106. Closing this issue, but re-open if necessary.