We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Failed to cocreate profiler when saving

Good afternoon,

when trying to save a diagram I get an error that reads "Access to the path ‘C:\workspace\mod\dev\diagrams’ is denied. "

Additionally in the Event viewer, under windows logs > application I get an error that reads ".NET Runtime version 2.0.50727.5477 - Failed to CoCreate profiler. "

Any idea how to troubleshoot this issue?

My code is as follows:
string dataDir = “C:\workspace\mod\dev\diagrams”;
Diagram vdxDiagram = new Diargram(dataDir);
foreach (Aspose.Diagram.Shape.Shape shape in vdxDiagram.Pages[0].Shapes);
{
shape.Text.Value.Clear();
shape.Text.Value.Add(new Txt(“Aspose POC”)));
}
vdxDiagram.Save(dataDir, SaveFileFormat.VDX);


I am running in debugger in Visual Studio 2012 w/ update 4 installed (v. 11.0.61030.00)
Using Internet Explorer 9
C# asp.net
iss 7



Hi


Thank you for contacting support. We have tested your sample code against the latest build of Aspose.Diagram 4.3.0. It was not in compile able form. However, we have removed syntax errors. We noticed that you are not passing a complete file name. Please have a look on this sample code:

string dataDir = @“C:\workspace\mod\dev\diagrams.vsd;<o:p></o:p>

Diagram vdxDiagram = new Diagram(dataDir);

foreach (Aspose.Diagram.Shape shape in vdxDiagram.Pages[0].Shapes)

{

shape.Text.Value.Clear();

shape.Text.Value.Add(new Txt("Aspose POC"));

}

vdxDiagram.Save(dataDir, SaveFileFormat.VDX);


Please feel free to reply us in case of any confusion or questions.

I apologize, the code was incorrectly typed for the original post. I have made all changes you listed and I still get the same problem.

Hi


It looks not an issue with Aspose.Diagram API. Please have a look in this help link:
http://stackoverflow.com/questions/10013493/failed-to-cocreate-profiler-error-but-not-using-a-profiler

In case, it does not help, then please prepare a sample project application which reproduces the issue on your side and attach it here. Also, do not forget to attach a problematic Visio drawing. We will take a closer look and provide you with some further feedback.

Does apose use any kind of profile when saving visio files?


Found the problem.

My file was originally a vdx file, and so I was saving the file as a asdf.vdx but then declaring “SaveFileFormat.VDX”, so the file name and declared file type did not match.

Hi

Thank you for updating us. It is nice to hear from you that the problem has been solved. Please feel free to reply us, if you have any other question regarding Aspose APIs, we will be happy to help you.