codesmithtools / Templates

CodeSmith Generator Templates
http://www.codesmithtools.com/product/generator
54 stars 35 forks source link

\CodeSmith\CodeSmith.targets << not found Visual Studio Community 2019, using Codesmith trial with CSLA #718

Closed orodrigueztorres closed 3 years ago

orodrigueztorres commented 3 years ago

Hello,

I recently downloaded you CodeSmith trial, I wanted to learn how does it integrated with CSLA so i downloaded the CSLA zip file and put it inside the Frameworks directory. I am able to see it under Generator Explorer > Frameworks so I proceeded to r-click on QuickStart.cst and Execute. I am able to see the configuration UI (I see less configuration option than in some of the videos I've seen probably because i am using a free trial). So I set my DB and everything and click on generate... When VS starts, it cannot load the 2 projects created (Business and UI). It says it cannot find \CodeSmith\CodeSmith.targets. I started looking everywhere for that file but is nowhere to be found on my PC. Any suggestions?

I also wanted to suggest a little bit more of guidance on how to install frameworks. I expected to have all frameworks after installation like I see in your videos but it was not the case. Also videos are very old and the UI seems different.

Good luck and thanks!

niemyjski commented 3 years ago

Hello,

Thanks for reaching out to us. We removed the frameworks from the installer as they were taking up tons of space and not every framework was used. We need to update the framework templates to remove the targets file but that then breaks older versions of Generator currently. You will need to remove the codesmith.targets file from the csproj. Next, you just reference the nuget package below and you are good to go.

Generate On Build / MSBuild Support

The Generate On Build support for .csp files has been greatly simplified by changing it to use the CodeSmith.Generator.Task NuGet package instead of referencing a preinstalled MSBuildtargets file that was included in your CodeSmith Generator installation. So now you can just install the CodeSmith.Generator.Task NuGet package to enable Generate on Build support in your project. Also, when running CodeSmith Generator in Continuous Integration (CI) / build server scenarios you can set the Generator:License environment variable to your CodeSmith Generator Server license key. It’s that simple!

image

orodrigueztorres commented 3 years ago

Awesome,

Thanks a lot.

I was actually doing that before. I am doing the PetShop example included. After removing the import from the I get 2 new errors on Business and UI:

Could not load file or assembly 'CodeSmith.ActiproSoftware.PropertyGrid.Legacy.Wpf, Version=117.1.651.0, Culture=neutral, PublicKeyToken=9fd61cdb91609a7a' or one of its dependencies. The system cannot find the file specified.

Could not load file or assembly 'CodeSmith.CustomProperties, Version=6.0.0.0, Culture=neutral, PublicKeyToken=9fd61cdb91609a7a' or one of its dependencies. The system cannot find the file specified.

Any ideas?

Thanks again.

niemyjski commented 3 years ago

Where do you see these errors? While generating the code or trying to compile the project?

orodrigueztorres commented 3 years ago

Hello,

When I try to build the solution those 2 errors appear.

Thanks again.

orodrigueztorres commented 3 years ago

Hello,

Just following up with the issues presented above.

Thanks.

niemyjski commented 3 years ago

Hello,

I've been able to reproduce with the generate on build NuGet package. I'm not sure when this was broken I can only assume in one of the many VS updates. We will get this fixed, as a work around please turn off Generate on Build and right click the CSP file and click Generate.

image

orodrigueztorres commented 3 years ago

Thanks and sorry for being such a pain but i've tried everything to my knowledge but I don't see the r-click menu like yours.

Here's what I've done:

I still cannot see that sub-menu on r-click. Here are some screenshots. image image

Again, thanks a lot.

niemyjski commented 3 years ago

Hello,

You have to use VS 2017 currently or generate outside of VS 2019 and include the generated files.

orodrigueztorres commented 3 years ago

Thanks,

Tried 2015 and 2017 but I still can't see the r-click sub menus as you see them.

niemyjski commented 3 years ago

Did you install the VSIX from our downloads page or install Generator from within the VS Extensions dialog?

orodrigueztorres commented 3 years ago

Downloaded the VSIX file and that did the trick. I was able to generate entities from the Business project. Thanks a lot, I only downloaded the generator not the extension. Will look forward for a release with the fixes you mentioned above.

Thanks, great product.

stale[bot] commented 3 years ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues. This issue now has been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.