Errors starting out

Dec 13, 2009 at 7:42 PM

I downloaded and installed the latest version of the T4 Toolbox for VIsual Studio 2010, in an attempt to create LINQ business objects, but I'm having some troubles with it. First, I was getting errors saying it couldn't find and T4Toolbox\ in my project directory, but that's not where they are installed. Am I to provide the absolute path to them in my template?

In trying to get this to work, I removed the files I added via the instructions, and added them again. This time the error changed to "File doesn't exist: "\XML\SCHEMAS\DBMLSCHEMA.XSD". I have populated the dbml file using the server explorer.

Both errors reference the same file, the "" file that I created from a Linq to SQL Model template in the Code Generation section in Visual Studio. They've also both generated the warning "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.", though switching the language attribute in the .tt file to "C#" cleared that up (and has had no effect on the errors I'm receiving). I've also got no color highlighting in the editor, though something tells me I just need to install a tool or something to get that to work. But I thought I'd mention these things in case they were relevant.

Dec 14, 2009 at 11:17 AM

Which versions of Visual Studio and T4 Toolbox are you using? Have you restarted Visual Studio after installing T4 Toolbox? What is the exact error you are getting now?


Dec 17, 2009 at 5:11 PM
Edited Dec 17, 2009 at 5:12 PM

I'm using Visual Studeio 2010 Beta 2 and T4Toolbox. Restarting Visual Studio seems to have worked, though I had to restart it after adding the generator to my project, not just after the toolbox was installed.

Dec 17, 2009 at 5:23 PM

Hmm... Nevermind. The error is back. It is File doesn't exist: C:\USERS\MIKE\DOCUMENTS\VISUAL STUDIO 2010\PROJECTS\WPFTEST\XML\SCHEMAS\DBMLSCHEMA.XSD.

My exact steps (after creating a brand new WPF application):

1. Added new LINQ to SQL Model named LTS.dbml.

2. Populated the DBML file with all of the tables in my database from Server Explorer.

3. Right-clicked and selected Run Custom Tool.


Initially, the error appears after step #1, but if I restart visual studio, it goes away and comes back after step #3. No files are generated by step #3.

I hope this is descriptive enough to solve the problem. I will provide more information as needed.

Dec 19, 2009 at 11:56 PM

I had the same problem and reported the bug and it's solution here.

Dec 20, 2009 at 12:51 PM

Great catch. I'll fix this in the nex/final 9.12 build.

Dec 21, 2009 at 1:18 PM

The fix is available in build 9.12:

Dec 22, 2009 at 11:51 PM

Thank you. Works great.

Dec 29, 2009 at 5:41 PM