ClickOnce - installing an app gives 'Cannot Start Application' error - installation

I have a simple windows application which I want to distribute through a website which is running on Azure. I publish the app locally first and then manually copy over the artifacts to the web server at location ../fold/apps/tools
Publish location: C:\Users\MyUsername\Documents\publish
Installation folder URL: https://somewebsite/fold/apps/tools/
Update location is same as the installation folder.
The files copied over are "Application Files" folder, Myapp.application, publish.htm and setup.exe.
Now I log onto the website and download the app using https://somewebsite/fold/apps/tools/Myapp.application
Clickling on the downloaded files shows me the 'Cannot Start Application' popup. Clicking on the details button shows the following error in the log file.
SOURCES
Deployment url : file:///C:/Users/MyUsername/Downloads/Myapp.application
Deployment Provider url : https://somewebsite/fold/apps/tools/Myapp.application
ERROR SUMMARY
Below is a summary of the errors, details of these errors are listed later in the log.
* Activation of C:\Users\MyUsername\Downloads\Myapp.application resulted in exception. Following failure messages were detected:
+ The Deployment Provider specified in the manifest cannot be reached. Maybe due to network error and/or the deployment provider is not responding correctly.
+ Exception reading manifest from https://somewebsite/login.aspx?ReturnUrl=%2ffold%2ftools%2fMyapp.application: the manifest may not be valid or the file could not be opened.
+ DTD is prohibited in this XML document.
I don’t understand why it tries to redirect to the login page when I am logged in. To test I placed a simple text file in the same location as the .application file and was able to access it after logging in.
Please let me know where the issue might be.
Many Thanks

Turns out that 'You cannot use forms authentication with ClickOnce deployment'. See Use ClickOnce on password protected web site.
I ended up opening up the folder to the world by placing a Web.config file with
<system.web>
<authorization>
<allow users="?"/>
</authorization>
</system.web>
It was OK for me as the windows app doesn't need to be password protected.

Related

Issue in deploying website with .srf files on IIS

I am facing an issue in deploying website with .srf files on IIS. Getting an isapi module error. Installed asp.net, extensibility, CGI and ISAPI restrictions as required.
HTTP Error 500.0 - Internal Server Error
There is a problem with the resource you are looking for, so it cannot be displayed.
Most likely causes:
• The path to the ISAPI Filter is incorrect.
• IIS received the request; however, an internal error occurred during the processing of the request. The root cause of this error depends on which module handles the request and what was happening in the worker process when this error occurred.
• IIS was not able to access the web.config file for the Web site or application. This can occur if the NTFS permissions are set incorrectly.
• IIS was not able to process configuration for the Web site or application.
• The authenticated user does not have permission to use this DLL.
Detailed Error Information:
Module: IsapiModule
Notification: ExecuteRequestHandler
Handler : TestRemote
Error Code: 0x8007007e
Requested URL: http://localhost:80/TestRemote/Banner.srf
Physical Path D:\wwwroot\Test\TestRemote\Banner.srf
Logon Method Anonymous
Logon User Anonymous
According to your description and error message, it seems there are something wrong about creating mapping for the .srf file.
I suggest you could try to follow below steps to re-add the mapping for mapping between files with the .srf and .dll extensions and the new ISAPI extension DLL.
Steps as below:
1.Generate an ATL Server ISAPI extension DLL using the ATL Server Project Wizard.
2.Build the ISAPI extension DLL and copy it to your Web server.
3.Create a mapping between files with the .srf and .dll extensions and the new ISAPI extension DLL.
For example:
(1)Run Internet Services Manager.
(2)Right-click the appropriate Web site or virtual directory in the tree and click Properties on the shortcut menu.
(3)Click the Home Directory or Virtual Directory property page.
(4)Click the Configuration button.
(5)Click the App Mappings property page.
(6)Click Add.
(7)Enter the path to your ISAPI DLL in the Executable text box.
(8)Enter .srf in the Extension text box.
(9)Click OK.
(10)Click Add.
(11)Enter the path to your ISAPI DLL in the Executable text box.
(12)Click .dll in the Extension text box.
(13)Click OK until all dialog boxes are accepted.

Published Umbraco site, now runs installer in loop

I just published my website I have been developing on local machine. And when I copied the files to the server, and now enter the address, it just starts the Umbraco installer.
It does it both front-end and back-end.
It is stuck, it seems unable to find the installer.
In my console it says the following:
Failed to load resource: the server responded with a status of 500 (Internal Server Error)
/install/api/GetSetup
it usually happens when there is no permission to write to file structure. So you need to edit file permission.
Right click on the folder > properties and follows >

"HTTP Error 403.14 - Forbidden" error when running the webapp

What is the reason for the error page I get when I run my webapp in Visual Studio. The URL is http://localhost:5000/
HTTP Error 403.14 - Forbidden
The Web server is configured to not list the contents of this directory.
Reason: http://localhost:5000 refers to the root of the webserver. So, for the above request, it tries to read the root folder of the server. However, IIS (express) by default doesn't allow you to view the file system. Therefore it shows above error.
Most probably you don't need to access the root of the server, instead you might need to access your webapp (ex: http://localhost:5000/myapp).
However, if you know exactly what you are doing then you can enable IIS to show the root directory (file system) using the following config in the Web.config of your application
Important: Below config should not be activated in a production or any
publicly reachable environment which is obviously a high critical
security issue.
<system.webServer>
<directoryBrowse enabled="true" />
<modules runAllManagedModulesForAllRequests="true"></modules>
</system.webServer>
Two things are usually the issue when I get this error:
1st: I never defined a standard document and changed it at some point - therefore the standard document that is automatically defined by the IIS in this case, doesn't exist
2nd: I didn't enable index search
You might want to try this. You can change those settings in the IIS settings directly.

