mcintyre321 / FormFactory

MVC5, Core or standalone - Generate rich HTML5 forms from your ViewModels, or build them programatically
http://formfactoryaspmvc.azurewebsites.net/
MIT License
303 stars 103 forks source link

FormFactory.Templates has wrong build action for content files #41

Closed vbocan closed 7 years ago

vbocan commented 7 years ago

I created an empty ASP.NET MVC project and added the following NuGet packages:

In one of the .cshtml files I added the following:

@{ 
    var model = new AutoCompleteExample();
}
@(FF.PropertiesFor(model).Render(Html))

At runtime, I get a System.InvalidOperationException with this text:

The partial view 'FormFactory/Form.Property' was not found or no view engine supports the searched locations.

Indeed, the ~/Views/Shared/FormFactory is empty but I understand that the folder can be safely deleted if I don't plan to customize the views.

Any help appreciated.

mcintyre321 commented 7 years ago

You have two choices

  1. have that folder empty/nonexistent, in which case you need to install-package EmbeddedResourceVirtualPathProvider which will serve them from the dll
  2. Install FormFactory.Templates which should install teh files into ~/Views/Shared/FormFactory

If these options aren't working then I have a bug!

mcintyre321 commented 7 years ago

So it looks like there is a bug with 2. the templates didn't install. Thanks for reporting

mcintyre321 commented 7 years ago

It seems that the BuildAction in FormFactory.Templates\FormFactory.Templates.csproj for all the template items is set to 'None', mistakenly. It should be 'Content'.

I will update over the weekend if I get a chance. If you would like to use the templates sooner, you can send a PR over which sets the Build Action correcly (for the cshtml and js/css files) and I will merge it in and release a new version.

vbocan commented 7 years ago

It seems that the BuildAction is set to None only in the master branch. The wip branch has the correct setting, therefore I cannot create a new PR (no new changes). I will wait for you to release the new version. Thanks for your quick reaction.

mcintyre321 commented 7 years ago

I've deleted the wip branch if that helps