Reputation: 193
I have created a windows form application in c# which loads video from hard disk and display them in the form using windows media player. After a 2-3 pc restarts when I am operning my project in visual studio I am receiving the following message and I can't enter to the designer:
Any idea how can I overcome this burden? Can I program my form elments without the designer? The weird is that windows media player is working fine when I am running my project but it just dont let me change the design of the form!
Upvotes: 1
Views: 1734
Reputation: 61
There are two ways to add Windows Media Player to a WinForms project. However, the second method didn’t work for me:
Using the Toolbox:
Manually Adding a Reference (did not work in my case):
Upvotes: 0
Reputation: 18013
AxWMPLIB
ActiveX component is registered in Windows. If not, look for the corresponding .dll
or .ocx
files and register them with by the regsvr32
command.devenv.exe
) even in a 64-bit Windows. It means that the designer is executed in a 32 bit environment as well. Sometimes this can lead to such errors if you use 3rd party components. Try to add the x86
configuration in the Configuration Manager, make a new build and try to open the designer afterwards. At the end you can build the AnyCPU version of you app, of course.*.Designer.cs
and configure your form manually...Upvotes: 1
Reputation: 8643
You can check whether code is being executed at design time like this :
if(System.ComponentModel.LicenseManager.UsageMode == System.ComponentModel.LicenseUsageMode.Designtime)
//... do not execute the code that will crash at design time.
Upvotes: 1