开发者

C# dll not found at compile time

开发者 https://www.devze.com 2023-04-05 16:18 出处:网络
I\'m writing an application in .Net 3.5. I have 3 projects in the solution so far. When adding the references to the other projects from my main project, the intellisense manages to find the classes

I'm writing an application in .Net 3.5.

I have 3 projects in the solution so far. When adding the references to the other projects from my main project, the intellisense manages to find the classes from the other project's dll开发者_运维技巧s but at compile time it seems to be "loosing" the reference.

This might be because I initially created the project with target framework .Net 4.0. However since I needed to use the ASP.NET web services I had to downgrade to 3.5.

Any help will be greatly appreciated.


The referrenced projects must be Copy Local : True Referrence -> Properites ->Copy Local : True


Batch clean all projects in your solution, make sure all the projects in your dependency graph target the .NET 3.5 framework. Check the reference's HintPath in your .csproj file (open with text editor) for references to external DLLs and make sure they're all <=3.5.

However since I needed to use the ASP.NET web services I had to downgrade to 3.5.

There are also several different web service projects in .NET 4. I don't quite understand this move.


You have project references, intellisense sees your referenced classes but when compiling, the compiler seems not to find the referenced assemblies.

I see two possible reasons for this behaviour:

  1. Your main project references a lower version of the .NET framework than your library projects (this is the most likely cause).
  2. Your library projects won't get built at all / or in the wrong order (check the settings in the configuration manager. Open it with a right click on your solution in the solition explorer).
0

精彩评论

暂无评论...
验证码 换一张
取 消