SYNC FRAMEWORK-Batching - wcf

I am able to synchronize two remote databases using sync framework 2.1 over WCF(N-Tier) .
To improve performance while transferring large data, I implemented Batching.
But I am facing below error message:
An unexpected error occurred when applying batch file 1e1855e6-0b9a-4332-9fdb-07a25bc1bd49.batch. See the inner exception for more details.
This is happening only with last batch file. When applying last batch file in the set of batch files the code is terminating with above error message.
Below I am pasting xml format of webservice log (inner exception):
<InnerException>
<ExceptionType>System.IO.FileNotFoundException, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</ExceptionType>
<Message>Could not find file 'c:\windows\system32\inetsrv\1e1855e6-0b9a-4332-9fdb-07a25bc1bd49.batch'.</Message>
<StackTrace>
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at 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)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy)
at System.IO.FileStream..ctor(String path, FileMode mode)
at Microsoft.Synchronization.Data.DbSyncBatchInfoFactory.Deserialize(String batchFileName, Boolean deserializeData)
at Microsoft.Synchronization.Data.DbSyncBatchConsumer.ReadBatchFile(UInt32 lookupLocation, UInt32 expectedNumber)
at Microsoft.Synchronization.Data.DbSyncBatchConsumer.ReadBatchFile(UInt32 expectedNumber, String& batchFileName)
at Microsoft.Synchronization.Data.DbSyncBatchConsumer.ApplyBatches(DbSyncScopeMetadata scopeMetadata, DbSyncSession syncSession, SyncSessionStatistics sessionStatistics)
</StackTrace>
<ExceptionString>System.IO.FileNotFoundException: Could not find file 'c:\windows\system32\inetsrv\1e1855e6-0b9a-4332-9fdb-07a25bc1bd49.batch'.
File name: 'c:\windows\system32\inetsrv\1e1855e6-0b9a-4332-9fdb-07a25bc1bd49.batch'
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at 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)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy)
at System.IO.FileStream..ctor(String path, FileMode mode)
at Microsoft.Synchronization.Data.DbSyncBatchInfoFactory.Deserialize(String batchFileName, Boolean deserializeData)
at Microsoft.Synchronization.Data.DbSyncBatchConsumer.ReadBatchFile(UInt32 lookupLocation, UInt32 expectedNumber)
at Microsoft.Synchronization.Data.DbSyncBatchConsumer.ReadBatchFile(UInt32 expectedNumber, String& batchFileName)
at Microsoft.Synchronization.Data.DbSyncBatchConsumer.ApplyBatches(DbSyncScopeMetadata scopeMetadata, DbSyncSession syncSession, SyncSessionStatistics sessionStatistics)
</ExceptionString>
</InnerException>
Your help and suggestions are very much appreciated!!
Thank you in advance friends!!

try moving out your batching directory outside of IIS folder.

Related

Downloading Clickonce application fails in WebBrowser control

