T4MVC Generates T4MVC1.cs File and Fails
Deleet T4MVC1.cs and then in Visual Studio right click on the web project and Unload Project. Right click again and click Edit csproj file.
Find a node like this:
<Compile Include="T4MVC\T4MVC1.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>T4MVC.tt</DependentUpon>
</Compile>
Delete the whole thing, save and close the file.
Right click on the web project again and Reload Project.
Build and all shoud be fine.
Another scenario is to just copy and paste the contet of T4MVC1.cs into T4MVC.cs and then delete T4MVC1.cs. This will fix things but you may have to repeate the next time you run the tool.
Another approach - https://stackoverflow.com/questions/46841305/t4mvc-is-generating-t4mvc-cs-and-t4mvc1-cs and I think the key piece is Make sure the <LastGenOutput>
is T4MVC.cs
. If not, edit it to be T4MVC.cs