how to open the T4 ToolBox source code

Aug 13, 2009 at 5:18 PM

Oleg --

Please help.

How can one open the T4 ToolBox source code?


The short story is this...

I tried to open the source but ran into trouble because VS.NET complained about project types, imports, and other things.


The long story is this...

Regarding this...

>>>T4 toolbox assumes that every output file is generated every time... A change in the core output management functionality is necessary to make this work...

...OK, that is fine, so I went to look at the source, which might be fun so...

...I went to this link...

http://t4toolbox.codeplex.com/SourceControl/ListDownloadableCommits.aspx

...and then I clicked >LatestVersion, >Download, and I go this file...

C:\Code\Test\t4toolbox-36062.zip

...I unzipped that file, and tried to open this Solution file...

C:\Code\Test\t4toolbox-36062\Source\T4Toolbox.sln

...but I VS.NET 2008 Standard gave me these errors...

Microsoft Visual Studio -- 'C:\Code\Test\t4toolbox-36062\Source\Installer\Installer.wixproj' cannot be opened because its project type (.wixproj) is not supported by this version of the application. -- To open it, please use a version that supports this type of project.

Microsoft Visual Studio -- Unable to read the project file 'T4Toolbox.csproj'. -- C:\Code\Test\t4toolbox-36062\Source\T4Toolbox.csproj(140,11): The imported project "C:\WINDOWS\Microsoft.NET\Framework\v3.5\ Microsoft.Sdc.Common.tasks" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.

Microsoft Visual Studio -- The project file 'C:\Code\Test\t4toolbox-36062\Source\Tests\T4Toolbox.Test.csproj' cannot be opened. -- The project type is not supported by this installation.

...so I am stuck.

Please advise.

Thank you.

-- Mark Kamoski

Coordinator
Aug 13, 2009 at 6:37 PM

Mark,

Thanks for looking into this. Here is how to download and compile the T4 toolbox source code: http://www.olegsych.com/2009/06/getting-and-compiling-t4-toolbox-source-code/

If you are getting the latest version of the code, you will also need to install Sandcastle Help File Builder which you can download here on CodePlex.

Oleg

Aug 13, 2009 at 8:48 PM
olegsych wrote:

...Here is how to download and compile the T4 toolbox source code: http://www.olegsych.com/2009/06/getting-and-compiling-t4-toolbox-source-code/

If you are getting the latest version of the code, you will also need to install Sandcastle Help File Builder which you can download here on CodePlex.

Oleg --

The ZIP file...
SourceSetupIssues200908131637.zip
...details some setup issues that I had when trying to open the Solution as of 04:45 PM 08/13/2009; so, I uploaded in the Patches section because there are some images for reference and Control-C did not copy that text.

I followed the environment setup and I think all went well.

This is file that I was trying to open...
C:\Code\Test\t4toolbox-36062\Source\T4Toolbox.sln

The file...
T4 Source Control Binding Removal Warning 200908131628.PNG
...shows a source control warning, probably unavoidable, but it is simple to address by "permanently removing" and it is worth mentioning.

The file...
T4 Csproj Cannot Be Opened Error 200908131627.PNG
...seems a bit problematic in that a csproj file cannot be opened by VS.NET 2008 Standard.

The file...
T4 Source Appears Under Control Warning 200908131625.PNG
...is a simple warning and probably unavoidable but certainly worth mentioning.

After all that, the project did load (kind of) but would not compile.

These are the CTE that I got.

Error 1 The type or namespace name 'TestTools' does not exist in the namespace 'Microsoft.VisualStudio' (are you missing an assembly reference?) C:\Code\Test\t4toolbox-36062\Source\TransformationAssert.cs 11 34 T4Toolbox

Error 2 The type or namespace name 'TestTools' does not exist in the namespace 'Microsoft.VisualStudio' (are you missing an assembly reference?) C:\Code\Test\t4toolbox-36062\Source\TestRunner.cs 14 34 T4Toolbox

Warning 3 Could not resolve this reference. Could not locate the assembly "Microsoft.VisualStudio.QualityTools.UnitTestFramework, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. T4Toolbox

Warning 4 The referenced component 'Microsoft.VisualStudio.QualityTools.UnitTestFramework' could not be found.  

It has been stated that Microsoft.VisualStudio.QualityTools.UnitTestFramework cannot be used without some form of Team System installed, as per this link...

http://social.msdn.microsoft.com/Forums/en-US/vstsstart/thread/86a41b1d-8e8b-4904-a147-767eba737591

So, without Team System, maybe I am stuck-- unless I can somehow exclude the tests.