I am using webbrowser Control in my application and conditionally needs to download another application ( click once based) without user interaction. the download of the application works from Edge browser as expected.
Download fails in webbrowser control with following error
OPERATION PROGRESS STATUS
* [3/4/2022 3:58:28 PM] : Activation of C:\Users\Test4\AppData\Local\Microsoft\Windows\INetCache\IE\2XZDUQN2\TestClickonce[1].application has started.
* [3/4/2022 3:58:29 PM] : Processing of deployment manifest has successfully completed.
* [3/4/2022 3:58:29 PM] : Installation of the application has started.
ERROR DETAILS
Following errors were detected during this operation.
* [3/4/2022 3:58:29 PM] System.Deployment.Application.DeploymentDownloadException (Unknown subtype)
- Downloading file:///C:/Users/Test4/AppData/Local/Microsoft/Windows/INetCache/IE/2XZDUQN2/TestClickonce.exe.manifest did not succeed.
- Source: System.Deployment
- Stack trace:
at System.Deployment.Application.SystemNetDownloader.DownloadSingleFile(DownloadQueueItem next)
at System.Deployment.Application.SystemNetDownloader.DownloadAllFiles()
at System.Deployment.Application.FileDownloader.Download(SubscriptionState subState, X509Certificate2 clientCertificate)
at System.Deployment.Application.DownloadManager.DownloadManifestAsRawFile(Uri& sourceUri, String targetPath, IDownloadNotification notification, DownloadOptions options, ServerInformation& serverInformation)
at System.Deployment.Application.DownloadManager.DownloadApplicationManifest(AssemblyManifest deploymentManifest, String targetDir, Uri deploymentUri, IDownloadNotification notification, DownloadOptions options, Uri& appSourceUri, String& appManifestPath)
at System.Deployment.Application.ApplicationActivator.DownloadApplication(SubscriptionState subState, ActivationDescription actDesc, Int64 transactionId, TempDirectory& downloadTemp)
at System.Deployment.Application.ApplicationActivator.InstallApplication(SubscriptionState& subState, ActivationDescription actDesc)
at System.Deployment.Application.ApplicationActivator.PerformDeploymentActivation(Uri activationUri, Boolean isShortcut, String textualSubId, String deploymentProviderUrlFromExtension, BrowserSettings browserSettings, String& errorPageUrl, Uri& deploymentUri)
at System.Deployment.Application.ApplicationActivator.PerformDeploymentActivationWithRetry(Uri activationUri, Boolean isShortcut, String textualSubId, String deploymentProviderUrlFromExtension, BrowserSettings browserSettings, String& errorPageUrl)
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Deployment.Application.ApplicationActivator.PerformDeploymentActivationWithRetry(Uri activationUri, Boolean isShortcut, String textualSubId, String deploymentProviderUrlFromExtension, BrowserSettings browserSettings, String& errorPageUrl)
at System.Deployment.Application.ApplicationActivator.ActivateDeploymentWorker(Object state)
--- Inner Exception ---
System.Net.WebException
- Could not find file 'C:\Users\Test4\AppData\Local\Microsoft\Windows\INetCache\IE\2XZDUQN2\TestClickonce.exe.manifest'.
- Source: System
- Stack trace:
at System.Net.FileWebRequest.EndGetResponse(IAsyncResult asyncResult)
at System.Deployment.Application.SystemNetDownloader.DownloadSingleFile(DownloadQueueItem next)
--- Inner Exception ---
System.Net.WebException
- Could not find file 'C:\Users\Test4\AppData\Local\Microsoft\Windows\INetCache\IE\2XZDUQN2\TestClickonce.exe.manifest'.
- Source: System
- Stack trace:
at System.Net.FileWebResponse..ctor(FileWebRequest request, Uri uri, FileAccess access, Boolean asyncHint)
at System.Net.FileWebRequest.GetResponseCallback(Object state)
--- Inner Exception ---
System.IO.FileNotFoundException
- Could not find file 'C:\Users\Test4\AppData\Local\Microsoft\Windows\INetCache\IE\2XZDUQN2\TestClickonce.exe.manifest'.
- Source: mscorlib
- Stack trace:
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at 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)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy)
at System.Net.FileWebStream..ctor(FileWebRequest request, String path, FileMode mode, FileAccess access, FileShare sharing, Int32 length, Boolean async)
at System.Net.FileWebResponse..ctor(FileWebRequest request, Uri uri, FileAccess access, Boolean asyncHint)
COMPONENT STORE TRANSACTION DETAILS
No transaction information is available.

ClickOnce Installation from URL still tries to download vsto file locally

