开发者

How to get around circular references in Visual Studio Web Project?

开发者 https://www.devze.com 2022-12-25 21:00 出处:网络
I am trying to create a set of WCF web services for an existing website that uses web site instead of a web application project.I would like to create a DLL that I drop into the Bin folder instead of

I am trying to create a set of WCF web services for an existing website that uses web site instead of a web application project. I would like to create a DLL that I drop into the Bin folder instead of writing all my code inside the App_Code directory. 开发者_如何学编程Ideally, I want to create a project and reference it from the web site, but I am running into a difficult situation.

The DLL will need to reference configuration and other DLLs located inside the bin folder of the website causing a circular reference. How do I get around this issue?


Why is it a circular reference if you are referencing external dlls? You can still have references to configuration without any references to your compiled website's dll. Besides, you will have to get it from Temp ASP .Net files, as websites are compiled on request.

If you really do reference some code from your website, why not put it in your newly made library and reference that code from your website?


Circular references can never be built soley from soure. I'd either collapse the two projects or use reflection to break the circular dependency.


Copy the pages that cause circular references into different folder and compile the application. I had solved my problem by this fix.

0

精彩评论

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