What do you think?

Please advise.

Thank you.

-- Mark Kamoski

Coordinator
Aug 13, 2009 at 9:18 PM

Do you have access to Professional edition of Visual Studio?

Aug 13, 2009 at 10:56 PM
On Aug 13, 2009, at 5:18 PM, "olegsych" <notifications@codeplex.com>
wrote:

> From: olegsych
>
> Do you have access to Professional edition of Visual Studio?
>
UNFORTUNATELY, NO.

IT IS A LOW BUDGET SHOP AT WORK.

I HAVE IT AT HOME THOUGH, IF THAT HELPS.
Coordinator
Aug 14, 2009 at 10:16 AM

I have been using VSTS for a while now. However, the Unit test framework is included in Visual Studio 2008 Professional, so you should be compile T4Toolbox with it.

Aug 14, 2009 at 12:57 PM
Oleg --

Regarding this...

>>>the Unit test framework is included in Visual Studio 2008 Professional, so you should be compile T4Toolbox with it

...that is not so good news for me.

At home, where I have VS.NET 2008 Professional, my development time is virtually zero, because of family stuff-to-do, etc.

At work, where I have VS.NET 2008 Standard, my development time is 8+ hours a day, 5 days a week.

As such, this probably disqualifies me from participating in the code-enhancement-- but, I will try, on the off-chance that I can find some time to do something.

That said, I am making an end-to-end sample, using T4 ToolBox, Smo, Northwind, which I will upload if and when I finish it.

That said, I have been re-thinking my design a lot, along the lines of Generate-Only-If-Not-Existing. My motivation for having Generate-Only-If-Not-Existing was that I want a Generate-Every-Time abstract base class and a Generate-Only-If-Not-Existing derived class. However, it turns out the some tools I use, (Nunit and Kellerman Nunit Test Generator) do not like the base class to be abstract, in general. As such, I made my base class concrete. As such, that is not any different than simply using partial classes rather than an inheritance approach. As such, I do not need the Generate-Only-If-Not-Existing. And, even if I do want a Generate-Only-If-Not-Existing file, that is just a one-time time-savings, which makes it far less important. At least, that's what I think now.

HTH.

Thank you.

-- Mark Kamoski
Aug 14, 2009 at 5:09 PM

Oleg --

I tried an experiment.

I removed the project "T4Toolbox.Text" from the Solution and compiled.

I got a few warnings and CTEs on TestingAssert XML comments, etc, so I just removed those comments and using statements, and I removed the reference to the UnitTestFramework etc.

Then it built.

Is that "working"?

If I have time, would it be helpful to make a minor tweak (which I hope is all it will take) and upload a "changed method" or a "changed class" as a patch?

Please advise.

Thank you.

-- Mark Kamoski

Aug 14, 2009 at 7:08 PM

Oleg --

Please help.

I have yet more development-related questions.

Is it true that when one builds the T4 Toolbox source on one's machine that compilation process puts that T4 Toolbox DLL into the GAC on that machine?

If yes, then when one is done working with the source code, should one revert to the latest-and-greatest released version of T4 Toolbox, to be safe?

Please advise.

Thank you.

-- Mark Kamoski

Coordinator
Aug 14, 2009 at 10:40 PM

>> Is that "working"?

As long as you can compile and test your changes, I have no problem with this approach. We wouldn't want you to check in the hacked-up version of the project, of course.

>> Is it true that when one builds the T4 Toolbox source on one's machine that compilation process puts that T4 Toolbox DLL into the GAC on that machine?

Yes, to make debugging cycles shorter.

>> If yes, then when one is done working with the source code, should one revert to the latest-and-greatest released version of T4 Toolbox, to be safe?

Yes.

Aug 17, 2009 at 7:33 PM
Edited Aug 17, 2009 at 7:57 PM
olegsych wrote:

...As long as you can compile and test your changes, I have no problem with this approach. We wouldn't want you to check in the hacked-up version of the project, of course.

Oleg --

The good news is that I did find one thing out. It IS, in fact, possible to run the code without the 'Microsoft.VisualStudio.QualityTools.UnitTestFramework', etc, as discussed above. All that is necessary is to remove the tests (maybe they could be in a separte project next time? or an isolated folder? for easier removal from the Solution), and delete a few top-of-the-class "using" statements (which may not be necssary anyway).

The bad news is that my attempts to make a change have thus far failed, as detailed in the relevant thread...

how to create an output file only if it does not exist

...at the link...

http://t4toolbox.codeplex.com/Thread/View.aspx?ThreadId=64868

Thank you.

-- Mark Kamoski