In general, for legacy projects, it is necessary to rebuild the project after adding NuGet packages before accessing the designer, due to a known bug in Visual Studio (see here).
This bug manifests in Eyeshot with an "Invalid Developer License" error message, as shown below:
To resolve this issue, close the form, rebuild the project, and then reopen the form.
If this does not help, try to close all the Visual Studio instances, run the authentication tool to ensure you are logged in, and then reopen Visual Studio.
We will distinguish between two cases:
- Legacy projects using
packages.config
- Legacy projects using
PackageReference
Case 1: Legacy Projects Using packages.config
When adding a NuGet package with dependencies in a project using packages.config
, each dependency is managed as an individual package stored in the packages.config
file. If even one of these packages is missing, it can cause issues, particularly at design-time.
Proposed Solution: Convert the project to use PackageReference
, or even better, to an SDK-style project if possible.
How to convert from packages.config
to PackageReference
- Right-click on the project in Solution Explorer and select
Migrate packages.config to PackageReference...
.
- Follow the prompts to complete the migration.
You can also set the default package management format for new projects in Visual Studio.
Go to Tools > NuGet Package Manager > Package Manager Settings. Under Package Management, you can select either packages.config
or PackageReference
as the default format for new projects.
Case 2: Legacy Projects Using PackageReference
In legacy projects using PackageReference
, dependencies are handled more efficiently. However, issues can still arise, especially if the project is not properly rebuilt after adding new packages.
Proposed Solution: Ensure that the project is rebuilt after adding or updating NuGet packages, or even better, convert it to an SDK-style project if possible.
Upgrade .NET Framework Applications
It is possible to perform two types of conversions for .NET Framework projects:
- Conversion to an SDK-style .NET project
- Conversion to an SDK-style project while maintaining .NET Framework as the target
To convert a .NET Framework project to .NET, you can use the Upgrade menu offered by Microsoft.
You will find 2 options:
- Upgrade project to a newer .NET version: this option will convert the .NET Framework project to .NET
- Upgrade project features: this option will convert the legacy framework project to the new SDK-style.
Follow the prompts to update the project according to the chosen option.
Additional Tips
- Rebuild Regularly: Always rebuild your project after adding or updating NuGet packages to avoid design-time issues.
- Monitor Dependencies: Keep an eye on your NuGet package dependencies and update them regularly to avoid conflicts and missing packages.
- Use Visual Studio Tools: Utilize Visual Studio's built-in tools for managing and migrating NuGet packages to streamline the process.
For a comprehensive guide on handling Eyeshot NuGet packages, please refer to the general article here.
Comments
Please sign in to leave a comment.