I try to deploy my VSTO AddIn using ClickOnce with the following setup. When I start setup the installer still tries to find the vsto file in the users download folder instead of downloading it from the server.
This is the detailed error message:
Name:
Von: file:///C:/Users/myname/Downloads/myapp_OutlookPlugin.vsto
************** Ausnahmetext **************
System.Deployment.Application.DeploymentDownloadException: 'file:///C:/Users/myname/Downloads/myapp_OutlookPlugin.vsto' konnte nicht gedownloadet werden. ---> System.Net.WebException: Die Datei "C:\Users\myname\Downloads\myapp_OutlookPlugin.vsto" konnte nicht gefunden werden. ---> System.Net.WebException: Die Datei "C:\Users\myname\Downloads\myapp_OutlookPlugin.vsto" konnte nicht gefunden werden. ---> System.IO.FileNotFoundException: Die Datei "C:\Users\myname\Downloads\myapp_OutlookPlugin.vsto" konnte nicht gefunden werden.
bei System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
bei 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)
bei System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy)
bei System.Net.FileWebStream..ctor(FileWebRequest request, String path, FileMode mode, FileAccess access, FileShare sharing, Int32 length, Boolean async)
bei System.Net.FileWebResponse..ctor(FileWebRequest request, Uri uri, FileAccess access, Boolean asyncHint)
--- Ende der internen Ausnahmestapelüberwachung ---
bei System.Net.FileWebResponse..ctor(FileWebRequest request, Uri uri, FileAccess access, Boolean asyncHint)
bei System.Net.FileWebRequest.GetResponseCallback(Object state)
--- Ende der internen Ausnahmestapelüberwachung ---
bei System.Net.FileWebRequest.EndGetResponse(IAsyncResult asyncResult)
bei System.Net.FileWebRequest.GetResponse()
bei System.Deployment.Application.SystemNetDownloader.DownloadSingleFile(DownloadQueueItem next)
--- Ende der internen Ausnahmestapelüberwachung ---
bei Microsoft.VisualStudio.Tools.Applications.Deployment.ClickOnceAddInDeploymentManager.GetManifests(TimeSpan timeout)
bei Microsoft.VisualStudio.Tools.Applications.Deployment.ClickOnceAddInDeploymentManager.InstallAddIn()
Signing the deployment is configured like this:
And yes I made sure that the files are available on the server in the right directory. I verified this by manually downloading the vsto file from the webserver. It succeeded.

System.UnauthorizedAccessException: Access to the path 'C:\inetpub\wwwroot\website\imagecache\0f\ae1ea.jpg.tmp_4a1f20d7.tmp' is denied

Using imageresizer diskcache 4.2.5 and just recently started having a high frequency of this error. This is after doing a recent publish of new code to our site. We did not explicitly change anything to our knowledge related to imageresizer, so not sure if it is related to a new version, a web.config issue, etc.
We are using precompiled views in this MVC 5 web app.
Gist debug file
This has been working for years. It looks like we updgraded the nuget package of this from 3.4.3 to 4.2.5 a couple of months ago.
When navigating to the image directly, no error is thrown. The funny thing to me is this .tmp naming convention of the file trying to be accessed.
The path of the image is is trying to retrieve from the Elmah error log is: C:\inetpub\wwwroot\website\Images\no_image.jpg?maxwidth=420&maxheight=420
Stacktrace:
System.UnauthorizedAccessException: Access to the path 'C:\inetpub\wwwroot\website\imagecache\0f\ae1ea13d9acc62f74c3da0f38e1b85328c07effdd1afce83d91b44f244a602f3.jpg.tmp_4a1f20d7.tmp' is denied.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at 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)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)
at ImageResizer.Plugins.DiskCache.CustomDiskCache.<>c__DisplayClass29_0.<TryWriteFile>b__0()
at ImageResizer.Plugins.DiskCache.LockProvider.TryExecute(String key, Int32 timeoutMs, LockCallback success)
at ImageResizer.Plugins.DiskCache.CustomDiskCache.GetCachedFile(String keyBasis, String extension, ResizeImageDelegate writeCallback, Int32 timeoutMs, Boolean asynchronous)
at ImageResizer.Plugins.DiskCache.DiskCache.Process(IResponseArgs e)
at ImageResizer.Plugins.DiskCache.DiskCache.Process(HttpContext context, IResponseArgs e)
at ImageResizer.InterceptModule.HandleRequest(HttpContext context, HttpModuleRequestAssistant ra, IVirtualFile vf)
at ImageResizer.InterceptModule.CheckRequest_PostAuthorizeRequest(Object sender, EventArgs e)
at System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.<>c__DisplayClass285_0.<ExecuteStepImpl>b__0()
at System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step)
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
This means that the app does not have write permission to the folder. A temp name is used to prevent it from being served while writing.

Getting Error while loading the project in the NUnit

