Equivalent of reference ‘Copy Local’ in ASP.NET Web Site project

I don’t see any exact duplicates in the Related Questions above, so here goes. Please don’t stone me if it is a duplicate.

Is there any way to achieve the same end as setting ‘Copy Local’ to True on a web application reference? I could probably map a custom config section to the <compilation><assemblies> config section, and simple copy all assemblies to local, but that would be quite rude. Should I be looking at tapping into a build provider or something? I think the main issue here is identifying listed assemblies not normally present on the target platform, but this seems a very difficult task to me without simply using a hard-coded list, which will be out of date very quickly.

Answers:

Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.

Method 1

Any non GAC referenced assembly would be copied into the bin folder of the web application and be deployed with it (if using the deploy functionality of visual studio).

Do you need something over and above this?


Update

You can’t directly deploy GACed assemblies using a web application.

If these assemblies are not in the GAC on the deployment target, you will need to copy the relevant assemblies from the GAC into your application bin folder and ensure the references point to the copy in the bin folder.

Method 2

You could add the necessary references to copy in the post-build event perhaps?
or edit the .csproj file in any other way that would help achieve it.

For example you could have the copy section only happen during release builds.


All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x