I hosted my MVC website in plesk by using FTP publish option of VS2013 and everything went fine, I mean all the required files were copied properly in the destination under httpdocs virtual directory. But I am getting below error now when I visit the URL:
I have tried all the possible solutions mentioned in many links but no proper solution I have got so for! Its making me real confusing about this!
I have tried to apply solutions in this and also checked this question but none of them were useful. My web.config
file is as below:
<configuration>
<configSections>
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=sometoken" requirePermission="false" />
</configSections>
<appSettings>
<!--<add key="MaintenanceMode" value="false" />-->
<add key="webpages:Version" value="3.0.0.0" />
<add key="webpages:Enabled" value="false" />
<add key="ClientValidationEnabled" value="true" />
<add key="UnobtrusiveJavaScriptEnabled" value="true" />
<add key="SessionTimeoutRedirect" value="true" />
<add key="isAjaxHandled" value="false" />
</appSettings>
<system.web>
<customErrors mode="Off" />
<trust level="Full"/>
<compilation targetFramework="4.0" defaultLanguage="c#"/>
<httpRuntime executionTimeout="1048576" maxRequestLength="100000" />
<globalization culture="en-IN" uiCulture="en-IN" />
<authentication mode="Forms">
<forms loginUrl="~/Account/Login" defaultUrl="~/Admin/Index" timeout="2880" protection="Encryption" slidingExpiration="true" cookieless="AutoDetect" />
</authentication>
<pages controlRenderingCompatibilityVersion="4.0" />
</system.web>
<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework" />
<providers>
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
</providers>
</entityFramework>
<connectionStrings>
<add name="MCBConnectionString" connectionString="metadata=res://*/Models.EntityDataModel.MCBEntityModel.csdl|res://*/Models.EntityDataModel.MCBEntityModel.ssdl|res://*/Models.EntityDataModel.MCBEntityModel.msl;provider=System.Data.SqlClient;provider connection string="Data Source=somesource;Network Library=;Packet Size=4096;Integrated Security=no;User ID=uid;Password=pwd;Encrypt=yes;TrustServerCertificate=True; integrated security=no;connect timeout=120;MultipleActiveResultSets=True;App=EntityFramework"" providerName="System.Data.EntityClient" />
</connectionStrings>
<system.webServer>
<security>
<requestFiltering>
<requestLimits maxAllowedContentLength="1073741824" />
</requestFiltering>
</security>
</system.webServer>
</configuration>
Below is the file structure in Plesk Admin panel
One more thing to note: If I remove <trust level="Full"/>
tag from web.config
I will not get any error but no display too. A blank page will be shown
Am really confused about this! I am left with no other alternatives except to approach this forum now! Any experts out there who faced this issue or anything I have to configure more on web.config
?
2
Answers
Place The below code
<compilation debug="true" targetFramework="4.0">
instead of
hope it’s works
This Link actually helps you to identify any sort of issues if it is not displayed in the server and thus I [OP] was able to fix my problem by identifying the issue.
Below is what the link contains:
If you are using asp.net mvc5, it needs full trust, which is not supported by plesk (host gator) at the moment I write this.
If that is the case you need to downgrade to mvc4 or find another hosting provider which supports full trust