I've got a solution containing 6 or so projects which all build fine when in debug configuration. However, when I try and build it in release mode, I get 53 errors all complaining that DLL's can't be found. This is just a few of the messages:
Errors:
Warnings
How do I start to fix this?
The debug paths have been left as they are, but each project release path has been set to build into a specific folder.
EDIT: This is what my Error List looks like. All of the errors appear to be related to third party packages.
I had a similar problem. Project builds fine in Debug mode but in Release mode some references were missing.
I found out, the dll's of the missing references were all located in the bin/debug folder. I moved them towards a neutral location, added them again to the project and the problem was solved.
As pointed out by Filburt. There were some broken reference paths in the project files. After correcting these paths, everything builds as expected.
Not sure how they got broken to begin with though. Any thoughts?
My problem with this was that the referenced library had the "allow unsafe code" checkbox checked, but on the release build it wasn't checked. The error of not allowing unsafe code was not visible.
Go to your "References" under your project when you have the error. Delete the reference that the compiler complains about. Add it again.
That should fix the broken references.
I had same problem after I renamed one of classes in a referenced project. I tried all [well, most] suggestions posted here, but none of them worked. I finally unloaded the projects that had errors and just reloaded them again, and all errors were gone!
For the other searchers who will reach this post. I also figured out a issue, that maybe the references library is not having the matching .NET version! It is also worth a short check...
删除“.vs”文件夹是我的解决方案。
I had the similar issue and I did not find any of the solution mentioned above.
But this is what I tried and it fixed my issue.
I had a similar experience. I could build in Debug mode but not in Release mode. The broken references were all to dlls in a shared library directory.
I had moved my project to a different directory. To fix the issue, I corrected the <HintPath>
in my.csproj file.
Adding this, since I see there might be multiple solutions for each problem.
Experiencing the same issue - after transferring the project's solution from one PC to another - changing the output path from Properties > Build > Output fixed this issue.
The problem was that during the publish process, VS was looking for the application files in a folder that they were not generated at (By default it is /bin/[Project Name Folder]/ ).
So I changed this output path value to /bin/Release/ folder and everything worked like charm.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.