Error: The best overloaded method match for 'string.IsNullOrWhiteSpace(string)' has some invalid arguments

Topics: Customizing Orchard, General, Troubleshooting
Jan 14, 2013 at 7:36 PM

I get this error after uploading, not sure what could have caused it.

 

The best overloaded method match for 'string.IsNullOrWhiteSpace(string)' has some invalid arguments 
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: Microsoft.CSharp.RuntimeBinder.RuntimeBinderException: The best overloaded method match for 'string.IsNullOrWhiteSpace(string)' has some invalid arguments

Source Error: 


Line 12:     bool useBackgroundImages = Model.Group.ImageStyle == ImageStyle.Background;
Line 13: 
Line 14:     string backgroundColor = String.IsNullOrWhiteSpace(Model.Group.BackgroundColor) ? "transparent" : "#" + Model.Group.BackgroundColor.TrimStart('#');
Line 15:     string foregroundColor = "#" + Model.Group.ForegroundColor.TrimStart('#');
Line 16: }
 

Source File: c:\HostingSpaces\taxtitle\beta.taxtitleservices.com\wwwroot\Themes\TTS\Views\Parts.FeaturedItems.cshtml    Line: 14 
Developer
Jan 14, 2013 at 7:54 PM

I think you need to cast Model.Group.BackgroundColor to a string before passing it to that method.

Jan 14, 2013 at 8:00 PM

NVM, it was part of an old module...