NecroTheif
NecroTheif

Reputation: 314

Generate Code in Visual Studio 2015 UML Class diagram is not working

I made a basic UML Class diagram of a class with two fields, a method, and a subclass with one field but when I hit generate code nothing happens. The console says it worked with no errors but when I look at the log it says "(Class): no file generated because the 'AppliesToElement' method of the template 'ClassTemplate.t4' evaluated to false." on both of my classes. What am I missing?

Upvotes: 2

Views: 2387

Answers (2)

NecroTheif
NecroTheif

Reputation: 314

I fixed this by using the UML Model Explorer.

I went to the UML Model Explorer, then right-clickd the project, then clicked generate code which popped up this message:
enter image description here
which told me the component cache was out of date so I restarted Visual Studio. After that I tried to generate the code again through the UML Model Explorer and it Worked.

Upvotes: 2

Ryan
Ryan

Reputation: 3982

Unfortunately, the ability to generate UML class and sequence diagrams from code, and turn UML into code, was removed in VS2015. This is because of the new Roslyn compiler - Microsoft would have needed to rewrite these features for the new compiler but stated they didn't want to spread their resources too thinly.

Source: https://msdn.microsoft.com/en-us/library/dd409436.aspx

Upvotes: 0

Related Questions