Solved

Copy to output directory in Asp.Net VS2005

Posted on 2010-11-16
8
475 Views
Last Modified: 2012-06-21
I have some third party libs which contain license files. These files don't get copied during publishing. So here's the question:

How do I tell vs2005 to copy a certain file to the debug output directory in an asp.net website ?

Alternatively, I can copy them in postbuild action, but I don't know the path variable of the temp-dir in which the application is compiled during debugging. So this would be accepted as answer too.
The main folder is:
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files, but I need to get the whole path.

Thank you

0
Comment
Question by:Stephan_Schrandt
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 4
8 Comments
 
LVL 52

Expert Comment

by:Carl Tawn
ID: 34143966
Can you not simply include the licence file in yur project? Mark it as Content and have it copy to output.
0
 
LVL 9

Author Comment

by:Stephan_Schrandt
ID: 34144039
How do I do this in vs2005 ASP.NET?

In winforms its no problem, but I do not find this option in ASP.Net. Please see attached screenshot of property window when marking the file.
propwindow.JPG
0
 
LVL 52

Expert Comment

by:Carl Tawn
ID: 34144057
What kind of project are you using Web Application or WebSite? There should be an Advanced section under the properties if it is a Web Application.
props.jpg
0
Space-Age Communications Transitions to DevOps

ViaSat, a global provider of satellite and wireless communications, securely connects businesses, governments, and organizations to the Internet. Learn how ViaSat’s Network Solutions Engineer, drove the transition from a traditional network support to a DevOps-centric model.

 
LVL 9

Author Comment

by:Stephan_Schrandt
ID: 34144110
Sorry I forgot to mention that I'm using a website.

0
 
LVL 52

Expert Comment

by:Carl Tawn
ID: 34144135
In that case I would expect it to copy by default when you publish the site. If i create a new website, add a simple text file, and then publish, the text file goes with it.
0
 
LVL 9

Author Comment

by:Stephan_Schrandt
ID: 34144172
You are right. But try it with the .lic extension ;-)
Obviously there exists either an include or an exclude list for certain file types.
0
 
LVL 52

Accepted Solution

by:
Carl Tawn earned 500 total points
ID: 34144232
True, and there doesn't appear to be a way to modify it through the IDE.

If you add the following to the <compilation> section of web.config then it should work:

          <buildProviders>
            <remove extension=".lic" />
            <add extension=".lic" type="System.Web.Compilation.ForceCopyBuildProvider" />
          </buildProviders>

Open in new window

0
 
LVL 9

Author Closing Comment

by:Stephan_Schrandt
ID: 34144264
Perfectly working. Thank you Carl.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

735 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question