greggorob64
greggorob64

Reputation: 2557

My Winforms C# project designer gets annihilated by my C++/CLI project

I've had lots of experience working with C++/CLI in the last several years, and if there's one thing I know, it's that mixed mode DLL's are bad for designing.

I have project a CSPROJECT, which depends on CPPPROJECT (using a project reference, copylocal=true, versionspecific=false, copylocalsattelitedpeendances=false).

Any time i try to open a form or usercontrol from CSPROJECT, I just get: system.exception was thrown.

I've tried fuslogvw, and it does not bind any failures to disk. I've tried opening a second devenv to debug, but it just breaks at the same spot the designer shows in its callstack. Here is the csproj snippet for my CPPPROJECT reference:

<ProjectReference Include="..\dfResultsStructures\dfResultsStructures.csproj">
  <Project>{D93C5625-0EB1-4645-95C8-F389758521EE}</Project>
  <Name>dfResultsStructures</Name>
  <Private>False</Private>
  <SpecificVersion>False</SpecificVersion>
</ProjectReference>

And below is the callstack

   Exception of type 'System.Exception' was thrown.    

Instances of this error (1)  

1.   Hide Call Stack 

at VSLangProj.Reference.get_Path()
at Microsoft.VisualStudio.Design.VSTypeResolutionService.AddProjectDependencies(Project project)
at Microsoft.VisualStudio.Design.VSTypeResolutionService.AssemblyEntry.get_Assembly()
at Microsoft.VisualStudio.Design.VSTypeResolutionService.AssemblyEntry.Search(String fullName, String typeName, Boolean ignoreTypeCase, Boolean allowPrivate, Assembly& assembly, String description)
at Microsoft.VisualStudio.Design.VSTypeResolutionService.AssemblyEntry.Search(String fullName, String typeName, Boolean ignoreTypeCase, Assembly& assembly, String description)
at Microsoft.VisualStudio.Design.VSTypeResolutionService.SearchProjectEntries(AssemblyName assemblyName, String typeName, Boolean ignoreTypeCase, Assembly& assembly)
at Microsoft.VisualStudio.Design.VSTypeResolutionService.SearchEntries(AssemblyName assemblyName, String typeName, Boolean ignoreCase, Assembly& assembly, ReferenceType refType)
at Microsoft.VisualStudio.Design.VSTypeResolutionService.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase, ReferenceType refType)
at Microsoft.VisualStudio.Design.Serialization.CodeDom.AggregateTypeResolutionService.GetType(String name, Boolean throwOnError, Boolean ignoreCase)
at Microsoft.VisualStudio.Design.Serialization.CodeDom.AggregateTypeResolutionService.GetType(String name)
at System.ComponentModel.Design.Serialization.DesignerSerializationManager.GetRuntimeType(String typeName)
at System.ComponentModel.Design.Serialization.DesignerSerializationManager.GetType(String typeName)
at System.ComponentModel.Design.Serialization.DesignerSerializationManager.System.ComponentModel.Design.Serialization.IDesignerSerializationManager.GetType(String typeName)
at System.ComponentModel.Design.Serialization.CodeDomSerializerBase.GetType(IDesignerSerializationManager manager, String name, Dictionary`2 names)
at System.ComponentModel.Design.Serialization.CodeDomSerializerBase.FillStatementTable(IDesignerSerializationManager manager, IDictionary table, Dictionary`2 names, CodeStatementCollection statements, String className)
at System.ComponentModel.Design.Serialization.TypeCodeDomSerializer.Deserialize(IDesignerSerializationManager manager, CodeTypeDeclaration declaration)
at System.ComponentModel.Design.Serialization.CodeDomDesignerLoader.PerformLoad(IDesignerSerializationManager manager)
at Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomDesignerLoader.PerformLoad(IDesignerSerializationManager serializationManager)
at Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomDesignerLoader.DeferredLoadHandler.Microsoft.VisualStudio.TextManager.Interop.IVsTextBufferDataEvents.OnLoadCompleted(Int32 fReload)  

Is there anything I'm missing? What debug strategies can I use at this point?

This CPPProject project is required for my CSPROJECT. If I remove the CPPProject, my application designs, but wont compile. I don't want to have to remove the reference every time I want to modify a form.

Upvotes: 3

Views: 575

Answers (1)

arifnpm
arifnpm

Reputation: 417

I guess it is the c++/cli and/or c# reference problem from the stack trace:

VSLangProj.Reference.get_Path()

Try removing any invalid references in your c++/cli and/or c# project. (Invalid references are marked with an exclamation point icon in project properties)

Upvotes: 0

Related Questions