Quantcast
Channel: Visual Studio Integrate forum
Viewing all articles
Browse latest Browse all 4410

VCProject AddFile

$
0
0

Hi,

I getting this exception in Visual Studio 2012 when calling AddFile on a VCProject

Microsoft.VisualStudio.Project.ProjectException: Could not find project item with item type 'ClCompile' and include value 'generated\New2.cpp'.
   at Microsoft.VisualStudio.Project.Utilities.ProjectErrorUtilities.ThrowProjectExceptionHelper(Exception innerException, String unformattedMessage, Object[] args)
   at Microsoft.VisualStudio.Project.Utilities.ProjectErrorUtilities.ThrowProjectException(String message, Object arg0, Object arg1)
   at Microsoft.VisualStudio.Project.Properties.ItemProperties.<GetEvaluatedProjectItem>b__a(IDirectReadAccess access)
   at Microsoft.VisualStudio.Project.Utilities.CommonProjectSystemTools.<>c__DisplayClass43`1.<Read>b__42(IDirectReadAccess directAccess)
   at Microsoft.VisualStudio.Project.DirectAccessService.AccessProject[T](Action`1 action, T directAccess, CancellationToken token, LockStats stats)
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at Microsoft.VisualStudio.Project.Utilities.CommonProjectSystemTools.Rethrow(Exception ex)
   at Microsoft.VisualStudio.Project.DirectAccessServiceLegacyThreading.MarshalToLockingThread[T](Action`1 action, T directAccess, CancellationToken token)
   at Microsoft.VisualStudio.Project.DirectAccessService.UpgradeableRead(Action`1 action, ProjectAccess flags, CancellationToken token)
   at Microsoft.VisualStudio.Project.DirectAccessServiceLegacyThreading.UpgradeableRead(Action`1 action, ProjectAccess flags, CancellationToken token)
   at Microsoft.VisualStudio.Project.DirectAccessServiceLegacyThreading.Read(Action`1 action, ProjectAccess flags, CancellationToken token)
   at Microsoft.VisualStudio.Project.Utilities.CommonProjectSystemTools.Read[T](IDirectAccessService directAccessService, Func`2 action)
   at Microsoft.VisualStudio.Project.Properties.ItemProperties.GetEvaluatedProjectItem()
   at Microsoft.VisualStudio.Project.ConfiguredProjectCache`1.UpdateValueProjectAccessHelper(Project proj, Boolean proactive)
   at Microsoft.VisualStudio.Project.ConfiguredProjectCache`1.UpdateValueProjectAccessNotProactiveHelper(Project proj)
   at Microsoft.VisualStudio.Project.Utilities.CommonProjectSystemTools.<>c__DisplayClass55.<Read>b__54(IDirectReadAccess directAccess)
   at Microsoft.VisualStudio.Project.DirectAccessService.AccessProject[T](Action`1 action, T directAccess, CancellationToken token, LockStats stats)
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at Microsoft.VisualStudio.Project.Utilities.CommonProjectSystemTools.Rethrow(Exception ex)
   at Microsoft.VisualStudio.Project.DirectAccessServiceLegacyThreading.MarshalToLockingThread[T](Action`1 action, T directAccess, CancellationToken token)
   at Microsoft.VisualStudio.Project.DirectAccessService.UpgradeableRead(Action`1 action, ProjectAccess flags, CancellationToken token)
   at Microsoft.VisualStudio.Project.DirectAccessServiceLegacyThreading.UpgradeableRead(Action`1 action, ProjectAccess flags, CancellationToken token)
   at Microsoft.VisualStudio.Project.DirectAccessServiceLegacyThreading.Read(Action`1 action, ProjectAccess flags, CancellationToken token)
   at Microsoft.VisualStudio.Project.Utilities.CommonProjectSystemTools.Read(IDirectAccessService directAccessService, ConfiguredProject configuredProject, Action`1 action, CancellationToken token)
   at Microsoft.VisualStudio.Project.ConfiguredProjectCache`1.ExecuteProjectReadSafely(Action`1 projectAccessDelegate)
   at Microsoft.VisualStudio.Project.ConfiguredProjectCache`1.RefreshValueIfAppropriate(Boolean proactive, CacheValidity cacheStatus)
   at Microsoft.VisualStudio.Project.ConfiguredProjectCache`1.<>c__DisplayClassa.<GetValue>b__7(IDirectAccess access)
   at Microsoft.VisualStudio.Project.Utilities.CommonProjectSystemTools.<>c__DisplayClass43`1.<Read>b__42(IDirectReadAccess directAccess)
   at Microsoft.VisualStudio.Project.DirectAccessService.AccessProject[T](Action`1 action, T directAccess, CancellationToken token, LockStats stats)
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at Microsoft.VisualStudio.Project.Utilities.CommonProjectSystemTools.Rethrow(Exception ex)
   at Microsoft.VisualStudio.Project.DirectAccessServiceLegacyThreading.MarshalToLockingThread[T](Action`1 action, T directAccess, CancellationToken token)
   at Microsoft.VisualStudio.Project.DirectAccessService.UpgradeableRead(Action`1 action, ProjectAccess flags, CancellationToken token)
   at Microsoft.VisualStudio.Project.DirectAccessServiceLegacyThreading.UpgradeableRead(Action`1 action, ProjectAccess flags, CancellationToken token)
   at Microsoft.VisualStudio.Project.DirectAccessServiceLegacyThreading.Read(Action`1 action, ProjectAccess flags, CancellationToken token)
   at Microsoft.VisualStudio.Project.Utilities.CommonProjectSystemTools.Read[T](IDirectAccessService directAccessService, Func`2 action)
   at Microsoft.VisualStudio.Project.ConfiguredProjectCache`1.GetValue(Boolean proactive, Boolean& upToDateValue)
   at Microsoft.VisualStudio.Project.ConfiguredProjectCache`1.get_Value()
   at Microsoft.VisualStudio.Project.Properties.ItemProperties.GetEvaluatedPropertyValue(String propertyName, IDirectReadAccess access)
   at Microsoft.VisualStudio.Project.Properties.ProjectPropertiesBase.<>c__DisplayClass7.<Microsoft.VisualStudio.Project.Properties.IProjectProperties.GetEvaluatedPropertyValue>b__6(IDirectReadAccess access)
   at Microsoft.VisualStudio.Project.DirectAccessService.AccessProject[T](Action`1 action, T directAccess, CancellationToken token, LockStats stats)
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at Microsoft.VisualStudio.Project.Utilities.CommonProjectSystemTools.Rethrow(Exception ex)
   at Microsoft.VisualStudio.Project.DirectAccessServiceLegacyThreading.MarshalToLockingThread[T](Action`1 action, T directAccess, CancellationToken token)
   at Microsoft.VisualStudio.Project.DirectAccessService.UpgradeableRead(Action`1 action, ProjectAccess flags, CancellationToken token)
   at Microsoft.VisualStudio.Project.DirectAccessServiceLegacyThreading.UpgradeableRead(Action`1 action, ProjectAccess flags, CancellationToken token)
   at Microsoft.VisualStudio.Project.DirectAccessServiceLegacyThreading.Read(Action`1 action, ProjectAccess flags, CancellationToken token)
   at Microsoft.VisualStudio.Project.Properties.ProjectPropertiesBase.Microsoft.VisualStudio.Project.Properties.IProjectProperties.GetEvaluatedPropertyValue(String propertyName)
   at Microsoft.VisualStudio.Project.Items.ProjectItemSchemaManager.GetContentType(IProjectItem item)
   at Microsoft.VisualStudio.Project.VisualC.VCProjectEngine.VCProjectShim.FindAndMoveDependentFiles(VCFile file)
   at Microsoft.VisualStudio.Project.VisualC.VCProjectEngine.VCFilterShim.<>c__DisplayClass11.<AddFile>b__10()
   at Microsoft.VisualStudio.Project.VisualC.VCProjectEngine.ApartmentMarshaler.Invoke[TResult](Func`1 method)
   at Microsoft.VisualStudio.Project.VisualC.VCProjectEngine.VCFilterShim.AddFile(String path)
   at Microsoft.VisualStudio.Project.VisualC.VCProjectEngine.VCProjectShim.<>c__DisplayClass16.<AddFile>b__15()
   at Microsoft.VisualStudio.Project.VisualC.VCProjectEngine.ApartmentMarshaler.Invoke(Action method)
   at Microsoft.VisualStudio.Project.VisualC.VCProjectEngine.VCProjectShim.AddFile(String path)
   at IceBuilder.VCUtilI.AddToFilter(Project dteProject, String name, String path)
   at IceBuilder.ProjectUtil.SetupGenerated(Project project, String file) in c:\Users\pepe\Documents\ZeroC\ice-builder-visualstudio\IceBuilder\ProjectUtil.cs:line 344
   at IceBuilder.DocumentEventHandler.OnAfterAddFilesEx(Int32 projectsLength, Int32 filesLength, IVsProject[] projects, Int32[] indices, String[] paths, VSADDFILEFLAGS[] rgFlags) in c:\Users\pepe\Documents\ZeroC\ice-builder-visualstudio\IceBuilder\DocumentEventHandler.cs:line 204Microsoft.VisualStudio.Project.ProjectException: Could not find project item with item type 'ClCompile' and include value 'generated\New3.cpp'.
   at Microsoft.VisualStudio.Project.Utilities.ProjectErrorUtilities.ThrowProjectExceptionHelper(Exception innerException, String unformattedMessage, Object[] args)
   at Microsoft.VisualStudio.Project.Utilities.ProjectErrorUtilities.ThrowProjectException(String message, Object arg0, Object arg1)
   at Microsoft.VisualStudio.Project.Properties.ItemProperties.<GetEvaluatedProjectItem>b__a(IDirectReadAccess access)
   at Microsoft.VisualStudio.Project.Utilities.CommonProjectSystemTools.<>c__DisplayClass43`1.<Read>b__42(IDirectReadAccess directAccess)
   at Microsoft.VisualStudio.Project.DirectAccessService.AccessProject[T](Action`1 action, T directAccess, CancellationToken token, LockStats stats)
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at Microsoft.VisualStudio.Project.Utilities.CommonProjectSystemTools.Rethrow(Exception ex)
   at Microsoft.VisualStudio.Project.DirectAccessServiceLegacyThreading.MarshalToLockingThread[T](Action`1 action, T directAccess, CancellationToken token)
   at Microsoft.VisualStudio.Project.DirectAccessService.UpgradeableRead(Action`1 action, ProjectAccess flags, CancellationToken token)
   at Microsoft.VisualStudio.Project.DirectAccessServiceLegacyThreading.UpgradeableRead(Action`1 action, ProjectAccess flags, CancellationToken token)
   at Microsoft.VisualStudio.Project.DirectAccessServiceLegacyThreading.Read(Action`1 action, ProjectAccess flags, CancellationToken token)
   at Microsoft.VisualStudio.Project.Utilities.CommonProjectSystemTools.Read[T](IDirectAccessService directAccessService, Func`2 action)
   at Microsoft.VisualStudio.Project.Properties.ItemProperties.GetEvaluatedProjectItem()
   at Microsoft.VisualStudio.Project.ConfiguredProjectCache`1.UpdateValueProjectAccessHelper(Project proj, Boolean proactive)
   at Microsoft.VisualStudio.Project.ConfiguredProjectCache`1.UpdateValueProjectAccessNotProactiveHelper(Project proj)
   at Microsoft.VisualStudio.Project.Utilities.CommonProjectSystemTools.<>c__DisplayClass55.<Read>b__54(IDirectReadAccess directAccess)
   at Microsoft.VisualStudio.Project.DirectAccessService.AccessProject[T](Action`1 action, T directAccess, CancellationToken token, LockStats stats)
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at Microsoft.VisualStudio.Project.Utilities.CommonProjectSystemTools.Rethrow(Exception ex)
   at Microsoft.VisualStudio.Project.DirectAccessServiceLegacyThreading.MarshalToLockingThread[T](Action`1 action, T directAccess, CancellationToken token)
   at Microsoft.VisualStudio.Project.DirectAccessService.UpgradeableRead(Action`1 action, ProjectAccess flags, CancellationToken token)
   at Microsoft.VisualStudio.Project.DirectAccessServiceLegacyThreading.UpgradeableRead(Action`1 action, ProjectAccess flags, CancellationToken token)
   at Microsoft.VisualStudio.Project.DirectAccessServiceLegacyThreading.Read(Action`1 action, ProjectAccess flags, CancellationToken token)
   at Microsoft.VisualStudio.Project.Utilities.CommonProjectSystemTools.Read(IDirectAccessService directAccessService, ConfiguredProject configuredProject, Action`1 action, CancellationToken token)
   at Microsoft.VisualStudio.Project.ConfiguredProjectCache`1.ExecuteProjectReadSafely(Action`1 projectAccessDelegate)
   at Microsoft.VisualStudio.Project.ConfiguredProjectCache`1.RefreshValueIfAppropriate(Boolean proactive, CacheValidity cacheStatus)
   at Microsoft.VisualStudio.Project.ConfiguredProjectCache`1.<>c__DisplayClassa.<GetValue>b__7(IDirectAccess access)
   at Microsoft.VisualStudio.Project.Utilities.CommonProjectSystemTools.<>c__DisplayClass43`1.<Read>b__42(IDirectReadAccess directAccess)
   at Microsoft.VisualStudio.Project.DirectAccessService.AccessProject[T](Action`1 action, T directAccess, CancellationToken token, LockStats stats)
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at Microsoft.VisualStudio.Project.Utilities.CommonProjectSystemTools.Rethrow(Exception ex)
   at Microsoft.VisualStudio.Project.DirectAccessServiceLegacyThreading.MarshalToLockingThread[T](Action`1 action, T directAccess, CancellationToken token)
   at Microsoft.VisualStudio.Project.DirectAccessService.UpgradeableRead(Action`1 action, ProjectAccess flags, CancellationToken token)
   at Microsoft.VisualStudio.Project.DirectAccessServiceLegacyThreading.UpgradeableRead(Action`1 action, ProjectAccess flags, CancellationToken token)
   at Microsoft.VisualStudio.Project.DirectAccessServiceLegacyThreading.Read(Action`1 action, ProjectAccess flags, CancellationToken token)
   at Microsoft.VisualStudio.Project.Utilities.CommonProjectSystemTools.Read[T](IDirectAccessService directAccessService, Func`2 action)
   at Microsoft.VisualStudio.Project.ConfiguredProjectCache`1.GetValue(Boolean proactive, Boolean& upToDateValue)
   at Microsoft.VisualStudio.Project.ConfiguredProjectCache`1.get_Value()
   at Microsoft.VisualStudio.Project.Properties.ItemProperties.GetEvaluatedPropertyValue(String propertyName, IDirectReadAccess access)
   at Microsoft.VisualStudio.Project.Properties.ProjectPropertiesBase.<>c__DisplayClass7.<Microsoft.VisualStudio.Project.Properties.IProjectProperties.GetEvaluatedPropertyValue>b__6(IDirectReadAccess access)
   at Microsoft.VisualStudio.Project.DirectAccessService.AccessProject[T](Action`1 action, T directAccess, CancellationToken token, LockStats stats)
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at Microsoft.VisualStudio.Project.Utilities.CommonProjectSystemTools.Rethrow(Exception ex)
   at Microsoft.VisualStudio.Project.DirectAccessServiceLegacyThreading.MarshalToLockingThread[T](Action`1 action, T directAccess, CancellationToken token)
   at Microsoft.VisualStudio.Project.DirectAccessService.UpgradeableRead(Action`1 action, ProjectAccess flags, CancellationToken token)
   at Microsoft.VisualStudio.Project.DirectAccessServiceLegacyThreading.UpgradeableRead(Action`1 action, ProjectAccess flags, CancellationToken token)
   at Microsoft.VisualStudio.Project.DirectAccessServiceLegacyThreading.Read(Action`1 action, ProjectAccess flags, CancellationToken token)
   at Microsoft.VisualStudio.Project.Properties.ProjectPropertiesBase.Microsoft.VisualStudio.Project.Properties.IProjectProperties.GetEvaluatedPropertyValue(String propertyName)
   at Microsoft.VisualStudio.Project.Items.ProjectItemSchemaManager.GetContentType(IProjectItem item)
   at Microsoft.VisualStudio.Project.VisualC.VCProjectEngine.VCProjectShim.FindAndMoveDependentFiles(VCFile file)
   at Microsoft.VisualStudio.Project.VisualC.VCProjectEngine.VCFilterShim.<>c__DisplayClass11.<AddFile>b__10()
   at Microsoft.VisualStudio.Project.VisualC.VCProjectEngine.ApartmentMarshaler.Invoke[TResult](Func`1 method)
   at Microsoft.VisualStudio.Project.VisualC.VCProjectEngine.VCFilterShim.AddFile(String path)
   at Microsoft.VisualStudio.Project.VisualC.VCProjectEngine.VCProjectShim.<>c__DisplayClass16.<AddFile>b__15()
   at Microsoft.VisualStudio.Project.VisualC.VCProjectEngine.ApartmentMarshaler.Invoke(Action method)
   at Microsoft.VisualStudio.Project.VisualC.VCProjectEngine.VCProjectShim.AddFile(String path)
   at IceBuilder.VCUtilI.AddToFilter(Project dteProject, String name, String path)
   at IceBuilder.ProjectUtil.SetupGenerated(Project project, String file) in c:\Users\pepe\Documents\ZeroC\ice-builder-visualstudio\IceBuilder\ProjectUtil.cs:line 344
   at IceBuilder.DocumentEventHandler.OnAfterAddFilesEx(Int32 projectsLength, Int32 filesLength, IVsProject[] projects, Int32[] indices, String[] paths, VSADDFILEFLAGS[] rgFlags) in c:\Users\pepe\Documents\ZeroC\ice-builder-visualstudio\IceBuilder\DocumentEventHandler.cs:line 204
Any ideas what could be causing this?


Viewing all articles
Browse latest Browse all 4410

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>