1

我有一个名为约会的 webforms 4/5 应用程序。我正在尝试从子文件夹 /m 或 /mobile 运行 mvc 4.5 移动网站模板应用程序,但没有多大成功。我仍在学习,并且在 IIS 上有些挣扎。如果我只是将我的移动应用程序发布到子文件夹中,我会收到以下错误:

"Parser Error Message: It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level.  This error can be caused by a virtual directory not being configured as an application in IIS."

Line 27:     <authentication mode="Forms">

当我将文件夹设置为虚拟目录或将其转换为应用程序时,出现以下错误:

Could not load file or assembly 'AjaxControlToolkit' or one of its dependencies. The system cannot find the file specified.

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.IO.FileNotFoundException: Could not load file or assembly 'AjaxControlToolkit' or one of its dependencies. The system cannot find the file specified.

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.

Assembly Load Trace: The following information can be helpful to determine why the assembly 'AjaxControlToolkit' could not be loaded.


=== Pre-bind state information ===
LOG: User = IIS APPPOOL\Dating
LOG: DisplayName = AjaxControlToolkit
 (Partial)
WRN: Partial binding information was supplied for an assembly:
WRN: Assembly Name: AjaxControlToolkit | Domain ID: 8
WRN: A partial bind occurs when only part of the assembly display name is provided.
WRN: This might result in the binder loading an incorrect assembly.
WRN: It is recommended to provide a fully specified textual identity for the assembly,
WRN: that consists of the simple name, version, culture, and public key token.
WRN: See whitepaper http://go.microsoft.com/fwlink/?LinkId=109270 for more information and common solutions to this issue.
LOG: Appbase = file:///D:/WebProjects/Dating/Dating/DatingMobile/
LOG: Initial PrivatePath = D:\WebProjects\Dating\Dating\DatingMobile\bin
Calling assembly : (Unknown).
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: D:\WebProjects\Dating\Dating\DatingMobile\web.config
LOG: Using host configuration file: C:\Windows\Microsoft.NET\Framework64\v4.0.30319\aspnet.config
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework64\v4.0.30319\config\machine.config.
LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).
LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/Temporary ASP.NET Files/m/03cc50e2/37a5ccf4/AjaxControlToolkit.DLL.
LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/Temporary ASP.NET Files/m/03cc50e2/37a5ccf4/AjaxControlToolkit/AjaxControlToolkit.DLL.
LOG: Attempting download of new URL file:///D:/WebProjects/Dating/Dating/DatingMobile/bin/AjaxControlToolkit.DLL.
LOG: Attempting download of new URL file:///D:/WebProjects/Dating/Dating/DatingMobile/bin/AjaxControlToolkit/AjaxControlToolkit.DLL.
LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/Temporary ASP.NET Files/m/03cc50e2/37a5ccf4/AjaxControlToolkit.EXE.
LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/Temporary ASP.NET Files/m/03cc50e2/37a5ccf4/AjaxControlToolkit/AjaxControlToolkit.EXE.
LOG: Attempting download of new URL file:///D:/WebProjects/Dating/Dating/DatingMobile/bin/AjaxControlToolkit.EXE.
LOG: Attempting download of new URL file:///D:/WebProjects/Dating/Dating/DatingMobile/bin/AjaxControlToolkit/AjaxControlToolkit.EXE.

Stack Trace: 


[FileNotFoundException: Could not load file or assembly 'AjaxControlToolkit' or one of its dependencies. The system cannot find the file specified.]
   System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +0
   System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +210
   System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean forIntrospection) +242
   System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +17
   System.Reflection.Assembly.Load(String assemblyString) +35
   System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +122

[ConfigurationErrorsException: Could not load file or assembly 'AjaxControlToolkit' or one of its dependencies. The system cannot find the file specified.]
   System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +12759734
   System.Web.Configuration.AssemblyInfo.get_AssemblyInternal() +214
   System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSection compConfig) +334
   System.Web.Compilation.BuildManager.CallPreStartInitMethods(String preStartInitListPath) +203
   System.Web.Compilation.BuildManager.ExecutePreAppStart() +152
   System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException) +1151

[HttpException (0x80004005): Could not load file or assembly 'AjaxControlToolkit' or one of its dependencies. The system cannot find the file specified.]
   System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +12880068
   System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +159
   System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +12721257

我的 webforms 应用程序中有 ajaxcontroltoolkit,但移动应用程序中没有(当我收到错误时,浏览到移动路径)

我尝试为我的 mvc 应用程序设置一个新的应用程序池,但它仍然无法正常工作。如果有人能指出我正确的方向,我会非常感激

4

1 回答 1

0

我发现这是因为 web.config 文件继承了父目录中的其他 web.config 文件,即使该目录是虚拟目录或配置为应用程序。应该可以使用位置标记在 web.config 中包装代码块并指定路径,尽管我无法让它为我工作

http://msdn.microsoft.com/en-us/library/ms178692%28v=vs.100%29.aspx

于 2013-05-30T21:46:14.047 回答