Why am I getting error 500.0 in when using IIS Express (significant debug info included)

I created a blank MVC 3 application on VS2010 SP1, and set the app to use IIS Express. When I debug, I get error 500.0 (0x80070585)
I am able to succesfuly run the app using the VS dev server
I have set the app directory to Full Permissions for Everyone, just to eliminate all possibility of security issues. I have further verified that IIS express is able to hit the web.config by confirming it using SysInternals ProcMon. ProcMon does not show the IISExpress process attempting to read from any other files in my application directory.
I have followed the suggestions in the following question, but it does not give me any better information. HTTP 500 Internal Error - IIS websites
No logs are generated in the IISExpress directory in either the Logs or TraceLogs directory, but a log is created in Temp, however it is not very useful.
Successfully registered URL "http://localhost:62017/" for site "MvcApplication1" application "/"
Registration completed for site "MvcApplication1"
Request ended: http://localhost:62017/ with HTTP status 500.0
Request ended: http://localhost:62017/ with HTTP status 500.0
Request ended: http://localhost:62017/ with HTTP status 500.0
There are no messages I am able to find in the Event Viewer
**Updates : **
Disabled firewall, no change
Ran IISExpress via command line, no change
I had the same issue last week, the app running perfect in dev web server from VS Studio. But in IISExpress anytime HTTP Error 500. My solution on this time was:
close VS Studio - solution set with IISExpress
got to: /Document/IISExpress/config/ in your profile
rename or delete applicationhost.config
open your solution in VS Studio
a Dialog will fire up from IISExpress - this will set a fresh config.
try to run your web app
You may have some mime code in the Web.Config file like this:
<mimeMap fileExtension=".svg" mimeType="image/svg+xml" />
if so, you should remove mimeMap before adding like this:
.
..
...
....
</system.web>
<system.webServer>
<staticContent>
<remove fileExtension=".svg" />
<mimeMap fileExtension=".svg" mimeType="image/svg+xml" />
</staticContent>
</system.webServer>
....
...
..
.
This may be related to a conflict between the IIS Express applicationhost.config and your web.config.
A mimeType was added to my local web.config that was already present in the applicationhost.config and IIS Express started serving many 500 errors.
You may also notice this error in your Windows Event Log, "The directory specified for caching compressed content is invalid. Static compression is being disabled."
More info: http://blog.degree.no/2013/04/the-directory-specified-for-caching-compressed-content-is-invalid-static-compression-is-being-disabled/
I removed the mimeTypes from the web.config and the issue was resolved.
applicationhost.config location: C:\Users\[User]\Documents\IISExpress\config
reinstalling iis express appears to have resolved this problem
Are you using any PLINQ(.AsParallel) or Parallel.For or similar methods? I've found that the AggregateExceptions they throw aren't handled well by MVC (In my case, I got a blank 500 page and nothing in Logs/Event logs).
I identified the problem by paying attention to the "First Chance" exceptions which are logged in the Debug output window in VS. Try running the site, waiting for it to error, clearing the Debug window and the reloading the page. Do you see anything useful?
There might be a problem with your config files, specifically web.config and applicationhost.config.
The only way I know how to diagnose this, is to publish a build to regular IIS, and in IIS Manager check the "Error Pages" module of the Site. If it is indeed an issue with those config files, you'll get a popup here with something along the lines: "Cannot add duplicate entry of type …". Google accordingly.
If the "duplicate entry" is of type "error", you can try adding the following element below httpErrors:
<remove statusCode="404"/>
That is, assuming you have an Error element below the HttpErrors with statusCode 404. (I had once.)
In my case the issue was caused by using windows authentication + firefox + wrong domain login with insufficient permissions.
Details:
My dev machine is using windows domain "domA", the application will run in an environment accepting logins from domain "domA" and "domB". While on the webserver both will work, on my dev machine only my account in "domA" has sufficient permissions to access all files of the application. In IE "domA" is used by default while in FF I get a login dialog where I did login with my account from "domB".
Confusing issue I know, but maybe there is someone else having the same situation. At least it will help me the next time I run into it. :)
Just in case catches someone else out, I had similar error but the issue was I had updated my web.config and there was an extra ">" character where it should be.. so malformed web.config file can cause the same behaviour.

allowDefinition='MachineToApplication' - MVC3 ERROR

I'm developing an application in MVC3 (http://www.colombiatrolley.com/sitrolley). In my computer it runs correctly, but when I upload it to the server (a hosting service) I get this error:
Parser Error Message: It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS.
I know it is a very common error but I have not fixed it yet.
Some config sections are only allowed at the "root" of the application, then authentication section is one of them.
You need to configure IIS to run your your site as an application, not a sub-directory in an existing application.
For IIS 7+, right click the directory that contains your web application, and select "Convert to Application".
EDIT:
Arie van Someren is right. Looking carefully at your error, you want the <authentication> configuration to be in the web.config one level up, not the web.config in Views.
I had the same problem. I solved it by deleting the obj folder that appeared after doing a "Build > Publish".

Resources