IIS 7.5 and IIS 8.0 European Hosting

BLOG about IIS 7.5 Hosting, IIS 8.0 Hosting and Its Technology - Dedicated to European Windows Hosting Customer

IIS Hosting UK - HostForLIFE.eu :: The Entry ‘DefaultConnection’ Has Already Been Added

clock September 19, 2025 10:20 by author Peter

Recently, we were facing this error while deploying the asp.net solution into the server (IIS) as a separate application (Sub Domain) in a main web application.


Scenario
I created a website (say site mymainsite) in window server IIS under a port and then added an another application ( plugin ) under a root-site (mymainsite ) as shown,

After deploying the solution, when I opened the site, I got this error. Oops!!!
 
“The entry ‘DefaultConnection’ has already been added. (C:..\web.config line ..)”
 
With some research, I found that it was conflicting with the parent site connection provider. There was a same connection name (DefaultConection) in the parent site.
 
If you have another project using the same connection string name you will receive this error because that connection string has already been added to the collection.
 
Solution
We can fix this by updating the web.config file.
<remove name="DefaultConnection" />
 
Add the above tag with connection string name just above the connection key.
 
Alternatively, you can clear all connection string adding below tag.
<clear />
 
Cheers!!



IIS Hosting UK - HostForLIFE.eu :: Enable IIS Server to Serve .mp4 Files through web.config File

clock September 4, 2025 10:00 by author Peter

These days, the majority of websites are created with HTML5 and backdrop videos. Using the video tag is a simple task. Although using a CDN is recommended for serving video files, you must set up IIS to serve.mp4 files if you wish to host videos from your own server. A 404 error or an error stating that "The page you are requesting cannot be served because of the extension configuration" may appear if you don't configure it. 

If the page is a script, add a handler. If the file should be downloaded, add a MIME map.” Again, if you have got access to IIS , it’s a great thing but what if you’re hosting the website on a shared server where you don’t have access to IIS Server? In this post, we will see how can we enable IIS Server to serve .mp4 files through web.config file.

To allow IIS to server files, we need to configure proper mimeType for the required files. The mimeType for a .mp4 is video/mp4. Just add the following line in your web.config file under system.webServer tag and you should be good to go.

    <configuration>  
        <system .webServer>  
            <staticcontent>  
                <mimemap fileExtension=".mp4" mimeType="video/mp4"></mimemap>  
            </staticcontent>  
        </system>  
    </configuration>  


Once you do the above changes, your web server should start serving .mp4 files without issues. Hope this blog post helps you! In case you know other ways of doing the same, do let me know via comments.



About HostForLIFE.eu

HostForLIFE.eu is European Windows Hosting Provider which focuses on Windows Platform only. We deliver on-demand hosting solutions including Shared hosting, Reseller Hosting, Cloud Hosting, Dedicated Servers, and IT as a Service for companies of all sizes.

We have offered the latest Windows 2016 Hosting, ASP.NET Core 2.2.1 Hosting, ASP.NET MVC 6 Hosting and SQL 2017 Hosting.


Tag cloud

Sign in