Let’s encrypt win simple and Asp.Net Forms Authentication

0 Comments

I am using https://github.com/Lone-Coder/letsencrypt-win-simple for a while now and moved to 1.9.5.1 today. It has a great new feature. Updating my webapplications was done by changing the path in IIS

For instance: C:/www/website1/20170918 had a newer version in C:/www/website1/20170919 So I just changed the path in IIS and could revert back to the older version in seconds. The Let’s Encrypt application got confused by this, because it stored the path in the registry. The latest version checks the IIS meta database for the current path, which is really nice for me.

But back on topic: The Asp.Net forms auth can be an issue. When the Let’s Encrypt tries to reach the .well-know dir, it get’s a redirect to the configured login page.

I tried to fix this by excluding the well-known dir in my web.config but that broke my web applciation (error 500)

I have also tried to escape the . (dot)

<location path=".well-known">
<system.web>
<authorization>
<allow users="*" />
</authorization>
</system.web>
</location>

Like this:

<location path="\.well-known">
<system.web>
<authorization>
<allow users="*" />
</authorization>
</system.web>
</location>

But that also gave me the 500 error. So The only workaround I could think of was to temporarily comment out some lines:

<authentication mode="Forms">
<forms name=".ASPXAUTH" loginUrl="Login.aspx" protection="All" path="/" timeout="120" defaultUrl="Index.aspx" slidingExpiration="true" />
</authentication>
<authorization>
<deny users="?" />
<allow users="*" />
</authorization>

And ran the letsencrypt.exe follow the wizard, and uncomment the part again and save the web.config. Please contact me if you have a better or more permanent solution by mail or tweet.

Good luck!

Pin on pinterest Plus on Googleplus Post on LinkedIn

MasterPageFile in web.config does not work

0 Comments

I have set a theme for this webform project in the web.config file and also a masterpagefile

<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.web>
<pages  theme="themeName" masterPageFile="~/mp1.master" />
</system.web>
</configuration>


Unfortunatly this did not work. I have spend a long time searching why my application kept showing the old masterpagefile. I believe that it had to do with this checkbox:

When you publish your webform application and click on configure, you should set the checkbox near the ‘allow precompiled site to be updatable’.

Otherwise it seems that during the compilation, it will bake in the configured masterpage file in your *.aspx files.

Please let me know if I am wrong, but this did fix it for me.

Good luck!

Pin on pinterest Plus on Googleplus Post on LinkedIn

Manage users for webform auth missing option in Visual Studio

0 Comments

I have blogged about this in November 2013 which is almost 2 years ago.

run as admin (windows key + X) command prompt as admin

C:\Program Files (x86)\IIS Express\iisexpress.exe" /path:C:\Windows\Microsoft.NET\Framework\v4.0.30319\ASP.NETWebAdminFiles /vpath:"/webadmin" /port:12345 /clr:4.0 /ntlm

http://localhost:12345/webadmin/default.aspx?applicationPhysicalPath=C:\Path\to\your\webformcode\&applicationUrl=/

and then there was this stacktrace and error… I have not had this issue before. It was since the 4.6 framework was installed.

Thankfully I found this stackoverflow answer which resolves it:

open "C:\Windows\Microsoft.NET\Framework\v4.0.30319\ASP.NETWebAdminFiles\App_Code\WebAdminPage.cs"

in notepad++ and ctrl+g (go to) line 989 and give the string appId the value of “1” instead of the stringutil.blabla

save and reload the page.

No more error on:

StringUtil.GetNonRandomizedHashCode(String.Concat(appPath, appPhysPath)).ToString("x", CultureInfo.InvariantCulture);

Good luck!

Pin on pinterest Plus on Googleplus Post on LinkedIn