Skip to content

Commit 275d169

Browse files
committed
Adding a try catch. If it does not work, the admin has to modify the file by hand.
1 parent f58f0ad commit 275d169

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

eFormAPI/Installation/CustomActions/CustomAction.cs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -391,13 +391,17 @@ public static ActionResult UpdateCA(Session session)
391391

392392
public static bool HandleUpdateWebConfigFile(string filePath)
393393
{
394+
try
395+
{
396+
var fileContents = File.ReadAllText(filePath + @"\Web.config");
394397

395-
var fileContents = File.ReadAllText(filePath + @"\Web.config");
398+
fileContents = fileContents.Replace("<bindingRedirect oldVersion=\"0.0.0.0 - 10.0.0.0\" newVersion=\"10.0.0.0\" />",
399+
"<bindingRedirect oldVersion=\"0.0.0.0 - 11.0.0.0\" newVersion=\"11.0.0.0\" />");
396400

397-
fileContents = fileContents.Replace("<bindingRedirect oldVersion=\"0.0.0.0 - 10.0.0.0\" newVersion=\"10.0.0.0\" />",
398-
"<bindingRedirect oldVersion=\"0.0.0.0 - 11.0.0.0\" newVersion=\"11.0.0.0\" />");
401+
File.WriteAllText(filePath, fileContents);
402+
} catch { }
399403

400-
File.WriteAllText(filePath, fileContents);
404+
401405

402406
return true;
403407
}

0 commit comments

Comments
 (0)