Solved

Copy to output directory in Asp.Net VS2005

Posted on 2010-11-16
8
477 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
Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

 
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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

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…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…

628 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