简体   繁体   中英

Can you link compiled dll's in bin folder to cs files in bin folder?

I have a website project in VS2010 with a bin folder containing compiled dll's and corresponding code files(CS). I use the command line compiler to compile the dll's. Is there a way to link the code files to the dll's?

IE When I open a code file and select "Find all references" on a method, VS2010 only finds the current code file. It believes the code file and dll are two different classes with the same name. If I declare an Object type of the code file VS2010's intellisense will show a message alerting me of the conflict and that its using the definition in the code file.

Is there a better way of doing this? Any insight would be appreciated. Bump

Your basically going bout this in the wrong way. All of you .cs file should be in a project and then you reference the project. Below is an image of a solution explorer with a few project, forget the testing stuff but look at the rest. SD.UI.Editor project has project references to the other assemblies it needs and then when you compile the solution visual studio decides what references what and the order that thing need to be compiled in. It copies the assemblies for you and when you debug it will let you step into different projects. You can also achieve the find all usages and reference from you original question. You should never be placing cs file in a bin folder. Good luck

解

First off, get rid of the Web Site project. There are so many downsides to them that they aren't worth starting off with. One of which is that all of your .cs files needs to be in a directory called app_code. Another is the huge difference in how a project is compiled.

Instead, use Web Application Projects. WAPs give you a lot more flexibility in how to manage your project.

Next, code files do not belong in the BIN directory. Also, if you are including references, don't drop them in your BIN directory. Instead, either do project level references or add a folder named something like "Assemblies" and place them there. Then add the references from that location.

The BIN directory should be managed solely by visual studio. This means keep out of it. Visual Studio commonly updates that directory with a lot of things and it's not normally added to source control

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM