Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Copy to output directory in Asp.Net VS2005

Posted on 2010-11-16
8
Medium Priority
?
479 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
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 2000 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

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Question has a verified solution.

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

More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…

972 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