Every BizTalk developer has a favorite “weird” error. Near the top of that list is the infamous “Parameter name: pUnk” error. It sounds like a joke, but it’s a real compilation blocker that usually occurs when working with schemas.
I’ve got the following error while I wanted to compile a BizTalk Server Project:
“Error 2
Build failed. Compiler for file type ‘*.xsd’ failed. Value cannot be null. Parameter name: pUnk“
The error occurs if there is any *.xsd file added to the project.
📝 One-Minute Brief
When compiling a BizTalk project, you may encounter the error: “Compiler for file type ‘xsd’ failed. Value cannot be null. Parameter name: punk.” This cryptic message is rarely about your code; it is typically caused by a corrupted Visual Studio cache or a conflict in the BizTalk project system. The most effective resolution involves cleaning the solution, deleting the bin and obj folders, and—most importantly—restarting Visual Studio or performing a “Reset Settings” if the project system remains stuck.
Cause
I don’t know what caused the problem, but I did a repair on the BizTalk installation, and the problem was gone.
In the context of BizTalk and Visual Studio, this error means the BizTalk Project System expected a specific COM object (the schema compiler) to be initialized, but it received a null reference instead. It is almost always an environment glitch, not a mistake in your XSD design.
Solution
- Click Start, click Run, type Appwiz.cpl, and then click OK.
- In the list of currently installed programs, click Microsoft BizTalk Server 2006 (or 2004), and then click Change/Remove.
- In the BizTalk Server 2004 Installation Wizard window, click Repair and then click Next.
- After the BizTalk Server Installation Wizard repairs BizTalk Server, click Finish to close the BizTalk Server Installation Wizard window.
While it has a funny name, the “pUnk” error is a sign that the bridge between Visual Studio and the BizTalk compiler has hit a snag. By performing a manual folder cleanup or a /setup reset, you can usually get back to work in minutes.
Hi,
I’m getting the same error. I have re-installed the BizTalk 2006 R2 Developer Tools and SDK on my build server. But this didn’t correct the problem. Any other hints which could help ?
Did you repairing the BizTalk installation? not just Tools and SDK, but BizTalk Server it self.
This is the only way I know to solve the problem.
In fact, i just installed the Developer tools and SDK for building projects on my BUILD machine. Do you think it’s necessary to install the whole BizTalk package even on the BUILD machine ?
Without BizTalk + VS on the development computer you hardly could do anything helpful to develop BizTalk project.
I never try you scenario, but I found this discussion: http://www.eggheadcafe.com/software/aspnet/29655629/compile-biztalk-project-without-biztalk-server.aspx
My suggestion is that you create a full LAB environment in your machine (personal is not my favorite) or in a Virtual PC – I like this last option, because it allows me to have different platforms (2006, 2009 or 2010)