Is there any other alternative way to see direct effect of changes made in plugin without UNINSTALL & INSTALL it again and again? - nopcommerce

I am new to nopcommerce and I am developing a plug-in in it.
I have partially created my plug-in and meanwhile i have found that if i change anything in plug-in's code (View, model, controller, services, etc.) then i have to UNINSTALL my plug-in and then INSTALL to see the changes.
It is really tedious task to do.
Is there any other alternative way to see changes especially for designing view where we just need to set our designing.
If it is possible to see changes by just reloading it in browser then it will be great for all.
Please reply if anyone has any idea about that.
All answers are accepted.
Thanks in advance.

As far as I know all installed plugins are cached into memory so just overwrite .dll in Plugins folder and you can either
Restart your application with IIS/WebMatrix
Go to Admin > Configuration > Plugins and in top-right corner of the plugins view hit "Reload list of plugins"
"Restart application" or maybe even "Clear cache" in top-right corner of the admin page may work too. Try it out.

You should clean the solution and then build plugins after making changes to the code of the your plugin.

I have a batch-file that I run each time I want to deploy changes to my plugin on my local IIS. It may be overkill, but it works. I keep it on my desktop. When I want to test changes, I right-click and "Run as Administrator".
#ECHO OFF
ECHO Stopping IIS
iisreset /stop
ECHO Clearing Temporary ASP.Net Files (Server cache)
for /d %%i in ("%systemroot%\Microsoft.Net\Framework\*") do for /d %%j in ("%%i\Temporary ASP.Net Files\*") do RD /q/s "%%j"
for /d %%i in ("%systemroot%\Microsoft.Net\Framework64\*") do for /d %%j in ("%%i\Temporary ASP.Net Files\*") do RD /q/s "%%j"
ECHO Building MyPlugin
"C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\devenv.exe" /build Debug "C:\Path_to_Nop_Source\Plugins\MyPlugin\MyPlugin.csproj"
ECHO Deploying MyPlugin
xcopy "C:\Path_to_Nop_Source\Presentation\Nop.Web\Plugins\MyPlugin" "C:\Path_To_WebRoot\Plugins\MyPlugin" /D /Y
ECHO Restarting IIS
iisreset /start
ECHO Done
pause

When I ran into this problem I tried restarting everything starting with the app, then the app pool and even iis. Unfortunately it didn't work. What did work however was rebuilding the site again and copying it over again (mainly all the nop.core.dll, nop.web.dll etc.). I did copy the core dlls of the site the first time around too, but I guess the plugin was copied after those. I think the important part is that the core dlls need to be recompiled so they appear different to iis and cause the already loaded plugins to get unloaded from memory.
I'm quite sure that restarting the whole server would work too, but who would want to do that?
P.S. I was about to ask the same question, because I couldn't find this one while googling (probably because the title is a little too specific). I intended to name mine Plugin not updating after copying a newer version. What lead me to this question was the similar question block that appears when you write a question.
Update: So I discovered that sometimes rebuilding and replacing nop core libraries isn't enough. However in that situation using the "Reload list of plugins" option in admin panel did the trick. Another time I was trying to just use that option and it didn't work until I replaced the core libraries. So to reload a plugin one or both of those steps might be required.

Related

Incremental Build aspnet_compiler

I am using aspnet_complier command for building website, first time it is compiling complete website i.e all pages, but after modification on the site, it is again compiling all the pages. It should compile only that pages that have been changed or modified.
And other things are
1) How can i speed up the aspnet_compiler ?
2) how can i exclude warning from the output ?
Please suggest on the same.
According to the documentation, "You can also recompile an application in place after adding new source files to it. The tool compiles only the new or changed files unless you include the -c option".
Unfortunately, there doesn't appear to be an option to hide warnings.
Speed up the process by making sure the machine where you run it is appropriately powered. eg. an SSD disk should probably help.

Does aptana save my files on every keypress?

