Solved

Copy to output directory in Asp.Net VS2005

Posted on 2010-11-16
8
473 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
Resolve Critical IT Incidents Fast

If your data, services or processes become compromised, your organization can suffer damage in just minutes and how fast you communicate during a major IT incident is everything. Learn how to immediately identify incidents & best practices to resolve them quickly and effectively.

 
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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

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…
A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

856 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