Solved

Copy to output directory in Asp.Net VS2005

Posted on 2010-11-16
8
468 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
  • 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
 
LVL 9

Author Comment

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

0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

708 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now