开发者

referenced dll not in bin folder

I have an asp.net mvc project and reference a dll to a class library. I would like the dll to appear in the bin folder of my asp.net mvc project (the latest version after building the asp.net project). This does not happen depite the dll's property 'copy local' being 'true'. Is this possible anyway开发者_如何学运维?

Thanks.

C


If the class library project is in the same solution as your MVC project, you could set the build directory of the class library to be the bin of your MVC app.

This will help if you're not sure how http://msdn.microsoft.com/en-us/library/ms165410(v=VS.90).aspx

If your setup precludes you from changing the output directory, another solution may be to set up a pre build step in the mvc app and use xcopy to copy the dll.

xcopy /y /r /i "$(SolutionDir)ClassLibrary\bin\myClassLibrary.dll" "$(TargetDir)"
if errorlevel 1 goto BuildEventFailed

Though, I'm a little curious why the dll isn't being copied automatically. Are you using any of the types in the class library explicitly; creating instances of, or inheriting from, or anything that would indicate to the compiler you do indeed need this dll? I think VS tries to be helpful and not copy binaries it feels are "useless"

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