Freigeben über


Troubleshooting Domain-Specific Language Tools

This topic describes the issues that typically occur when you work with Domain-Specific Language Tools.

Package Load Failure

Package Load Failure

Solutions for Domain-Specific Language Tools contain two projects: Dsl and DslPackage. If you add a reference to an assembly from either of these projects and Visual Studio 2008 cannot load the assembly, you might get a Package Load Failure error when you try to open an instance of your generated designer.

When you add a reference in your solution to an assembly, you must be sure that Visual Studio can discover it at run time. Because the host application is Visual Studio, you must deploy the referenced assemblies in a location that Visual Studio can reach.

Visual Studio can load external assemblies from the following locations:

  • The global assembly cache.

  • Directories in the Visual Studio probing path (for example, PublicAssemblies).

    Hinweis

    The Visual Studio probing path is specified in the file devenv.exe.config, which is located at <InstallDirectory>Microsoft Visual Studio 9.0\Common7\IDE.

Certain .NET features, such as .NET serialization, require you to use normal fusion probing to find assemblies. Therefore, you must find the assemblies in either the AppBase or the global assembly cache. This requirement can cause very subtle bugs. For example, Visual Studio stores Toolbox items in its cache using the standard binary serializer. If you are using codebase registration and your Toolbox item references a type in your assembly, it will not be read correctly from the cache. The item will appear broken on the Toolbox.

For Domain-Specific Language Tools, assembly registration is recommended over codebase registration during development.

If you must use codebase, you can disable the build rule that puts assemblies in the global assembly cache. To disable this rule, modify the following Boolean property in the Dsl.csproj and DslPackage.csproj files:

From:

<GacTargetOutput>true</GacTargetOutput>

To:

<GacTargetOutput>false</GacTargetOutput>

See Also

Concepts

Troubleshooting Text Templates

Overview of Domain-Specific Language Tools

Domain-Specific Language Tools Glossary

How the Runtime Locates Assemblies

Assembly Registration Tool (Regasm.exe)