Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
572 views
in Technique[技术] by (71.8m points)

c# - How do I fix Azure Devops build error CS0246 from test project

I have a small C# solution.

The solution contains the main project and a test project.

When I run a basic build pipeline, I get an error CS0246 while building the test project as it can't access the main project.

Solution builds fine locally.

Have I missed something obvious?

question from:https://stackoverflow.com/questions/65902890/how-do-i-fix-azure-devops-build-error-cs0246-from-test-project

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

First, make sure you have used Nuget task with restore command to restore the dependency packages in the pipeline. If the problem persists, you can check if there are any conflicts between the packages you have in source control and the package you are trying to restore.

In addition, you can try to disable the local cache in the build definition. The local cache may only be partially filled.

enter image description here

Here is a ticket with similar issue you can refer to.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...