Frage

Several of my ASP.NET MVC 2 (.NET 3.5) projects uses SubSonic 2 as it's primary database accessor in the data layer of the project. This works just fine and everything within the database is accessible with no problems. However, recently, my work has enforced a "zero warnings" policy and so we have been going through all of our projects to eliminate any warnings from our projects (where possible).

The projects in question have only SubSonic warnings left to either eliminate or suppress, however, these are found within the generated classes themselves, which makes removing them quite problematic. The warnings I am getting are as follows:

  • "... overrides Object.Equals(object o) but does not override Object.GetHashCode() ..." in ActiveRecord.cs
  • "... .Name' hides inherited member 'SubSonic.Schema.DatabaseTable.Name'. Use the new keyword if hiding was intended. ..." in Struct.cs
  • "Multiple template directives were found in the template. All but the first one will be ignored. Multiple parameters to the template directive should be specified within one template directive" in Settings.ttinclude
  • "Compiling transformation: The variable 'parameters' is assigned but its value is never used" in SQLServer.ttinclude
  • "The C# 2.0 and C# 3.5 compilers are no longer supported. Templates will always be compiled with the version 4 compiler instead of 'v3.5' as specified." in Context.tt

I have tried searching everywhere for solutions to these warnings but have had no luck so far. Has anyone else encountered such warnings and if so, how did you resolve them? Thank you.

War es hilfreich?

Lösung

You are not going to like this.

The only option that will solve your problems once and for all is to download the SubSonic sources, make the necessary changes to the templates, recompile and use your own binary instead of the stock download.

In the long run I strongly recommend ditching SubSonic entirely. It's not worth the pain.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top