I've just downloaded Aptana to do some web-development. I've downloaded the JsTestDriver plugin (javascript testing framework) which works fantastic, however there is one thing bugging me... In my run configuration of JsTestDriver i set it to run everytime i save my project. The funny thing is that the my run configuration is executed everytime i press a key... Does this mean that aptana saves my project everytime i make a single change to it? If so, how do I disable it? Running all my unit tests everytime i press a single key is kinda taxing on my system :P
Found it! Disable "Build Automatically" in Eclipse -> Workspace settings

Problem with built assembly not matching source when debugging under IIS 7.5

I have a problem debugging a web forms application that is configured to use IIS for debugging, under Windows 7 and Visual Studio 2010. An example has just occurred, where I make a change to the code behind for a web form, save, and apparently rebuild before starting the app using F5.
The app starts, and I get an error message trying to do something in the app. I tell the debugger to break when an exception is thrown and try my task again, only to be told
The source file is different from when the module was built.
where the module is C:\Windows\Microsoft.NET\Framework64\v2.0.50727\Temporary ASP.NET Files\root\9d7b45ca\11a98b19\assembly\dl3\5e6cf0b2\636409d4_dfeecb01\PerfixEMS_Admin.DLL
The physical folder for my test web site is set to the web application project's source folder, so I have always assumed that IIS will look in the bin folder for required assemblies, and these will be rebuilt as expected. Why is this not happening?
Cleaning the solution usually works for me.
Update
Given the high number (320) of projects I understand why Clean and Build won't work for you. You should however try it at least once to see if fixes things.
If it does fix your problem but doesn't last you'll need to do one of two things.
Clean just the one file
Delete the offending temp file. You probably won't be able to do this because with VS running since it may have a lock on the DLL. You may also have to stop IIS. You can use Process Explorer to look for the processes that have a lock.
Use a custom solution
Its unlikely that you're going to be modifing all 320 projects at the same time. Create a custom solution for just the projects you're working on. You'll still be able to step through any project you have the DLL and PDB for if you need to.
Which to do
Using a custom solution has its problems since you can no longer use project reference for projects not in your solution. This impacts your team's source control. You'll also have to make sure the DLL's and PDB's from outside your solution are in a stable location and you'll need a way to detect when thoes other projects have changes that you care about.
These problems can be overcome with a careful check-in process for Project changes and scripts that copy files and working with team members to figure out how to communicate changes.
On the other hand closing VS for every change or running Clean and build isn't really tennable either.
it may be a workaround, but I just need to see if it will work or not, then we may investigate more in the original case. but for now, try this:
1- publish this website to a different folder
2- open the newly published version from your preferred browser (ex: http://localhost/APP_NAME).
3- from VS, open "Debug" menu, choose "Attach to process..."
4- select the IIS worker process "w3wp.exe" and click "Attach".
(if you can't find it, make sure that the checkbox "show processes in all sessions" is checked)
5- start debugging your source code normally and let me know what happened, thanks.

Why won't my VS 2005 hit the break points?

I'm going crazy and wasting a lot of time. I am running in DEBUG, checked the web.config to ensure debug=true is there, checked the code to ensure I am reaching it, cleared all temp files and pdb's. The only thing that works is to continually kill the solution, create a new solution and add all the projects again. I shouldn't have to do this every day.
If you're using Windows Vista, try launching Visual Studio as an Administrator. Even if you're already running as an Administrator on the machine, still right-click on Visual Studio and select "Run as Administrator."
Right-click the solution node in solution explorer end select Properties. Check the configuration settings in there.
If you are attaching to a process sometimes this can be caused by symbols not being loaded. If you see the code skip over your breakpoint hover over the breakpoint it will tell you if symbols were not loaded. If that is the case Here are several potential solutions to your problem.
Clear out all files in C:\Windows\Microsoft.NET\Framework\v2.0.50727\ASP.Net temp files.
Ensure you deployed the *.pdb files to the bin folder of your application.
The web process has not loaded your assemblies at the time you attach your debugger. Reset the process and wait a little longer before attaching to the process to give the process a chance to load your dll's.
Actually your visual Studio is not attaching your project with process WebDev.WebServer.EXE
Do the following Steps:
click on Debug Menu
Click on Attach to process WebDev.WebServer.EXE
Now your Debugging is enabled.

ASP.Net cannot create/shadow copy

I get this error repeatedly when developing ASP.Net applications:
Cannot create/shadow copy 'XXXXX' when that file already exists
Where XXXXX is a random DLL. Typically the DLL is one of the DLLs from Microsoft's Enterprise Library, but it varies.
It's really random, and it's very frustrating. I will go hours without getting the error, and then get this error every 10-20 minutes.
I've seen several solutions. For instance, this question. I've tried using Clean Solution option, and I've also simply restarted my local IIS. However, it still occurs at the same random but persistent frequency.
I've also seen many people mention using this option in the config file:
<hostingEnvironment shadowCopyBinAssemblies="false" />
However, others have mentioned it being problematic, and it should definitely not be used in production.
So, should I just give up and try the shadowCopyBinAssemblies option? (And make sure not to copy this change to other environments.) Am I the only one who gets this issue that often?
Note: I am using Visual Studio 2008.
Wait somewhere between 10-30 seconds and hit refresh. For some reason this always works for me.
The following workarounds come from this now defunct connect issue:
add <hostingEnvironment shadowCopyBinAssemblies="false" /> to the <system.web> section of your web.config file.
Restart Cassini when you get the problem
If you get the error, stop the debugger, right click the solution and "clean solution". Hit F5 to restart debugger. This is really annoying as it has >50% fail rate for me and you would think that there should not be a manual option to CLEAN SOLUTION! This $1200 POS application should clean it for you automatically!
Here's another workaround that may be more appealing to some, courtesy of Gary Farr (http://blogs.claritycon.com/blogs/gary_farr/archive/2007/03/09/2888.aspx).
Add the following to your pre-build events:
IF EXIST $(TargetPath).LOCKED (del $(TargetPath).LOCKED) ELSE (IF EXIST $(TargetPath) (move $(TargetPath) $(TargetPath).LOCKED))
A workaround that does the job for me is instead of using "Build" use "Build Solution"
After a successful build, I count to ten, then I refresh my webform.
I have found that by re-registering ASP.NET against IIS the problem "goes away" - I haven't had the problem since. You will need to run the following on the command line: C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_regiis.exe -i. This more than likely won't work for everyone - it's a complex problem.
restart VS.
When Cleaning the solution, a few warnings were issued about files that could not be deleted. These files had their read-only property set. After setting the property of these files to read/write, the problem was solved.
Restart IIS
EDIT: Items retrieved from an old version of the page (courtesy of archive.org).
Just restart Visual studio, that worked for me.
Open your project properties, open the Web tab and make sure the Enable Edit and Continue option is not checked.
In my situation only iisreset worked.
I was getting the same issue, by placing this code in a web.config in <system.web> section it worked fine for me.
<hostingEnvironment shadowCopyBinAssemblies="false" />
I was getting this issue frequently when working with an imported DLL which we created.
Attempts to stop is happening failed, and even introduced different problems, but whenever it occurred I would just do a rebuild solution and the problem would immediately disappear for that build.
Also, I haven't seen the problem since working on Visual Studio 2002. 2008 does not have this issue that I know of, neither does 2005. Are you using an older VS?
GO to the design mode and then right click and hit view in browser, the issue will go away
Anil Madan
Add these lines in the pre-build event command line, which basically unlocks the DLL within Visual Studio:
IF EXIST $(TargetPath).LOCKED (del $(TargetPath).LOCKED)
ELSE (IF EXIST $(TargetPath) (move $(TargetPath) $(TargetPath).LOCKED))
Re-compile and your unable to copy DLL error will not occur.
If you use Entity Framework:
Error Message:
"Cannot create/shadow copy '' when that file already exists."
Solution:
"Wait a few seconds and refresh the page."
For more information please visit: Advanced Entity Framework 6 Scenarios for an MVC 5 Web Application (12 of 12)
You just Refresh (F5) your page.

Resources