Tag: IIS

Could not load file or assembly … An attempt was made to load a program with an incorrect format (System.BadImageFormatException)

There are times when you might get the following error when running the application from Visual Studio or opening your application page in the browser. Could not load file or assembly … An attempt was made to load a program with an incorrect format (System.BadImageFormatException) I received this error recently when trying to deploy the application in the IIS and accessing the page from the…

Server.MapPath with usage of . , .. , ~ and / Characters in ASP.NET

When using Server.MapPath in ASP.NET, the developers can specify the characters as shown below. var path1 = Server.MapPath(“.”)var path2 = Server.MapPath(“..”)var path3 = Server.MapPath(“~”)var path4 = Server.MapPath(“/”) What is the difference between the above methods ? Assume that the website is installed in the path D:\WebApplications\Abundantcode and the root of the IIS is C:\Inetpub\wwwroot and assume that the current page is https://abundantcode.com/popularposts The path1 will…

Liked this content?. Please spread the word :)