AccessViolationException with MS Project

Add-in Express™ Support Service
That's what is more important than anything else

AccessViolationException with MS Project
AccessViolationException with MS Project occurs after saving the .mpp file 
Wellyn Pomeroy




Posts: 15
Joined: 2012-05-30
OK, try the same link. I replaced the zip file with all the individual files.

http://wellyn.net23.net/SampleError/
Posted 20 Jun, 2012 12:44:40 Top
Eugene Astafiev


Add-in Express team


Posts: 8540
Joined: 2007-07-25
Hi Wellyn,

I still can't download files. Here is what I get now:

User added an image

It looks like your PC is infected. Is this the case?

Could you please upload the project, for example, to SkyDrive, or any web server with an antivirus software maintained?
.NET, Extended MAPI, Windows Phone & RT
Posted 21 Jun, 2012 09:17:59 Top
Wellyn Pomeroy




Posts: 15
Joined: 2012-05-30
OK, try this.

Sample Error
Posted 21 Jun, 2012 12:41:19 Top
Eugene Astafiev


Add-in Express team


Posts: 8540
Joined: 2007-07-25
Hi Wellyn,

Finally, I have downloaded your sample add-in project. Thank you.

I will test it in one of my virtual PCs with Project 2010 installed and let you know the results.
.NET, Extended MAPI, Windows Phone & RT
Posted 22 Jun, 2012 07:18:37 Top
Eugene Astafiev


Add-in Express team


Posts: 8540
Joined: 2007-07-25
Hi Wellyn,

I wasn't able to reproduce the issue on my PC with Project 2010. However, I have noticed that you use Office 2007 PIAs in the add-in project. Am I right? If so, it looks like we have found the cause of the issue you faced with.

That fact is that the SetAutoFilter method of the Application class was introduced with Project 2010. You need to use the late-binding technology for calling such methods or use version specific PIAs (for Office 2010). Please read more about this in the Supporting several Office versions in an add-in. Interop assemblies and late binding. article on our technical blog.
.NET, Extended MAPI, Windows Phone & RT
Posted 22 Jun, 2012 09:57:25 Top
Wellyn Pomeroy




Posts: 15
Joined: 2012-05-30
I understand what you are saying. However, I am only running and debugging my add-in on MS Project 2010 at this point.

If I was running MS Project 2007, it would make sense that I get an error.

Based on this, do you still think this is the cause of my problem?
Posted 28 Jun, 2012 17:53:49 Top
Eugene Astafiev


Add-in Express team


Posts: 8540
Joined: 2007-07-25
Hi Wellyn,

You will not get such error in Project 2007. In the code you are trying to call a method which is absent in PIAs for Office 2007 and presents in Project 2010. Please try to enable the Option Strict and Option Explicit in VB.NET and you will get a compile-time error.
.NET, Extended MAPI, Windows Phone & RT
Posted 29 Jun, 2012 05:51:21 Top