Search This Blog

Wednesday, November 26, 2014

Could not load file or assembly 'AjaxControlToolkit, Version=1.0.10301.0, Culture=neutral, PublicKeyToken=28f01b0e84b6d53e' or one of its dependencies. Access Denied (Zugriff verweigert)

Review the permissions of the user that you're trying to impersonate.

In my situation, I was only getting the error on my development machine, rather than on our staging or deployment servers. (For while I got around this by removing the 'identity' node from web.config in my dev environment and just adding the line in post-build so it wasn't a problem anyone other than me.

Thursday, November 20, 2014

Migration from Visual Studio 2008 to 2013 : Website is not running (throwing access denied error)

Migration from Visual Studio 2008 to 2013

Without any code changes I successfully migrated from VS 2008 to 2013 but when running website from VS 2013 I got below error.

Server Error in '/' Application.
Access is denied.
Description: An error occurred while accessing the resources required to serve this request. The server may not be configured for access to the requested URL.

Error message 401.2.: Unauthorized: Logon failed due to server configuration. Verify that you have permission to view this directory or page based on the credentials you supplied and the authentication methods enabled on the Web server. Contact the Web server's administrator for additional assistance.
________________________________________
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.18408


Change the below settings to make everything works.

1. Goto Project properties (F4)
2. Update AnonymousAuthentication to Disabled
3. Update WindowsAuthentication to Enabled

Another way also u can change the settings
Go to "\My Documents\IISExpress\config\applicationhost.config" folder and update anonymousAuthentication to be false and the windowsAuthentication mode to true.

Wednesday, November 12, 2014

System.InvalidOperationException: The path / could not be assigned report viewer (Der Pfad / konnte nicht zugeordnet werden)

Report Viewer and (Vista x64 or Windows 7 64 bit)
I have the following problem:

1. Create a new website
2. Insert the reportviewer control.
3. Run the application. An error occurs. The same code runs under XP x86 with no problem, but does not work with Vista x64.

Source of the aspx:

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>

<%@ Register Assembly="Microsoft.ReportViewer.WebForms, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" Namespace="Microsoft.Reporting.WebForms" TagPrefix="rsweb" %>



Untitled Page







This is the error message:


[InvalidOperationException: The path / cannot assigned.]
System.Web.Configuration.ProcessHostConfigUtils.MapPathActual(String siteName, VirtualPath path) +261
System.Web.Configuration.ProcessHostMapPath.MapPathCaching(String siteID, VirtualPath path) +580
System.Web.Configuration.ProcessHostMapPath.GetPathConfigFilenameWorker(String siteID, VirtualPath path, String& directory, String& baseName) +19
System.Web.Configuration.ProcessHostMapPath.System.Web.Configuration.IConfigMapPath.GetPathConfigFilename(String siteID, String path, String& directory, String& baseName) +37
System.Web.Configuration.HostingPreferredMapPath.GetPathConfigFilename(String siteID, String path, String& directory, String& baseName) +77
System.Web.Configuration.WebConfigurationHost.GetStreamName(String configPath) +166
System.Configuration.Internal.DelegatingConfigHost.GetStreamName(String configPath) +10
System.Configuration.BaseConfigurationRecord.InitConfigFromFile() +249

[ConfigurationErrorsException: Error during load of configuration file.: The path / cannot assigned.]
System.Configuration.ConfigurationSchemaErrors.ThrowIfErrors(Boolean ignoreLocal) +246879
System.Configuration.BaseConfigurationRecord.ThrowIfParseErrors(ConfigurationSchemaErrors schemaErrors) +40
System.Configuration.Configuration..ctor(String locationSubPath, Type typeConfigHost, Object[] hostInitConfigurationParams) +412
System.Configuration.Internal.InternalConfigConfigurationFactory.System.Configuration.Internal.IInternalConfigConfigurationFactory.Create(Type typeConfigHost, Object[] hostInitConfigurationParams) +29
System.Web.Configuration.WebConfigurationHost.OpenConfiguration(WebLevel webLevel, ConfigurationFileMap fileMap, VirtualPath path, String site, String locationSubPath, String server, String userName, String password, IntPtr tokenHandle) +961
System.Web.Configuration.WebConfigurationManager.OpenWebConfigurationImpl(WebLevel webLevel, ConfigurationFileMap fileMap, String path, String site, String locationSubPath, String server, String userName, String password, IntPtr userToken) +84
System.Web.Configuration.WebConfigurationManager.OpenWebConfiguration(String path) +36
Microsoft.Reporting.WebForms.ReportViewer.ConfigContainsHandler() +80
Microsoft.Reporting.WebForms.ReportViewer.OnInit(EventArgs e) +96
System.Web.UI.Control.InitRecursive(Control namingContainer) +321
System.Web.UI.Control.InitRecursive(Control namingContainer) +198
System.Web.UI.Control.InitRecursive(Control namingContainer) +198
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +7092
System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +213
System.Web.UI.Page.ProcessRequest() +86
System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context) +18
System.Web.UI.Page.ProcessRequest(HttpContext context) +49
ASP.default_aspx.ProcessRequest(HttpContext context) in c:\Users\fritz.MSE\AppData\Local\Temp\Temporary ASP.NET Files\website1\7d6f2e0f\c6b6426d\App_Web_9thttpm_.0.cs:0
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +362
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +64

Solution

You have to run as administrator due to UAC on Windows Vista/7

Popular Posts