Open GuyKroizman opened 11 years ago
@GuyKroizman - have you had a chance to look at the video and articles on MVCCentral.net? http://www.mvccentral.net/s/45
It explains how it works. In short, once the application is successfully installed, it will remove the appSettings key, "AppInstalled". Once this key is removed, this tells MvcInstaller that the application has been successfully installed and you can't install it again. This is a security feature, since it will prevents others from going to /Install and try to re-install the application over the existing application, essentially reverting your app back to the default.
If you want to re-install it again for some reason, you simply need to go back into the web.config, add the key to the appSettings section, AppInstalled = "false" and then you will be able to go back to the /Install route in your browser.
<add key="AppInstalled" value="false" />
I hope this helps.
@GuyKroizman - also regarding your MapRoute(to SGAccount), you don't need this. The standard routes will handle routing to this controller just fine.
And your issue combines both MvcInstaller issues with SecurityGuard. They are separate components. I assume your primary question is with MvcInstaller, not SecurityGuard, correct?
Hi As I am new to to this type of technology so I am shooting in all directions... I changed MapRoute because I wanted the first page of the application to be SGAccount.Login. My primary question is how can I get MVCInstall to run for my programmer peers and me again.
Of course I watched all your movies :) ... but this little detail slipped my mind. anyway I just added the AppInstalled like you suggested but I still get the same error...
@GuyKroizman - regarding wanting to have the SGAccount/Login as the first page, you do this by placing the [Authorize] attribute on your controllers, not by changing the route. The Authorize attribute will automatically route to the Login action for you.
Regarding the error, are you getting this in a deployed application, or while you are debugging in VS? I haven't seen this error before.
We are still in development phase... so yes debugging with VS. I guess I can create another project in the solution, get the MVCInstaller package and copy there the install.config. right? or maybe there is a way to debug?
@GuyKroizman - you can try this - copy the installer.config file, use NuGet to uninstall the MvcInstaller package.
There are times with NuGet that it may not completely remove files and folders. Make sure everything is gone before re-installing. Then re-install it and try the application again.
See if that works.
@GuyKroizman - oh yeah, paste back in the copied installer.config file, then run the application.
And FYI, once it successfully installs, it will remove that appSettings key which will prevent it from being installed again. So if you need it installed again (I can't see why), then you'll have to add that appSettings key back in.
Yep, that did the trick. simple nuget uninstall did not work though. I had to search for every mentioning of MvcInstaller and remove it manually. then reinstall - now all is good. thanks!
On second thought, I think it was not the uninstall and reinstall of MVCInstaller that fixed the issue... I noticed I get this error ("The resource cannot be found") when my route is:
routes.MapRoute(
name: "Default",
url: "{controller}/{action}/{id}",
defaults: new { controller = "SGAccount", action = "Login", id = UrlParameter.Optional }
);
You said that I should not do use the route like this but I did not understand why. Should I remove the default from the route?
@GuyKroizman - yes, remove this route. The default route works without this explicitly being set. If you need more understanding of how routes work, you should Google for MVC routes, or go to http://www.asp.net/mvc and read some articles about it. You'll feel better understanding it more fully. :^)
Thanks, but I understand how routes work. I just don't understand why with this specific route MVCInstaller fails while it works when the defaults is set to a different controller. Any idea?
Hi I have been working on my project and after a while I tried to once again reach the /install directory but it gives me the following error.
I checked and my project still has reference to the MVCInstaller.MVC4. I still SGAccount. my routes:
What must be kept as-is after initial installation of MVCInstaller? Thanks