I have an MVC web project that I am trying to host on godaddy using plesk for administration. My hosting settings for my web page is httpdocs\WebApplication18\WebApplication18/
I have pointed my web project to my configuration file inside WebApplication18.
Folder access to my files look like this:
Home Directory -> httpdocs -> WebApplication18 -> WebApplication18
-> views -> home -> Index.cshtml
-> web.conf
I am trying to browse to my index.cshtml page. I have set the root to run at WebApplication18 where
my configuration file is stored.
When I type in my hostname inside my address bar I recieve a file IO error that states:
Server Error in '/' Application.
Security Exception
Description: The application attempted to perform an operation not allowed by the security policy. To grant this application the required permission please contact your system administrator or change the application's trust level in the configuration file.
Exception Details: System.Security.SecurityException: Request for the permission of type 'System.Security.Permissions.FileIOPermission, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[SecurityException: Request for the permission of type 'System.Security.Permissions.FileIOPermission, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.]
System.Security.CodeAccessSecurityEngine.Check(Object demand, StackCrawlMark& stackMark, Boolean isPermSet) +0
System.Security.CodeAccessSecurityEngine.Check(CodeAccessPermission cap, StackCrawlMark& stackMark) +36
System.Security.CodeAccessPermission.Demand() +48
System.Web.HttpRuntime.get_AppDomainAppPath() +53
System.Web.WebPages.Deployment.PreApplicationStartCode.StartCore() +119
System.Web.WebPages.Deployment.PreApplicationStartCode.Start() +39
To begin with custom error mode was turned on, which I turned off in ASP.Nets
settings. I also commented out the compiler error in the web.conf file, which
reduced the error to a file io error.
The question I had was how can I point to my web page properly in my hosting settings
using mvc so that I can render my index.cshtml page using plesk on a godaddy server?
How am I able to fix this error message? I tried changing all of the permissions
lowered the CAS trust level and it makes no difference to the level of control
I have over my web page.
When I do a File Zilla upload sometimes I receive a certificate, but I just ignore
it and select ok.
This is only permission issue. Please kindly ask your provider to give full permission for you. It will fix your issue.
Related
What is the reason for the error page I get when I run my webapp in Visual Studio. The URL is http://localhost:5000/
HTTP Error 403.14 - Forbidden
The Web server is configured to not list the contents of this directory.
Reason: http://localhost:5000 refers to the root of the webserver. So, for the above request, it tries to read the root folder of the server. However, IIS (express) by default doesn't allow you to view the file system. Therefore it shows above error.
Most probably you don't need to access the root of the server, instead you might need to access your webapp (ex: http://localhost:5000/myapp).
However, if you know exactly what you are doing then you can enable IIS to show the root directory (file system) using the following config in the Web.config of your application
Important: Below config should not be activated in a production or any
publicly reachable environment which is obviously a high critical
security issue.
<system.webServer>
<directoryBrowse enabled="true" />
<modules runAllManagedModulesForAllRequests="true"></modules>
</system.webServer>
Two things are usually the issue when I get this error:
1st: I never defined a standard document and changed it at some point - therefore the standard document that is automatically defined by the IIS in this case, doesn't exist
2nd: I didn't enable index search
You might want to try this. You can change those settings in the IIS settings directly.
Works fine on the local machine, but when deployed this error message pops up:
HTTP Error 500.19 - Internal Server Error
The requested page cannot be accessed because the related configuration data for the page is invalid.
Detailed Error Information:
Module IIS Web Core
Notification BeginRequest
Handler Not yet determined
Error Code 0x80070021
Config Error This configuration section cannot be used at this path. This happens when the section is locked at a parent level. Locking is either by default (overrideModeDefault="Deny"), or set explicitly by a location tag with overrideMode="Deny" or the legacy allowOverride="false".
Config File \\?\C:\inetpub\foo\web.config
Requested URL http://foo.net:80/
Physical Path C:\inetpub\foo
Logon Method Not yet determined
Logon User Not yet determined
Config Source:
71: </modules>
72: <handlers> <--- This part is highlighted on the error page.
73: <add name="CassetteHttpHandler" path="cassette.axd" preCondition="integratedMode" verb="*" allowPathInfo="true" type="Cassette.Aspnet.CassetteHttpHandler, Cassette.Aspnet" />
More Information:
This error occurs when there is a problem reading the configuration file for the Web server or Web application. In some cases, the event logs may contain more information about what caused this error.
Any ideas on what I can do to solve this issue?
The way I solved this error was by going into the IIS Management window and selecting Feature Delegation and setting Read/Write to Handler Mappings and Modules.
Everything is working fine now.
my web app is using MVC3 with razor
If I am trying to read anything from ServiceConfig using RoleEnvironment.GetConfigurationSettingValue("senderName")
I am getting error related to Microsoft.IdentityModel
Unable to find assembly 'Microsoft.IdentityModel, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Runtime.Serialization.SerializationException: Unable to find assembly 'Microsoft.IdentityModel, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[SerializationException: Unable to find assembly 'Microsoft.IdentityModel, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.]
System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg) +4727747
System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type) +1725
System.AppDomain.get_Id() +0
<CrtImplementationDetails>.DoCallBackInDefaultDomain(IntPtr function, Void* cookie) +185
<CrtImplementationDetails>.LanguageSupport._Initialize(LanguageSupport* ) +328
<CrtImplementationDetails>.LanguageSupport.Initialize(LanguageSupport* ) +102
[ModuleLoadException: The C++ module failed to load while attempting to initialize the default appdomain.
]
.
It's true that I am making use of Windows identity foundation for Azure acs authentication .But everything worked fine when I deployed to azure.But if I make use of RoleEnvironment to read any settings from my ServiceConfig files (for ex :RoleEnvironment.GetConfigurationSettingValue("Smtpserver")) .Its failing on azure .
But everything workes fine on my local azure appfabric .If I am removing this line of code ,then all workes fine .RoleEnvironment.GetConfigurationSettingValue("Smtpserver"))
I am using two webroles in my cloud app.
Please help me identify the cause of error
How did you installed the WIF on the Azure?
The most reliable way is to have the WIF runtime installed via a startup task. You check out this question here. And I think this one is exact duplicate.
I had to customize the class MembershipProvider for the user validation is done by email.
But when you open the Asp.net Web Site Administration Tool, the "Security" tab the following error:
There is a problem with your selected data store. This can be caused
by an invalid server name or credentials, or by insufficient
permission. It can also be caused by the role manager feature not
being enabled. Click the button below to be redirected to a page where
you can choose a new data store.
The following message may help in diagnosing the problem: Type is not
resolved for member
'System.Data.Entity.ModelConfiguration.ModelValidationException,EntityFramework,
Version=4.1.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.
Because the code is great and not to pollute the topic, I put on github.
Code:
https://gist.github.com/1146084
While I am still new to MVC 3 and EF 4.1, try adding a line in your web.config for EntityFramework assembly. It seems like I had this problem as well with my setup. I can't remember the exact line, but it's something like (I will look it up when I get home):
<add assembly="System.Data.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
what is this error(comes up when i test my project)
-->
Unable to find the requested .Net Framework Data Provider. It may not be installed.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.ArgumentException: Unable to find the requested .Net Framework Data Provider. It may not be installed.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[ArgumentException: Unable to find the requested .Net Framework Data Provider. It may not be installed.]
System.Data.Common.DbProviderFactories.GetFactory(String providerInvariantName) +1402071
System.Web.UI.WebControls.SqlDataSource.GetDbProviderFactory() +67
System.Web.UI.WebControls.SqlDataSource.GetDbProviderFactorySecure() +22
System.Web.UI.WebControls.SqlDataSource.CreateConnection(String connectionString) +11
System.Web.UI.WebControls.SqlDataSourceView.ExecuteSelect(DataSourceSelectArguments arguments) +117
System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) +21
System.Web.UI.WebControls.DataBoundControl.PerformSelect() +143
System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +74
System.Web.UI.WebControls.GridView.DataBind() +4
System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound() +66
System.Web.UI.WebControls.CompositeDataBoundControl.CreateChildControls() +75
System.Web.UI.Control.EnsureChildControls() +102
System.Web.UI.Control.PreRenderRecursiveInternal() +42
System.Web.UI.Control.PreRenderRecursiveInternal() +175
System.Web.UI.Control.PreRenderRecursiveInternal() +175
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2496
This is the Configuration
<configuration>
<connectionStrings>
<add name="ConnectionString" connectionString="DataSource=C:\ProgramFiles\Microsoft SQL Server\MSSQL10.SQLEXPRESS\MSSQL\DATA\CIEDB.sdf;Password=sa;Persist Security Info=True"
providerName="Microsoft.SqlServerCe.Client.3.5" />
<add name="ConnectionString2" connectionString="Data Source=C:\Program Files\Microsoft SQL Server Compact Edition\v3.5\Samples\Northwind.sdf"
providerName="Microsoft.SqlServerCe.Client.3.5" />
</connectionStrings>
<system.web>
<compilation debug="true" targetFramework="4.0"/>
</system.web>
</configuration>
You probably have to set up the correct configuration information (connection strings) in the test project's .config file
Edit: with that config, I did some searching and came across this forum thread:
http://social.msdn.microsoft.com/Forums/en-US/sqlce/thread/ff731bf4-1f50-4f77-955b-e4534474a271/
Where the apparent accepted answer was:
I fix my issue by manually install
SSCEVSTools-Enu.msi from Vs SP1.
There were a few other results on Bing that may be useful as well. Hope it helps
I had this same error when I installed Visual Studio 2010 SP1, then rolled back after I found out it was not so great (major understatement... stay far away from VS2010 SP1). I found online that I could fix this by reinstalling the and I got that file from here. After the reinstall of that software, i started VS 2010 and everything was back to normal. Hope it works for you.
Here is the link I used to get that package:
http://download.microsoft.com/download/0/5/D/05DCCDB5-57E0-4314-A016-874F228A8FAD/SSCEVSTools-ENU.msi
From your description, I assume the connection string is invalid. One easy way to create a working connection string is the following:
Create a new, empty text file on the desktop
Change its file extenstion to .udl
Double click on it. This opens the connection wizard.
Configure the connection. Then click on TEST. If the connection succeeds, close the wizard
Open the .udl file in a text editor. It contains a valid connection string.
Copy the connection string from the text editor into your Visual Studio data source string.