Questions tagged [sharing-violation]

8 questions
11
votes
5 answers

Pandas / xlsxwriter writer.close() does not completely close the excel file

I'm trying to modify manually an excel file after creating it with a python script. Unfortunately, if the script is still running, a sharing file violation error message appears when trying to save it with the same name. Everything runs smoothly in…
Nicolas Peille
  • 149
  • 1
  • 2
  • 10
1
vote
1 answer

Image edit exceptions

I'm working in WPF application with MVVM. Loading and Editing a image in imageSlider gives me error and exceptions. Loading Image: Insufficient memory to handle Editing Image: Sharing violation ViewModel: public class ImageList :…
A Coder
  • 3,039
  • 7
  • 58
  • 129
0
votes
0 answers

How to avoid "Sharing Violation" while getting file path

I want to retrieve all files/directorys path (nested) in the C:/ drive, at least if they are not currently used or where I have the permission to retrive. In order to do it recursively, I used recursive_directory_iterator from std::filesystem. I…
0
votes
0 answers

How-to get the full path file of IOException with Error Sharing Violation

I get an IOException with ERROR_SHARING_VIOLATION = 32, and I want get the full path file is "locked". var ioex = ex as IOException; var err = System.Runtime.InteropServices.Marshal.GetLastWin32Error(); if (err == 32)…
Kiquenet
  • 14,494
  • 35
  • 148
  • 243
0
votes
1 answer

Path Sharing Violation Error when modifying existing pdf using iText7

I created a pdf in c# using Itext7 but I am unable to overwrite the pdf after adding the header to it, it gives path sharing violation error. I am also closing the document properly. I create a Pdf first of at least 10 pages using this code: …
0
votes
0 answers

Write to a text File C#

void Update(){ StreamWriter writer = new StreamWriter(Application.dataPath + @"/SaveFiles/ControlStick.txt", true); writer.WriteLine(inputVector); //+ "," + DateTime.Now.TimeOfDay); } This is the relevant code. I need to write to a…
0
votes
2 answers

Sharing Violation on Path when no stream is open

I'm developing a game in C# in which each "District" will have data about it stored in a save file periodically. For testing, the "SaveAll" method is called once at the beginning of the level. The code for the file operations is as follows: using…
notquiteamonad
  • 1,159
  • 2
  • 12
  • 28
0
votes
1 answer

FileStream ctor throws sharing violation in SSIS script task, works in debug mode

I have an Integration Services package (VS 2012) that loads values from an Excel workbook and stores them in SQL Server. I'm using a 3rd party library to extract the workbook data in a C# script task, but before that, in the task, I create a…
Buggieboy
  • 4,636
  • 4
  • 55
  • 79