Plugin using incompatible method with visual studio 2015?

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
7 years ago
New to plugin development and would require some advice...

I'm using visual studio 2015 as my IDE.

I have loaded my solution and also created plugin class library according to
the help that was given.

I am having problem with the view. It does not allow me to add view to a class library.
there are workaround I know, I googled it but why need to use a workaround?
?
I see eg. the paypal plugin has a view. how did you all implement it with any issues?
7 years ago
A view is just a text file with a .cshtml file extension so there's no need to use the Visual Studio add view functionality, you can just add any type of file and rename it to change the extension. Generally though I'll just copy and paste a view from another plugin, rename it and edit it.
7 years ago
that is exactly my problem.
I copied it and I get all kinds of errors.
from c# v2 please use v3 and above to reference not found.

that's why I do not understand. I google it and it requires a workaround.
but then how did nopc dev did it. with a workaround also?
7 years ago
sephent wrote:
that is exactly my problem.
I copied it and I get all kinds of errors.
from c# v2 please use v3 and above to reference not found.

that's why I do not understand. I google it and it requires a workaround.
but then how did nopc dev did it. with a workaround also?

Oh right, you mean the Intellisense in Visual Studio goes nuts and shows loads of errors? Yeah it's a known problem, search the forum for Intellisense and you'll find a few posts about it and some workarounds. Though I've never found the workarounds to actually work for me, they usually work for a while then break again at some point in the future. The thing is you can just ignore all the Intellisense errors for the view and it'll compile and work when you run the site, it just makes it a bit harder to develop.
7 years ago
yup, I google around for a few days until I got no choice but to post a question,
wondering how the hell did the dev of nopc did it, without a workaround???

anyway, a quick question since I move from vs 2010 to 2015 while skipping 2012 and 2013
does this problem exist in vs 2012 or 2013?


and is it really best practice to use views in class library?
since there have to be workarounds, I mean really have to... no choice


I read so many opinions that state it is better not to put views in class library due to separation of concerns, even Microsoft (and they really did for a lot of things) did not even try to improve it, the proof being the workaround.

why did nopc choose this way to make a plugin?
it there an alternate way to make a view for the plugins?
7 years ago
sephent wrote:
yup, I google around for a few days until I got no choice but to post a question,
wondering how the hell did the dev of nopc did it, without a workaround???

anyway, a quick question since I move from vs 2010 to 2015 while skipping 2012 and 2013
does this problem exist in vs 2012 or 2013?


and is it really best practice to use views in class library?
since there have to be workarounds, I mean really have to... no choice


I read so many opinions that state it is better not to put views in class library due to separation of concerns, even Microsoft (and they really did for a lot of things) did not even try to improve it, the proof being the workaround.

why did nopc choose this way to make a plugin?
it there an alternate way to make a view for the plugins?

I don't know of any alternatives and as you state, if you want to build a plugin, what choice do you have? Really you shouldn't have any complicated logic in your views anyway, all that should be done in the controller and the view should just be responsible for displaying the model so I've never found the lack of Intellisense to be a major issue.

Fundamentally there's no difference between a class library and an MVC project. The MVC project just has some default folders and files, a few extra references and some different GUIDs in the project file to tell Visual Studio what how to treat it. I did once try creating a new plugin starting from the Web Application project type instead of the usual class library and then removing all the extra stuff and adding the usual nop plugin dependencies. It seemed to work well to start with but I think once I quit Visual Studio and reloaded it I ran into the usual problems with Intellisense (the plugin still works though).
7 years ago
I guess no choice for now.

but it worth asking...
and there always a way..

if anyone got alternative could post it.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.