I'm trying the load the project in the NUnit GUI. But I'm getting an error
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at 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)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)
at System.IO.File.Open(String path, FileMode mode, FileAccess access, FileShare share)
at WellsFargo.Tridion.NUnit.DailyMonitoringTesting.TestDataFactory.GetInputData(String NodeName) in C:\Users\u382343\Desktop\PQC Patching Project\source\WellsFargo.Tridion.NUnit.DailyMonitoringTesting\Common\TestDataFactory.cs:line 153
at WellsFargo.Tridion.NUnit.DailyMonitoringTesting.TestDataFactory.<get_F5Url>d__0.MoveNext() in C:\Users\u382343\Desktop\PQC Patching Project\source\WellsFargo.Tridion.NUnit.DailyMonitoringTesting\Common\TestDataFactory.cs:line 21
at NUnit.Core.Builders.TestCaseSourceProvider.GetTestCasesFor(MethodInfo method, Test parentSuite)
at NUnit.Core.Extensibility.TestCaseProviders.GetTestCasesFor(MethodInfo method, Test suite)
Can anyone tell me what's this error about?
If all the required/dependent dlls are not properly copied to release folder you are trying to load the NUnit GUI, this error will be thrown.
Please refer: Why am I getting a FileNotFound exception when referencing another project from the same solution?

CSharpCodeGenerator "Could not find file C:\Windows\Temp\...dll"

I was awoken today by an alarming text message from the server monitor service that one of my servers was down, and has been for the past 7 hours.
The server runs a WCF web-service hosted in IIS.
I checked in IIS and my Application Pool was stopped. There was nothing in the Event Logs on the server.
My application catches all errors and writes them to the filesystem. I saw there were over 7300 FileNotFoundException reports. They all look like this:
System.IO.FileNotFoundException("Could not find file 'C:\Windows\TEMP\fmhq0eve.dll'.")
mscorlib
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at 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)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)
at Microsoft.CSharp.CSharpCodeGenerator.FromFileBatch(CompilerParameters options, String[] fileNames)
at Microsoft.CSharp.CSharpCodeGenerator.FromSourceBatch(CompilerParameters options, String[] sources)
at Microsoft.CSharp.CSharpCodeGenerator.System.CodeDom.Compiler.ICodeCompiler.CompileAssemblyFromSourceBatch(CompilerParameters options, String[] sources)
at System.CodeDom.Compiler.CodeDomProvider.CompileAssemblyFromSource(CompilerParameters options, String[] sources)
at System.Xml.Serialization.Compiler.Compile(Assembly parent, String ns, XmlSerializerCompilerParameters xmlParameters, Evidence evidence)
at System.Xml.Serialization.TempAssembly.GenerateAssembly(XmlMapping[] xmlMappings, Type[] types, String defaultNamespace, Evidence evidence, XmlSerializerCompilerParameters parameters, Assembly assembly, Hashtable assemblies)
at System.Xml.Serialization.TempAssembly..ctor(XmlMapping[] xmlMappings, Type[] types, String defaultNamespace, String location, Evidence evidence)
at System.Xml.Serialization.XmlSerializer.FromMappings(XmlMapping[] mappings, Type type)
at System.ServiceModel.Dispatcher.UnwrappedTypesXmlSerializerManager.BuildSerializers()
at System.ServiceModel.Dispatcher.UnwrappedTypesXmlSerializerManager.GetOperationSerializers(Object key)
at System.ServiceModel.Dispatcher.SingleBodyParameterXmlSerializerMessageFormatter.EnsureSerializers()
at System.ServiceModel.Dispatcher.SingleBodyParameterXmlSerializerMessageFormatter.GetOutputSerializer(Type type)
at System.ServiceModel.Dispatcher.SingleBodyParameterMessageFormatter.CreateBodyWriter(Object body)
at System.ServiceModel.Dispatcher.SingleBodyParameterMessageFormatter.SerializeReply(MessageVersion messageVersion, Object[] parameters, Object result)
at System.ServiceModel.Dispatcher.CompositeDispatchFormatter.SerializeReply(MessageVersion messageVersion, Object[] parameters, Object result)
at System.ServiceModel.Dispatcher.DispatchOperationRuntime.SerializeOutputs(MessageRpc& rpc)
at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc& rpc)
at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc& rpc)
at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage4(MessageRpc& rpc)
at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)
I saw this error was reported on StackOverflow in the past, and has a variety of causes, mostly to do with Serializer caching, however the code in the stack trace is entirely handled by WCF.
The server was left completely alone for over a month. The last Windows Update reboot was on the 21st, 5 days before these exceptions happened. I can think of no other cause.
Why did this problem start happening and what can we do about it? Is this a bug in WCF?
give network service compelete access to C:\Windows\Temp folder
reset the iis using iisreset
This should fix the problem