Developer forum

Forum » Templates » Error when eanbling code hinting

Error when eanbling code hinting

Stephen Anthony Jackson
Stephen Anthony Jackson
Reply

Hi. I have followed the codehinting instructions (Dynamicweb 9), to the letter, but I am enable to eliminate some last errors.

Its clear from the examples below, that its a Linq issue,but I installed System.Linq, reloaded project, rebuilt project, restarted VS etc. They dont go away.

Hope somene has an idea. Cheers

//Steve

Some examples

Severity Code Description Project File Line Suppression State
Error CS1061 'string[]' does not contain a definition for 'ToList' and no accessible extension method 'ToList' accepting a first argument of type 'string[]' could be found (are you missing a using directive or an assembly reference?) 5_Files_Templates_Designs_Swift_Paragraph_Swift_ProductSpecification.cshtml C:\DynamicWeb\Solutions\valvoline\Files\Templates\Designs\Swift\Paragraph\Swift_ProductSpecification.cshtml 24 Active
 
Severity Code Description Project File Line Suppression State
Error CS1955 Non-invocable member 'List<CategoryFieldViewModel>.Count' cannot be used like a method. 5_Files_Templates_Designs_Swift_Paragraph_Swift_ProductSpecification.cshtml C:\DynamicWeb\Solutions\valvoline\Files\Templates\Designs\Swift\Paragraph\Swift_ProductSpecification.cshtml 69 Active
 
Severity Code Description Project File Line Suppression State
Error CS1061 'List<FieldOptionValueViewModel>' does not contain a definition for 'FirstOrDefault' and no accessible extension method 'FirstOrDefault' accepting a first argument of type 'List<FieldOptionValueViewModel>' could be found (are you missing a using directive or an assembly reference?) 5_Files_Templates_Designs_Swift_Paragraph_Swift_ProductSpecification.cshtml C:\DynamicWeb\Solutions\valvoline\Files\Templates\Designs\Swift\Paragraph\Swift_ProductSpecification.cshtml 286 Active

Replies

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply

Hi Stephen

It is doable - but VS is not always easy.

  1. Clean the solution using VS Clean Solution option
  2. Close visual studio and delete /bin, /obj and /packages folders from your project root
  3. Delete the /.vs folder (might be hidden so you cannot see it) - enter the location in your file explorer - in my installation it looks like 'C:\Git\Swift\Swift\.vs\'

You might also be able to use this plugin: https://marketplace.visualstudio.com/items?itemName=PeterMacej.ClearSolutionIntelliSenseCache

Also - ensure the project is configured to use the correct C# version - default swift project is.

Clean solution:

My ToString() intellisense on Swift.

 

You must be logged in to post in the forum