Missing T4 Template

Jul 1, 2012 at 2:49 PM

Hi,

I'm new to Naked Objects MVC, and I'm developing my first app.

Following the manual, section 2.1.1 ("Create a new Model project"), in step 5 ("Add the Naked Objects custom T4 template, by invoking Add > New Item > Naked Objects > Default T 4 Template"), I can't find neither Naked Objects nor the template in the items.

What am I missing?

Thanks,

  Ury

Coordinator
Jul 2, 2012 at 9:16 AM

First thing to check:  in the dialog  for Add > New Item  are you looking under the right programming language (i.e. C#) ?

Assuming you are, and the 'Naked Objects' heading is not showing...

When you installed the Nuget package NakedObjects.ProgrammingModel (step 2), it should have also installed the dependent package NakedObjects.Ide  -  which is what installed the .  So the first thing is to check (via the NuGet package manager) that the latter package is indeed installed.

If that package did install OK, but the Naked Objects items are not showing, then check (via Windows Explorer) the following location:

Documents\Visual Studio 2010\Templates\ItemTemplates\Visual C#

There should be a Naked Objects folder in there, containing several zipped templates.  

Let us know, either way.

Jul 2, 2012 at 10:11 AM

Thanks Richard,

Please see inline.

richardpawson wrote:

First thing to check:  in the dialog  for Add > New Item  are you looking under the right programming language (i.e. C#) ?

Yes.  I tried from both [project context menu] > Add > New Item... and [model designer context menu] > Add Code Generation Item.

Assuming you are, and the 'Naked Objects' heading is not showing...

Correct.

When you installed the Nuget package NakedObjects.ProgrammingModel (step 2), it should have also installed the dependent package NakedObjects.Ide  -  which is what installed the .  So the first thing is to check (via the NuGet package manager) that the latter package is indeed installed.

Both installed.

If that package did install OK, but the Naked Objects items are not showing, then check (via Windows Explorer) the following location:

Documents\Visual Studio 2010\Templates\ItemTemplates\Visual C#

There should be a Naked Objects folder in there, containing several zipped templates.  

The zips are there.

Let us know, either way.

What's next?

 

Coordinator
Jul 2, 2012 at 10:24 AM

Then I'm thinking there is something strange about your Visual Studio set-up.  Please confirm which version of VS you are using and other platform details.  Also:

1. If you go Tools > Code Snippets Manager  & select 'Visual C#' then look under My Code Snippets, are you seeing the Naked Objects code snippets?

 

2. When you go [project context menu] > add > New Item > Installed Templates > Visual C# Items  -  what headings are you seeing?

Jul 2, 2012 at 10:44 AM

I'm using Visual Studio 2010 Ultimate with SP1 on Win7 x64.

1. Under Visual C# / My Code Snippets, the Naked Objects folder exists with snippets under it.

2. Code, Data, General, Web, Windows Forms, WPF, Reporting, tangible modeling tools, tangible T4 Editor, Workflow.

Coordinator
Jul 2, 2012 at 10:57 AM

OK try Tools > Options > Projects & Solutions > General  > User Items and Templates Location

My guess now is that that is not pointing at  Documents\Visual Studio 2010\Templates\ItemTemplates

Either change that location, or move the Naked Objects templates to where your VS expects them to be. 

Jul 2, 2012 at 11:19 AM

Yes!!  That was it.  The folder was D:\ "for some reason".  Changing it + a restart made the items available.

Thank you very much.