Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3210840
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T14:37:43+00:00 2026-05-17T14:37:43+00:00

I’m having a problem with T4MVC losing the code it generated each time I

  • 0

I’m having a problem with T4MVC losing the code it generated each time I do an SVN update. I can fix it by deleting the .generated.cs files and re-running the template. But this is proving a bit tiresome. Is there something I am missing?


First a little background information …

I am using C# v4, VS2010 and ASP.NET MVC2. I use subversion for my source control. I am also running a number of add-ins and extensions within VS2010 …

  • Huagati DBML.EDMX Tools
  • Zippy.Chirp (for auto running the T4MVC template)
  • Resharper v5
  • Visual SVN
  • Align Assignments
  • ASP.NET OpenID web site
  • Brace Completer (disabled)
  • Code4Blog
  • devColor
  • Highlight all occurrences of selected word (disabled)
  • HTML Spell Checker (disabled)
  • Lipsum 2010 – Lorem Ipsum Generator
  • PowerCommands for Visual Studio 2010
  • Productivity Power Tools
  • Spell Checker (disabled)
  • Visual Studio Background Customizer
  • Visual Studio Color Theme Editor
  • VS10x Code Marker
  • World of VS Default Browser Switcher

I’m actually writing this question as update my working copy and capturing what I can at each stage…

Step 1

I’ve opened up my IDE to start my work for the day and I already have 4 compiler warnings before I’ve even updated my working copy…

Warning 1 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. C:\Data Files\Projects\Web\ByBox.Vanventory\ByBox.Vanventory\T4MVC.tt 18 4  
Warning 2 Compiling transformation: Unreachable code detected c:\Users\antony\AppData\Local\Temp\z04plrve.0.cs 1015 17  
Warning 3 Compiling transformation: Assuming assembly reference 'EnvDTE, Version=7.0.3300.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' matches 'EnvDTE, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a', you may need to supply runtime policy C:\Data Files\Projects\Web\ByBox.Vanventory\ByBox.Vanventory\T4MVC.tt 1 1  
Warning 4 Compiling transformation: Unreachable expression code detected c:\Data Files\Projects\Web\ByBox.Vanventory\ByBox.Vanventory\T4MVC.tt 968 33

Step 2

I’m now updating my working copy by right clicking on the root node in my solution explorer and selecting Update from the Visual SVN part of the context menu.

I have Tree conflicts on most of my .generated.cs files…

  • HomeController.generated.cs (Tree conflict)
  • T4MVC.cs (Tree conflict)
  • T4MVC.ExplicitExtensions.cs (Deleted, Added)
  • GoodsInController.generated.cs (Tree conflict)
  • SharedController.generated.cs (Deleted, Added)
  • StockListController.generated.cs (Tree conflict)
  • StockCheckController.generated.cs (Tree conflict)
  • AuthController.generated.cs (Tree conflict)
  • GoodsOutController.generated.cs (Tree conflict)

Step 3

I’m now resolving my conflicts. I suspect this is where the problem lies, as I always keep my local file and mark it as resolved. I have just done that for the first conflict (HomeController.generated.cs). I’ve then tried comparing with my local copy and got the following error message…

Unable to find repository location for ‘C:/Data
Files/Projects/Web/ByBox.Vanventory/ByBox.Vanventory/HomeController.generated.cs’
in revision 14638


WOAH – HOLD ON THERE!

I got as far as this earlier today, when I realised the reason for the tree conflict is that the generated files are actually being deleted and re-added to the project. Now, I don’t know if T4MVC itself is doing this or the Chirpy extension. I’ve looked through the source code of Chirpy (just browsing in my web browser on codeplex) and it doesn’t seem to do that.

I think the cause for the Tree Conflicts in subversion is that there are two people both making changes to the controllers, which is causing both of us to generated new files with the same filenames. Therefore, subversion has 2 new files and flags it as a Tree Conflict because it doesn’t know what to do about it.

I’ve confirmed with a colleague who is also using T4MVC that they are having zero problems with it, but they are the only person making changes to the controller code. Before there were two people on my project I never had a problem. The issue has appeared since the second person started working on the project and making changes to the controller code.


So, am I missing something blatantly obvious here, or am I abusing T4MVC and/or Chirpy?

For the moment I have a bit of a hacky solution. I’ve written a powershell script to “touch” all the controller.cs files. I’ve put that in my External Tools in VS2010. When I get the issue, I run that powershell script then build the software which forces the T4MVC template to run and all my errors go away. This is not ideal and I would like it to “just work”.


Edit

To clarify, the situation I would like get to is being able to just open up visual studio in the morning, do an SVN update (via VisualSVN) and to not have to spend any time getting it to build because code is missing from the generated files that was there yesterday.

So, how exactly does the template/T4MVC stuff work in visual studio?

(If it’s deleting the generated files and re-creating them each time it runs, then I will have to stop using it, as that just doesn’t sit well with using subversion and with multiple people working on the code which the generated code is adding to)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T14:37:44+00:00Added an answer on May 17, 2026 at 2:37 pm

    I turned off the “smart run” feature of chirpy and all is well now. I’d rather not have to run it manually on the rare occasion I need to. It still runs when I build and that catches 99% of my needs.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
Does anyone know how can I replace this 2 symbol below from the string
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build
I have a bunch of posts stored in text files formatted in yaml/textile (from
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
Seemingly simple, but I cannot find anything relevant on the web. What is the
this is what i have right now Drawing an RSS feed into the php,
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.