I have a windows application installed and working perfectly fine.
Something weird came up, the test scenario is if I rename the config file from the original name which is:
Model Label PC Client.exe.config
...to:
xxxModel Label PC Client.exe.config
...and click the .EXE file on the application folder / path where i installed it, it works as expected.
But when I clicked the shortcut icon of this application on the desktop, it shows a pop up that installs a new copy of the correct config file name.
please refer to the screenshot , any idea how to prevent this from happening? or is this really the behavior?
OP:
"any idea how to prevent this from happening?"
For installed apps, it is by design. Essentially you have removed an installed file and so the installer tech will kick in to recover it as if nothing happened.
Now technically you could get around that auto-recovery by not using MSI tech to install your app trusting instead on good-ol' XCOPY but then again, renaming/moving/deleting the file may break the app because this time there is no auto-recovery!
Additionally .NET apps expect to find a .config file matching the same name as the executable so you shouldn't go renaming/deleting/moving it in most scenarios.
I have a Big Application build in asp.net 4.5.1 Web form. The Application has two Windows Services. This is a product that we host for different vendors. The client Requirement is to have Separate URL, Database and separate Services. we are getting vendors rapidly, now this became a big problem for me, to update, each url separately, to trace any db changes across the database and implement that separately, and to create separate windows service applications for each vendor and to install that separately on the server. Although I have put code in class libraries so that is shared among all the web and the Windows Service application. but there are other settings, like encryption key, the connection strings to each database, the email settings etc.
can someone please guide me how can I manage multiple copy of same application when there are Windows Service applications too.
Thanks in Advance
I am doing similar things by using different build configurations for that.
Create a new build (solution) configuration for each customer. Right click solution and select 'Configuration Manager'.
Add new configuration with customer name and select to copy settings preferably from Release config.
Once you've done that you are able to switch between those configs next to the debug button in VS.
Go to your web project, right click your Web.config file and select 'Add config Transform'
New config files are created (Web.[ConfigName].config) and placed as sub node under the Web.config file.
These new files are used to transform the original Web.config depending on the selected solution configuration. There's some information in the transform file on how to use it, it is not difficult.
If you would go for automated build process later on, the solution config is the key for that as well. Also if you define publish templates (e.g. to create web deploy packages), you are able to select the config. The transformed web.config is then automatically put into the package.
I have a WP8 app that I need to build in 3 configurations (release, release(prepro), release(fake)). Each configuration point to a different server and has different app icons. I need to be able to have all the 3 build in the phone at the same time so my solution is that I have created 3 different WMAppManifest.xml files (with different guids and icon paths) and I copy the right one in a pre-build step. This works fine (Based on this article http://www.tonicodes.net/blog/using-different-wmappmanifest-files-for-release-and-debug-builds/).
I upgraded the app to WP81 Silverlight. There is an additional Package.appxmanifest file. So I created 3 different Package.appxmanifest files, setting the PhoneProductId attribute to the right guid and added a pre-build step to do the copying also for this file.
When I try to run the app in release(prepro) or release(fake), meaning different WMAppManifest.xml an Package.appxmanifest are copied to the project first, I get
Installation of the application failed. XAP package signature is not valid or the WP manifest file is invalid. Re-sign with valid signature and fix the manifest file.
Is there something other than PhoneProductId that I need to changed in the new Package.appxmanifest files to make work?
I had the same issue, and maybe i can help you out. this xap signature is not valid happens a lot when some of the "pictures" in the appxmanifest file are not actually in the project. i have deleted my splashscreen picture that caused this error, deleting it from the appxmanifest file solved it. Beside that for each package you have a new package id wich if you want to publish the app you get in the dev center after you register your alias.
And there is the publisher ID wich you will also get after reverving an app name, its in this format "CN=************".
And the most important, and that i think what you search for, you can not install the same app twice on one phone. i tried it and somehow it just dont work. I have an app from store, and i can not install the same from visual studio before i dont delete the one from store. That happened never before on 8.0
I found a really easy workaround. Just add "DEBUG" to the end of the current Package name in the Package.appxmanifest designer.
Then you can have the debug version deployed: just be sure to remove the "DEBUG" from the Package name before you submit to the Store.
Also, if you still have the WMAppManifest.xml file, likewise append "DEBUG" to the Display Name so that on your phone you can easily differentiate which is which.
Cheers.
I found I needed to:
Make the Package.appxmanifest Package > Identity > Name unique (as per #kjo4jc's answer)
Change the Package.appxmanifest mp:PhoneIdentity > PhoneProductId GUID to differ from the value used in the store.
The changed GUID also needed to be changed in wmappmanifest.xml Deployment > App > ProductID to match.
I've found this happens if you try to debug an app on a phone that already has a version of the app downloaded from the store.
The easiest way to fix is to unistall the app from your phone first.
My web application is just a simple web application made in VS 2010 MVC 4 without any code from outside. It's just default application of VS 2010. I have Deluxe Windows Hosting with Plesk. I've never changed any feature in my account. I copy all my files to "//Root Directory". Beside my files I see various folderssuch as: ", plesk, erro-docs, cgi-bin, logs" - I do not have permissions to delete them.
All my projects are "Release" configuration. I've tried all ways which I met in the Internet:
1.I copied three libraries to bin directory:
System.Web.Mvc, System.Web.Routing, System.Web.Abstractions
These dll's I copied from GAC(C:\WINDOWS\Microsoft.NET\assembly\GAC_MSIL). I putted such strings in web.config: < trust level="Medium"/>. I used local deployment(to directory) in VS2010 by button "Publish". No result.
2.I copied 9 libraries to bin directory:
System.Web.Abstractions.dll
System.Web.Helpers.dll
System.Web.Mvc.dll
System.Web.Optimization.dll
System.Web.Razor.dll
System.Web.Routing.dll
System.Web.WebPages.Deployment.dll
System.Web.WebPages.dll
System.Web.WebPages.Razor.dll.
These dll's I copied from GAC(C:\WINDOWS\Microsoft.NET\assembly\GAC_MSIL). I used local deployment(to directory) in VS2010 by button "Publish". I putted such strings: < trust level="Medium"/>. No result.
3.I copied three libraries to bin directory: System.Web.Mvc, System.Web.Routing, System.Web.Abstractions - these dll's I copied from GAC(C:\WINDOWS\Microsoft.NET\assembly\GAC_MSIL). I putted such strings: < trust level="Medium"/>. I used deployment via ftp option in VS2010 by button "Publish". No result.
4.I copied three libraries to bin directory:
System.Web.Abstractions.dll
System.Web.Helpers.dll
System.Web.Mvc.dll
System.Web.Optimization.dll
System.Web.Razor.dll
System.Web.Routing.dll
System.Web.WebPages.Deployment.dll
System.Web.WebPages.dll
System.Web.WebPages.Razor.dll - these dll's I copied from GAC(C:\WINDOWS\Microsoft.NET\assembly\GAC_MSIL). I putted such strings: < trust level="Medium"/>. I used deployment via ftp in VS2010 by button "Publish" No result.
5.I've tried to upload files via filezzilla. < trust level="Medium"/>. However it was an idle attempt.
6.I've tried to upload files via browsers. However it was an idle attempt.
7.I've tried to upload zip-files via browser and extract them at godaddy server. < trust level="Medium"/>. However it was an idle attempt.
All above-listed attempts result the word on the screen: "nup.com My site is launching soon."
Nothing changes.
I have a question.
What I do wrong?
I've read all articles by Phil Haack http://haacked.com/archive/2008/11/03/bin-deploy-aspnetmvc.aspx. Any help will be gratefully appreciated!:)
Ok - you have a lot of questions inside your single question. I am going to try and take these one at a time as well as some of your commentary so that we can a) understand the build/publish process of an MVC app and b) hopefully get your project running over at GoDaddy.
1.If I change in web.config , then should I recompile my project and upload again?
No, unless you change the web.config locally and you need to upload those changes. If you FTP/connect to the web.config on the actual web server, IIS will automatically restart (reload) your application so that it can apply the web.config changes. After a web.config change, you will notice the first request will take 10-20 seconds. This is IIS restarting your application. If you change the web.config locally, then yes, you should rebuild/reupload.
2.Is it correct to copy a project to root of directory?
The way you have phrased this question makes me think that yes, you are doing it wrong. When you create a project in Visual Studio, you get a solution folder on your actual hard drive. If you are compiling that project, then copying the entire solution folder to your web server, then yes, this is not the correct way to do it. What you want to do is create a Publishing Profile. You can either deploy your application via Web Deploy (unsure if GoDaddy supports this), FTP, or File System. By going through the Visual Studio publishing process, the compiler a) compiles your application per your settings (Debug or Release), b) applies the proper Web.Config transformations and c) only outputs the files necessary to run your application. The third part is important. All of your .cs files (controllers, models, etc) get compiled into a .dll and that is what needs to be deployed, not the actual source code files. The publishing process does this for you.
I would recommend you create a folder on your dev machine somewhere, and then create a publishing profile that publishes your application to that folder. It is the contents of that folder that you want to FTP to your web server. To create a publishing profile, right click your MVC project and select Publish. This will bring up the wizard for you to set things up.
3.What I do wrong?
Kind of hard to say at this point. It could be that you are not compiling your application correctly. FTP sounds bonked, but that is not an MVC/Visual Studio issue. For FTP issues with Plesk on GoDaddy (and other items), check this help link here.
4.how can I see the errors? Should I write a message or what should I do to know more about errors?
You should be able to control this in your web.config. Open your web.config file up and check for a couple of lines. You want to turn off custom errors and set the compilation to debug mode. This does two things. One, the error you get back from the server will be way more detailed and being in debug mode allows IIS/.NET to actually show you the line of code that is causing the problem.
<system.web>
<compilation debug="true" targetFramework="4.5" />
<customErrors mode="Off"></customErrors>
</system.web>
Be aware that if you do have a web.config transformation, this could actually turn these setting off. Ensure that your publishing profile is set to deploy the Debug configuration while you test deploying your site. Once you are happy with your results, set it back to Release configuration so that your site runs faster as well as does not display code lines to potentially bad people if an error does occur.
5.I copied 9 libraries to bin directory...
Ok, this could also be a problem. You do not need to copy anything to your bin directory. If you want to include referenced assemblies in your published project, all you need to do is open the References folder under your project. From there, right click any assembly that you want to include in your project when you publish and select Properties. Inside of the properties pane, you will see the option to Copy Local. Set this to true. This tells the compiler to copy that assembly to the output folder during the publishing process (see, that publishing thing does lots of good stuff for you!) I would do this for all assemblies in your project that are MVC related. You can experiment with this (like one at a time) until you find the right combination of assemblies that you need to include in your project to make it run on the GoDaddy server. I have not used GoDaddy hosting in quite a while, so I do not know what their current capabilities are.
Last thoughts, I think MVC 4 is .NET 4 or higher. Ensure that GoDaddy supports .NET 4 or higher or else you really won't be able to host this on that server (even using bin deploy) and will need to find additional hosting. Azure has some really great deals right now and Gearhost is very reliable but a little pricey (though they are completely simple to use).
EDIT
Just a little more info on GoDaddy - ensure that you set your site up correctly before you try any of this. You need to have Windows hosting (most likely) and it should be setup to use the Integrated App pool (else, it would appear you never uploaded anything since there is no 'default document'). At this point, I wonder if your hosting account was provisioned correctly for what you want to do. http://support.godaddy.com/help/article/6639/do-your-hosting-accounts-support-mvc3-applications (Yes, I know it says MVC 3, but the setup applies equally to MVC 4)
Have you tried bin deploying MVC4?
http://haacked.com/archive/2011/05/25/bin-deploying-asp-net-mvc-3.aspx/
or
http://forums.asp.net/t/1884928.aspx
To answer your question:
Changes to web.config should not require the project to be recompiled.
Hope this helps...
Depends what you've changed, some changes might at least require an application pool reset.
Root of what directory? It should generally be inside inetpub/YOURWEBSITEFOLDERHERE
You have assumed that GoDaddy supports MVC 4, I could only find references to them supporting MVC 3 Support
There are rumours that if you deploy the bin and mvc dll there is a way around this but I couldn't find any details.
Have a read of the MVC 3 deploy instructions
EDIT: In answer to comment below:
Editing could have a knock on effect and so i would advise towards a recompile, e.g. change to medium trust might have an affect if DLLs don't work in partial trust mode, and recompilation might well highlight these issues.
Sounds ok, test by putting a html file up with some text and try and get to it in your browser.
I've seen people talking about it, mostly saying it's not supported, try the MVC deploy instructions above to bin deploy MVC 4; it works with 3, it might work with 4.
I had the same problem with a MVC4 I had running on hosting on Godaddy using Plesk. Suddenly, without any changes, site began to display "Site Launching Soon" Page. At first I thought it was hacked. After calling godaddy support, the agent told me that the site must need at least one html file as a start point (index.html, index.aspx, default.aspx - source: http://support.godaddy.com/help/article/60/what-file-displays-when-someone-browses-to-my-domain-name?locale=en&ci=46061), which seemed odd because it was working fine all the time.
Then, after some trial - error stuff, I could solve my problem by going to the Plesk hosting management, and navigate to:
Websites & Domains > [domain name] > Web Server Settings for domain. And there, change the Default Document setting to "Default".
We never touched that setting, not sure really why it suddenly changed.
Hope that helps!
Hope this helps . . .
Global.asax should be your default index . . . in godaddy server settings.
I had a similar problem and was able to solve it.
I have two other mvc application sites hosted on godaddy, but not with their new plesk hosting.
After calling tech support and not having any luck there I did some reading on their hosting.
Their plesk hosting must have an index.
So, a few hours later it dawned on me to point their start point to my Global.asax in their server settings.
And, viola! my site was up and running.
I've done all actions to deploy correctly but I copied all files to a wrong folder. The problem was that I just copied all my files to a wrong directory. I called to godaddy support and they said that I copied my files to wrong directory.
When I copied all files to "httpdocs" directory then my mvc 4 application start working!:).
Thank you a lot, guys. Good luck.
I was having the same issue until I set customErrors to off (first line). then I started seeing security policy issues which was remedied (second line).
(I'm using Godaddy)
I have an app MainApp that references another project MyDLL.dll. Inside the MyDLL project I have made some user settings in a Settings.settings file that may be changed at runtime. So it appears that these settings get saved in the app.config file of MyDLL. But the problem is, the main project is MainApp, and MyDLL.dll.config does not, so far as I can see, get copied to the MainApp output folder. This is reflected in the fact that even though I save the settings in the code of MyDLL, the next time I run MainApp the settings have gone back to the default.
I must be missing something really obvious here. There has to be a way for related assemblies to preserve their settings values. But how?
While you can add an app.config to a library project, it has no effect to do so. Configuration is linked to the application, not the library.
You need to create the settings and configuration in your application itself. You can do something like including the library's app.config if you really wanted to, but that would probably not do what you want, either. It's best to just handle your configuration in the application.
Why is this so? Because what's to say it's valid to have user settings for your library in the first place? A library should not be tied to any particular kind of application. What if you used it in a Windows Service or an ASP.NET application?