简体   繁体   English

IIS Shadowcopy无法复制xml文件

[英]IIS Shadowcopy not copying xml file

Visual Studio 2015, x64 machine, using local IIS to host a MVC 5 application. Visual Studio 2015 x64计算机,使用本地IIS承载MVC 5应用程序。

I have an XML file that is required for my application (log4net config file). 我有我的应用程序所需的XML文件(log4net配置文件)。 I've have the file set to 'content' and 'always copy to output directory'. 我已将文件设置为“内容”并“始终复制到输出目录”。 This file copies to the bin\\debug directory fine. 该文件可以复制到bin \\ debug目录中。

Unfortunately, when a browser makes any request, I get: 不幸的是,当浏览器发出任何请求时,我得到:

Could not find file C:\\Windows\\Microsoft.NET\\Framework64\\v4.0.30319\\Temporary ASP.NET Files\\solvernode\\e0f7ede5\\23a22c5c\\assembly\\dl3\\89db89ce\\7f06f1f4_272ed101\\ISAMSLog4Net.xml 找不到文件C:\\Windows\\Microsoft.NET\\Framework64\\v4.0.30319\\Temporary ASP.NET Files\\solvernode\\e0f7ede5\\23a22c5c\\assembly\\dl3\\89db89ce\\7f06f1f4_272ed101\\ISAMSLog4Net.xml

Investigating that directory, I find nothing but a dependent dll. 调查该目录,我发现除了依赖的dll。

I have: 我有:
- Deleted asp.net temp directory files. -删除了asp.net临时目录文件。
- Removed all bin/obj folders -删除了所有bin / obj文件夹
- Restarted everything in sight, from the app pool up to IIS. -重新启动所有可见的内容,从应用程序池到IIS。
- Rebooted -重新启动
- Rebuild the site from scratch using a new MVC 5 templated project. -使用新的MVC 5模板化项目从头开始重建站点。

My box has .net 4, 4.5, 4.5.1, 4.5.2 and 4.6 on it, installed in that order. 我的盒子上依次安装有.net 4、4.5、4.5.1、4.5.2和4.6。

Sure could use some help on this one. 当然可以在这方面使用一些帮助。 Full stack trace below: 完整的堆栈跟踪如下:

[FileNotFoundException: Could not find file 'C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\solvernode\e0f7ede5\23a22c5c\assembly\dl3\89db89ce\7f06f1f4_272ed101\ISAMSLog4Net.xml'.]
System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) +1346
System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost) +886
System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost) +164
System.IO.StreamReader..ctor(String path, Encoding encoding, Boolean detectEncodingFromByteOrderMarks, Int32 bufferSize, Boolean checkHost) +177
System.IO.StreamReader..ctor(String path) +53
SolverSupport.Logging.GetLogFileNameFromLog4NetConfig(String log4NetConfigPath) in C:\Repos\ISAMS\SolverSupport\Logging.cs:53
SolverSupport.Logging.WireUpLogging() in C:\Repos\ISAMS\SolverSupport\Logging.cs:16
StressCheckSolver.Solver.Init() in C:\Repos\ISAMS\StressCheckSolver\Solver.cs:20
I2ES.SolverNode.SolverLauncher.SolverLauncher.LaunchStressCheckSolver(Int32 jobId, Action`2 completedCallback) in C:\repos\ISAMS\I2ES\SolverNode\SolverLauncher\SolverLauncher.cs:41
I2ES.SolverNode.Controllers.SolverController.Submit(Int32 id) in C:\repos\ISAMS\I2ES\SolverNode\Controllers\SolverController.cs:15
lambda_method(Closure , ControllerBase , Object[] ) +141
System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters) +229
System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +35
System.Web.Mvc.Async.AsyncControllerActionInvoker.<BeginInvokeSynchronousActionMethod>b__39(IAsyncResult asyncResult, ActionInvocation innerInvokeState) +39
System.Web.Mvc.Async.WrappedAsyncResult`2.CallEndDelegate(IAsyncResult asyncResult) +67
System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethod(IAsyncResult asyncResult) +42
System.Web.Mvc.Async.AsyncInvocationWithFilters.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3d() +72
System.Web.Mvc.Async.<>c__DisplayClass46.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3f() +386
System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethodWithFilters(IAsyncResult asyncResult) +42
System.Web.Mvc.Async.<>c__DisplayClass2b.<BeginInvokeAction>b__1c() +38
System.Web.Mvc.Async.<>c__DisplayClass21.<BeginInvokeAction>b__1e(IAsyncResult asyncResult) +186
System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeAction(IAsyncResult asyncResult) +38
System.Web.Mvc.Controller.<BeginExecuteCore>b__1d(IAsyncResult asyncResult, ExecuteCoreState innerState) +29
System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +65
System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult) +53
System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +36
System.Web.Mvc.Controller.EndExecute(IAsyncResult asyncResult) +38
System.Web.Mvc.MvcHandler.<BeginProcessRequest>b__5(IAsyncResult asyncResult, ProcessRequestState innerState) +44
System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +65
System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +38
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +399
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +157

How are you attempting to load the XML file from within the SolverSupport.Logging.GetLogFileNameFromLog4NetConfig method? 您如何尝试从SolverSupport.Logging.GetLogFileNameFromLog4NetConfig方法中加载XML文件? It looks like you are referencing the folder location incorrectly. 看来您错误地引用了文件夹位置。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM