开发者

Linking files one solution to another solution is not working-- ASp.net MVC3

I am working on ASP.MVC3 project. I created a base project where I will have all common files / pages like Master Page, Global.asax, Web.Config, Script files, CSS files, and images. And I have another solution which will contain module related stuff and I am linking common files / pages from first solution with “Add As Link” (Add  Existing Item  Add As Link ) option (I am working with VS.net 2010 IDE).

After linking all the files are coming into second solution and looking fine. But when I run, the application is not running. Getting the message enable debut which already there.

when i clilck OK i am getting the error “the operation could not be completed. Unexpected error” (i think its expecting the physical file in the second solution location only). After some R & D I placed the web config and global.asax directly (which is normal) in the second solution then the application started running. The same case for images / css / script files. Please开发者_如何学JAVA let us know the issue what we are doing wrong or is there any other way to share/link files from another solution. Thanks in Advance.


You're probably better off doing it the other way around - create a website project and link your libraries / base classes to your project by adding a reference to them. This way you add all your images, css files etc direct into the website.

That's the more usual way of doing it in my experience, hope it helps.


The reason it doesn't work is because the linked files aren't copied to your working directory. To make your solution work you simply publish it to some other folder and it would re-create the site with copies of all linked files. There's no need to re-organize your solution as it would deploy all linked files once you publish it.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