Pauluss86

Hello everyone, my first post here :)

I have a problem viewing my Form in Form Designer; however, this only happens with the current project i'm working on. When I try to view my form i get the following error:

One or more errors encountered while loading the designer. The errors are listed below. Some errors can be fixed by rebuilding your project, while others may require code changes.

Error in the application.

Hide

at Microsoft.DirectX.Direct3D.Effect.FromFile(Device device, String sourceDataFile, Macro[] preprocessorDefines, Include includeFile, ShaderFlags flags, EffectPool pool, String& compilationErrors)
at Microsoft.DirectX.Direct3D.Effect.FromFile(Device device, String sourceDataFile, Include includeFile, ShaderFlags flags, EffectPool pool)
at D3DSurfaceControl.D3DViewportControl.InitVertexElement() in C:\Documents and Settings\Paul\My Documents\Visual Studio 2005\Projects\D3DSurfaceControl\D3DSurfaceControl\D3DViewportControl.cs:line 295
at D3DSurfaceControl.D3DViewportControl..ctor() in C:\Documents and Settings\Paul\My Documents\Visual Studio 2005\Projects\D3DSurfaceControl\D3DSurfaceControl\D3DViewportControl.cs:line 57

Immediately the "Microsoft Visual C# has encountered a problem and needs to close." window popus up and the program shuts down.
The strange thing is, is that when I comment out line 57 (which calls a function at line 295), rebuild and then try to reopen the designer the problem persists. Also, even though VC# tells me it needs to close, I can just ignore that message and continue developing my project. Furthermore, my program runs without any trouble in both debug and release. I have to admit I added a line in Form.Designer.Cs (which I probably shouldn't do), but I haven't had any problem after that. The problem started to pop up after having implemented a HLSL shader (DirectX 9.0c). At first I didn't really bother to solve this problem because I was only coding, not designing, but now I want to add more controls to the form and it would be a pain to do that manually.
Maybe it's of importance to note that my form currently only displays a single customized control i made which displays a rotating volume texture using DirectX. I searched the web for a solution but couldn't find one, maybe one of you guys (or gals) could help me out.

Thanks in advance,

Paul

Oh, i'm using VC# Express 2005 btw.


Re: Visual C# IDE VC# Express crash with form designer

FranziskaB

Hello,

I had the same problem.

If you select the folder (I only have the German names) : C:\Dokumente und Einstellungen\f.buck\Lokale Einstellungen\Anwendungsdaten\Microsoft\VisualStudio\8.0\ProjectAssemblies

I don't know the English names, but it should be something like that:

C:\Documents and settings\USERNAME\local settings\application data\Microsoft\VisualStudio\8.0\ProjectAssemblies and delete all the subfolders in there.

Then you should be able to reload your forms.

Before you delete the folders, you have to close Visual Studio though.

Hope it works!

Franziska





Re: Visual C# IDE VC# Express crash with form designer

Pauluss86

Hey Franziska,

Thanks for replying. Unfortunately your solution doesn't work for me. First of all I don't have a VisualStudio directory in that location (maybe because i'm using VC# 2005 Express edition ), so I tried this folder:

...\Local Settings\Application Data\Microsoft\VCSExpress\8.0\ProjectAssemblies

But without any luck, no subdirectories there to delete. Thanks for your quick answer though! I'm starting to get curious what could cause a problem like this. At the moment i'll just continue coding, but there comes a point in the near future where I would like to make a kickass form :)
Any other suggestions to solve this problem

Paul




Re: Visual C# IDE VC# Express crash with form designer

Pauluss86

Hey,

I found a workaround for my problem, not really a solution though. My control loads a few resources when it is initialized (volume texture, shader and conventional texture) so i can see if any code changes have the desired effect without having to load the resources manually. I commented out the lines of code that were responsible for loading these resources (from file btw, not embedded), and the Form Designer works without crashing which is great.
As mentioned above this is not really a solution because I have to comment out those lines of code to be able to use the Form Designer and uncomment them after I'm done to run my solution properly. Hope this is helpful to someone, but it would be nice if a real solution exists.

Paul


<edit>
Slightly better workaround: removed the resource loading code from the control's constructor and instead wait for the control to be loaded before calling the resource loading routine. No need for commenting/uncommenting this way..