简体   繁体   中英

Visual studio build errors — tell VS to omit namespaces

I am cleaning up some build errors in my C# project. VS always gives the fully qualified namespace of every object in its build errors, like this:

Cannot implicitly convert type 'System.Action<Jockusch.Calculator.Core.Expressions.Wrappers.Wrapper,Jockusch.Calculator.Core.Expressions.Wrappers.Wrapper>' to 'System.Func<Jockusch.Calculator.Core.Expressions.Wrappers.Wrapper,Jockusch.Calculator.Core.Expressions.Wrappers.Wrapper,Jockusch.Calculator.Core.Expressions.Wrappers.Wrapper>' '

It would be a lot easier to see what is going on if it left out the namespaces, like this:

Cannot implicitly convert 'Action<Wrapper,Wrapper>' to 'Func<Wrapper,Wrapper,Wrapper>'

Is there a way to tell it to do that? I tried setting the build output verbosity to quiet, but that didn't help.

The only safe identifier of a type is its full qualified name. If the compiler were to omit namespaces then there would be a high chance that the error text is not specific enough. There is for example nothing that prevents you from having multiple types of the same name in different namespaces. But you can't have two types with the same full qualified name.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM