Developer forum

Forum » Dynamicweb 10 » Clean swift installation

Clean swift installation

Totte Perera
Reply

Hi.

I've followed the instrucitons for installing Swift on a DW10 solution. Here: https://doc.dynamicweb.dev/documentation/fundamentals/setup/installation/install-using-swift.html

What I've dowloaded:
Swift_v1.23.0_Files
Swift_20230629_DemoProductImages
Swift_20230629_Database

When I navigate to Swift B2C Demo Shop -> Content -> Home I receive the error message below.
I get error messages on any of the pages that I try.

What am I doing wrong?

/Totte

 

Error compiling template "Designs/Swift/Paragraph/Swift_ImpersonationBar.cshtml" Line 20: 'User.GetSecondaryUsers()' is obsolete: 'Use UserContext.Current.GetImpersonatableUsers() instead.' Line 21: 'User.GetSecondaryUsers()' is obsolete: 'Use UserContext.Current.GetImpersonatableUsers() instead.' Line 24: 'User.GetCurrentSecondaryUser()' is obsolete: 'Use UserContext.Current.ImpersonatingUser instead.' Line 46: 'User.GetCurrentSecondaryUser()' is obsolete: 'Use UserContext.Current.ImpersonatingUser instead.' Line 49: The name 'RenderSecondaryUser' does not exist in the current context Line 53: The name 'RenderUser' does not exist in the current context Line 55: The name 'RenderSwitchUser' does not exist in the current context Line 57: The name 'RenderSignOut' does not exist in the current context Line 67: The name 'RenderUser' does not exist in the current context Line 69: The name 'RenderSignIn' does not exist in the current context Line 84: The name 'helper' does not exist in the current context Line 88: The name 'helper' does not exist in the current context Line 90: The name 'currentSecondaryUserName' does not exist in the current context Line 92: The name 'helper' does not exist in the current context Line 102: The name 'helper' does not exist in the current context Line 113: The name 'CustomerListLink' does not exist in the current context Line 118: The name 'helper' does not exist in the current context Line 129: The name 'CustomerListLink' does not exist in the current context

1 // <auto-generated/> 2 #pragma warning disable 1591 3 namespace CompiledRazorTemplates.Dynamic 4 { 5 #line hidden 6 using System.Threading.Tasks; 7 using System; 8 using System.Collections.Generic; 9 using System.Linq; 10 using Dynamicweb; 11 internal class RazorEngine_249244d94a0e4fccbe1d68a29d1a3ec0 : Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.ParagraphViewModel> 12 { 13 #pragma warning disable 1998 14 public async override global::System.Threading.Tasks.Task ExecuteAsync() 15 { 16 WriteLiteral("\n"); 17 18 bool canImpersonate = false; 19 20 if (Pageview.User?.GetSecondaryUsers() != null) { 21 canImpersonate = Pageview.User.GetSecondaryUsers().Count != 0 ? true : false; 22 } 23 WriteLiteral("\n"); 24 if (canImpersonate || Dynamicweb.Security.UserManagement.User.GetCurrentSecondaryUser() != null) { 25 WriteLiteral("\t<div"); 26 BeginWriteAttribute("class", " class=\"", 386, "\"", 536, 11); 27 WriteAttributeValue("", 394, "d-flex", 394, 6, true); 28 WriteAttributeValue(" ", 400, "flex-column", 401, 12, true); 29 WriteAttributeValue(" ", 412, "flex-md-row", 413, 12, true); 30 WriteAttributeValue(" ", 424, "align-items-center", 425, 19, true); 31 WriteAttributeValue(" ", 443, "justify-content-end", 444, 20, true); 32 WriteAttributeValue(" ", 463, "gap-2", 464, 6, true); 33 WriteAttributeValue(" ", 469, "fs-7", 470, 5, true); 34 WriteAttributeValue(" ", 474, "text-center", 475, 12, true); 35 WriteAttributeValue(" ", 486, "text-md-end", 487, 12, true); 36 WriteAttributeValue(" ", 498, "item_", 499, 6, true); 37 WriteAttributeValue("", 504, Model.Item.SystemName.ToLower(), 504, 32, false); 38 EndWriteAttribute(); 39 WriteLiteral(">\n\t\t<div"); 40 BeginWriteAttribute("id", " id=\"", 545, "\"", 559, 1); 41 WriteAttributeValue("", 550, Model.ID, 550, 9, false); 42 EndWriteAttribute(); 43 WriteLiteral(" class=\"user-select-none\" style=\"scroll-margin-top:var(--header-height,150px)\"></div>\n"); 44 if (Pageview?.User != null) 45 { 46 if (Dynamicweb.Security.UserManagement.User.GetCurrentSecondaryUser() != null) 47 { 48 WriteLiteral("\t\t\t\t<div>\n"); 49 Write(RenderSecondaryUser()); 50 WriteLiteral("\t\t\t\t\t<span>\n\t\t\t\t\t\t"); 51 Write(Translate("is signed in as")); 52 WriteLiteral("\n\t\t\t\t\t</span>\n"); 53 Write(RenderUser()); 54 WriteLiteral("\t\t\t\t</div>\n\t\t\t\t<div class=\"d-flex justify-content-around gap-2\">\n"); 55 Write(RenderSwitchUser()); 56 WriteLiteral("\t\t\t\t\t<span class=\"border-2 border-end h-auto my-1\"></span>\n"); 57 Write(RenderSignOut()); 58 WriteLiteral("\t\t\t\t</div> "); 59 } 60 else 61 { 62 if (Pageview.User != null) 63 { 64 WriteLiteral("\t\t\t\t\t<div>\n\t\t\t\t\t\t<span>"); 65 Write(Translate("You are signed in as")); 66 WriteLiteral("</span>\n"); 67 Write(RenderUser()); 68 WriteLiteral("\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"d-flex justify-content-around gap-2\">\n"); 69 Write(RenderSignIn()); 70 WriteLiteral("\t\t\t\t\t</div>\n"); 71 } 72 73 } 74 } 75 WriteLiteral("\t</div>\n"); 76 } 77 WriteLiteral("\n"); 78 if (Pageview.IsVisualEditorMode && !canImpersonate) { 79 WriteLiteral(" <div class=\"alert alert-info mt-3\" role=\"alert\">\n <span>"); 80 Write(Translate("Impersonation bar: Edit this column to configure")); 81 WriteLiteral("</span>\n </div>\n"); 82 } 83 WriteLiteral("\n"); 84 Write(helper); 85 WriteLiteral(" RenderUser()\n{\n\t<span class=\"fw-bold\">"); 86 Write(Pageview.User.Name); 87 WriteLiteral("</span>\n}\n\n"); 88 Write(helper); 89 WriteLiteral(" RenderSecondaryUser()\n{\n\tstring currentSecondaryUserName = Dynamicweb.Security.UserManagement.User.GetCurrentSecondaryUser().Name;\n\t<span class=\"fw-bold\">"); 90 Write(currentSecondaryUserName); 91 WriteLiteral("</span>\n}\n\n"); 92 Write(helper); 93 WriteLiteral(" RenderSignOut()\n{\n\t<a"); 94 BeginWriteAttribute("href", " href=\"", 1872, "\"", 1941, 3); 95 WriteAttributeValue("", 1879, "Default.aspx?ID=", 1879, 16, true); 96 WriteAttributeValue("", 1895, Pageview.ID, 1895, 14, false); 97 WriteAttributeValue("", 1909, "&DwExtranetRemoveSecondaryUser=1", 1909, 32, true); 98 EndWriteAttribute(); 99 WriteLiteral(" class=\"btn btn-sm btn-link text-reset p-0 swift_sign-out-as-customer-link\">"); 100 Write(Translate("Sign out as customer")); 101 WriteLiteral("</a>\n}\n\n"); 102 Write(helper); 103 WriteLiteral(@" RenderSignIn() 104 { 105 Dynamicweb.Frontend.LinkViewModel CustomerListLink = Model.Item.GetLink(""Link""); 106 string title = !string.IsNullOrEmpty(Model.Item.GetString(""Title"")) ? Model.Item.GetString(""Title"") : """"; 107 108 if (CustomerListLink != null) 109 { 110 <span class=""d-none d-md-block border-2 border-end h-auto my-1""></span> 111 <a"); 112 BeginWriteAttribute("href", " href=\"", 2387, "\"", 2415, 1); 113 WriteAttributeValue("", 2394, CustomerListLink.Url, 2394, 21, false); 114 EndWriteAttribute(); 115 WriteLiteral(" class=\"btn btn-sm btn-link text-reset p-0 swift_sign-in-as-customer-link\">"); 116 Write(Translate("Sign in as customer")); 117 WriteLiteral("</a>\n\t}\n}\n\n"); 118 Write(helper); 119 WriteLiteral(@" RenderSwitchUser() 120 { 121 Dynamicweb.Frontend.LinkViewModel CustomerListLink = Model.Item.GetLink(""Link""); 122 string title = !string.IsNullOrEmpty(Model.Item.GetString(""Title"")) ? Model.Item.GetString(""Title"") : """"; 123 124 if (CustomerListLink != null) 125 { 126 <span class=""d-none d-md-block border-2 border-end h-auto my-1""></span> 127 <a"); 128 BeginWriteAttribute("href", " href=\"", 2866, "\"", 2894, 1); 129 WriteAttributeValue("", 2873, CustomerListLink.Url, 2873, 21, false); 130 EndWriteAttribute(); 131 WriteLiteral(" class=\"btn btn-sm btn-link text-reset p-0 swift_switch-customer-link\">"); 132 Write(Translate("Switch to another customer")); 133 WriteLiteral("</a>\n\t}\n}\n\n"); 134 } 135 #pragma warning restore 1998 136 } 137 } 138 #pragma warning restore 1591 139

1 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.ParagraphViewModel> 2 @using Dynamicweb 3 4 @{ 5 bool canImpersonate = false; 6 7 if (Pageview.User?.GetSecondaryUsers() != null) { 8 canImpersonate = Pageview.User.GetSecondaryUsers().Count != 0 ? true : false; 9 } 10 } 11 12 @if (canImpersonate || Dynamicweb.Security.UserManagement.User.GetCurrentSecondaryUser() != null) { 13 <div class="d-flex flex-column flex-md-row align-items-center justify-content-end gap-2 fs-7 text-center text-md-end item_@Model.Item.SystemName.ToLower()"> 14 <div id="@Model.ID" class="user-select-none" style="scroll-margin-top:var(--header-height,150px)"></div> 15 @if (Pageview?.User != null) 16 { 17 if (Dynamicweb.Security.UserManagement.User.GetCurrentSecondaryUser() != null) 18 { 19 <div> 20 @{ @RenderSecondaryUser() } 21 <span> 22 @Translate("is signed in as") 23 </span> 24 @{ @RenderUser() } 25 </div> 26 <div class="d-flex justify-content-around gap-2"> 27 @{ @RenderSwitchUser() } 28 <span class="border-2 border-end h-auto my-1"></span> 29 @{ @RenderSignOut() } 30 </div> } 31 else 32 { 33 if (Pageview.User != null) 34 { 35 <div> 36 <span>@Translate("You are signed in as")</span> 37 @{ @RenderUser() } 38 </div> 39 <div class="d-flex justify-content-around gap-2"> 40 @{ @RenderSignIn() } 41 </div> 42 } 43 44 } 45 } 46 </div> 47 } 48 49 @if (Pageview.IsVisualEditorMode && !canImpersonate) { 50 <div class="alert alert-info mt-3" role="alert"> 51 <span>@Translate("Impersonation bar: Edit this column to configure")</span> 52 </div> 53 } 54 55 @helper RenderUser() 56 { 57 <span class="fw-bold">@Pageview.User.Name</span> 58 } 59 60 @helper RenderSecondaryUser() 61 { 62 string currentSecondaryUserName = Dynamicweb.Security.UserManagement.User.GetCurrentSecondaryUser().Name; 63 <span class="fw-bold">@currentSecondaryUserName</span> 64 } 65 66 @helper RenderSignOut() 67 { 68 <a href="Default.aspx?ID=@(Pageview.ID)&DwExtranetRemoveSecondaryUser=1" class="btn btn-sm btn-link text-reset p-0 swift_sign-out-as-customer-link">@Translate("Sign out as customer")</a> 69 } 70 71 @helper RenderSignIn() 72 { 73 Dynamicweb.Frontend.LinkViewModel CustomerListLink = Model.Item.GetLink("Link"); 74 string title = !string.IsNullOrEmpty(Model.Item.GetString("Title")) ? Model.Item.GetString("Title") : ""; 75 76 if (CustomerListLink != null) 77 { 78 <span class="d-none d-md-block border-2 border-end h-auto my-1"></span> 79 <a href="@CustomerListLink.Url" class="btn btn-sm btn-link text-reset p-0 swift_sign-in-as-customer-link">@Translate("Sign in as customer")</a> 80 } 81 } 82 83 @helper RenderSwitchUser() 84 { 85 Dynamicweb.Frontend.LinkViewModel CustomerListLink = Model.Item.GetLink("Link"); 86 string title = !string.IsNullOrEmpty(Model.Item.GetString("Title")) ? Model.Item.GetString("Title") : ""; 87 88 if (CustomerListLink != null) 89 { 90 <span class="d-none d-md-block border-2 border-end h-auto my-1"></span> 91 <a href="@CustomerListLink.Url" class="btn btn-sm btn-link text-reset p-0 swift_switch-customer-link">@Translate("Switch to another customer")</a> 92 } 93 } 94

 


Replies

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply

Can you show what you have in your Swift_ImpersonationBar.cshtml file?

Does it differ from this one: https://github.com/dynamicweb/Swift/blob/main/Swift/Files/Templates/Designs/Swift/Paragraph/Swift_ImpersonationBar.cshtml

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply

And you need to use Swift 1.24 for DW10 without conversion checkboxeshttps://github.com/dynamicweb/Swift/releases/tag/v1.24.0

 
Totte Perera
Reply

Hi Nicolai.

Ok thanks, I didn't see that there was a 1.24 out there - I will try with that one.

Another question on the topic. Every time I start my project im redirected to https://localhost:34825/Admin/Installation/Step1

How can I make sure that I don't have to do the installation step every time?

 
Justin Sjouw Dynamicweb Employee
Justin Sjouw
Reply

Hi Totte,

The installation is shown when not all parameters for starting up the solution can be resolved. Most times it is something like:

  • A misconfiguration of the Files path (not there, no permissions)
  • Missing GlobalSettings.Database.Config file 
  • Some other settings missing in GLobalSettings.config (usually not the case if you take the one from Swift/GitHub)

Hope that helps,

Justin

 

You must be logged in to post in the forum