I have this existing project ASP.NET web application which is using .NET Framework 4.x and Entity Framework 6. For Entity Framework 6, it uses ADO.NET Entity Data Model > EF Designer from database.
The project could not compile due to one error. In the error list, it shows that the error is from Model.tt
on the first line. <#@ template language="C#" debug="false" hostspecific="true"#>
.
The error description is "Running transformation: System.NullReferenceException: Object reference not set to an instance of an object."
By the way, I also notice that initially there are some errors "The type or namespace name 'xxx' could not be found (are you missing a using directive or an assembly reference?)". I notice that Model.cs
(the file under Model.tt
) is empty. I have to manually copy the code from the repository to this class. After that, there is no more of this error "The type or namespace name 'xxx' could not be found (are you missing a using directive or an assembly reference?)".
Now I only stuck with one error "Running transformation: System.NullReferenceException: Object reference not set to an instance of an object." I am stuck with this as I am not so sure how to debug further.
This Model.tt
class is auto generated using ADO.NET Entity Data Model > EF Designer from database.