I made an MVC app that hosts a vsto click once installer. The setup.exe installs the app well when its in local host but when it's in a hosted app service the click once is producing an error with this message
"Application manifest has either a different computed hash than the one specified or no hash specified at all"
I don't think that it has a problem with manifest files as it's working correctly in local host. This is currently how I let the click once access the files
public ActionResult vsto(string id,string id2,string id3)
{
string path = String.IsNullOrEmpty(id2)? @"~\vsto\" + id : @"~\vsto\" + id + @"\" + id2 + @"\" +id3;
string extension = Path.GetExtension(path);
string fileName = Path.GetFileName(path);
string content = "application /octet-stream";
if (String.Equals(extension, ".manifest"))
{
content = "application/x-ms-manifest";
}
else if (String.Equals(extension, ".application"))
{
content = "application/x-ms-application";
}
return File(path, content, fileName);
}
and I also have this in my web config.
<system.webServer>
<staticContent>
<remove fileExtension=".application" />
<mimeMap fileExtension=".application" mimeType="application/x-ms-application" />
<remove fileExtension=".manifest" />
<mimeMap fileExtension=".manifest" mimeType="application/x-ms-manifest" />
<remove fileExtension=".deploy" />
<mimeMap fileExtension=".deploy" mimeType="application/octet-stream" />
<remove fileExtension=".msu" />
<mimeMap fileExtension=".msu" mimeType="application/octet-stream" />
<remove fileExtension=".msp" />
<mimeMap fileExtension=".msp" mimeType="application/octet-stream" />
</staticContent>
</system.webServer>
For anyone that would suggest to use a Storage Account.I had problems using storage account so I need to resort with this method.
Thanks.