question

JeanVallee-1281 avatar image
0 Votes"
JeanVallee-1281 asked cooldadtx answered

Why do I have broken references when importing a project template in VS 2019?

I exported a project built in VS 2019 and created a new project based on that template.
When I opened the new project, ALL my references were broken.
The new project is using the exact same references stored in exactly the same folders.
Is there any way to stop this from happening or do I have to delete and add back each one?

vs-general
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

cooldadtx avatar image
0 Votes"
cooldadtx answered

It depends on what references are broken. By default a project template is for a single project and therefore any binary/project references won't work as you are dropping the generated project into a new solution that wouldn't have the other projects (or likely the correctly pathed binaries). However assembly references to framework assemblies and nuget packages should be fine as they will get properly restored.

If you need to support project references then you'll need to create a multi-project template that can create multiple projects. This is non-standard and I'm not sure it is fully supported but it is documented somewhere how to do it.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.