質問

I am currently developing a nopcommerce plugin using this tutorial.

The tutorial insisted on marking the views(.cshtml file) as embedded resources(in Properties -> Build Action -> Embedded Resource) which I did when developing my plugin. When the plugin was deployed, all I could see was a dll and a pdb file.

So what happened to the view? What is the purpose of marking views as embedded resources?

役に立ちましたか?

解決

The Views get embedded into the DLL. I believe this is needed because the /Views and /Themes folders are marked as paths for Views but your plugin's folder is not because they are dynamic.

FYI, if you are working on your plugin and modify your View, you need to recompile to see the results in the browser. You can't just save it and refresh like with a normal View.

他のヒント

The purpose is to distribute your full plugin with only one or a few .dlls. However, in practice it makes development a horrible process.

There are alternatives to this today, check out the following link:

3 Ways to Display Views in your nopCommerce Plugins

You can use ILSpy tool to see what's inside the assembly (.dll). Your view will reside in the Resources section of the assembly. Further on, it is extracted by a customized VirtualPathProvider and rendered to the client. This is what happens, in general. nopCommerce shouldn't be an exception...

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top