C# - Post Build Copy Config File To Another Project?

Feb 13, 2010

I have a solution which contains a website and various class libraries. The exists on the file system like so:

C:Projects MyWebsitedevMyWebsite.sln
C:ProjectsCoreMyClassLibrary1.csproj
C:ProjectsCoreMyClassLibrary2.csproj


I want to move the App.config file from MyClassLibrary1 project to the bin of the MyClassLibrary2. I want to do this on post build in VS or MSBuild using relative paths if possible. This way anybody checking out the projects will not have to modify any paths if they choose to locate the project in a different location.

I have already tried the following approaches but to no avail.

copy /Y "$(ProjectDir)App.config"
$(ProjectDir).. MyClassLibrary2$(OutDir) MyClassLibrary2.dll.config"

View 2 Replies


Similar Messages:

Configuration :: How To Add A Post Build Event To A Web Deployment Project

Apr 22, 2010

I need to know how to add a post build event to a Web Deployment Project.

How can it be done?

View 5 Replies

WCF / ASMX :: Adding Reference To Web Service Do Not Copy The .config File?

Jul 8, 2010

I am adding a reference of class library in web service in VS2008 and it is not copying the .config file from class library to web service. I have checked the property "Copy to output directory" of .config file and its value is "Copy Always".

View 3 Replies

How Many Web.config File Does A Solution/project Can Contain

May 26, 2010

How many web.config file does a solution/project can contain?

View 6 Replies

Error From Config File After Converting Website Project To Web Application?

Jun 22, 2010

I got this error in a project I did a while back. I think this was a web site project that i converted to a web app project. This was a while ago. This is an app I'm trying to run on my local machine. I'm not using IIS.

Does anyone know what this means?

Error 2

It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS.

C:UsersKristDocumentsVisual Studio 2008ProjectsWeb AppsKrist Woodard .net tabbedWebApplication1WebApplication1Web.config 46

View 2 Replies

Setting Up Dev Environment / Publish The Project Without Manually Changing The Web.config File?

Feb 15, 2011

I'm working on different windows machines and virtual windows machines on a mac. I have a project wich uses SQL server and AD for autentication.

Right now I have to be connected to VPN so that the asp.net web application can connect to AD using LDAP string to autentivate users, I also have the SQL server on the other side of the VPN connection.

Is there any way to setup my enviroment so that I can work locally without the AD, and on a local SQL server and be able to publish the project without manually changing the web.config file?

View 1 Replies

Configuration :: What Is The Diff Between Link To Assemblies In Project File And Assemblies In Web.config File

Apr 30, 2010

when I reference a assembly. It's reference gets added to the project file in my case ( ABC.csproj)

Also when I take a look at the web.config file there is a section called <assemblies>. And lot of assemblies are added there.

What is the difference between link to the assemblies in the Project file and the assemblies in the web.config file?

View 1 Replies

GridView / Build A Footer Like Exact Copy Of Header? (Visual And Methods)

Jan 4, 2011

I´m extending the Gridview. Right now, i have this: My goal is to change it till i get this (Paint):

I think that it can be done thru the "OnRowCreated". But dont have a clue on how.

protected override void OnRowCreated(GridViewRowEventArgs e)
{
base.OnRowCreated(e);
if (e.Row.RowType == DataControlRowType.Footer)
{
}
}

View 3 Replies

What Is Difference Between Web.config Assemblies Element And Project File Reference Element

Sep 29, 2010

I'm looking at an asp.net application, i notice that there are assemblies defined into two places. In web.config there is configuration/system.web/compilation/assemblies/add elements. In the project file there are references setup under the Project/ItemGroup/Reference elements.

I was wondering, what is the difference between assemblies/references added in either location?

View 1 Replies

C# - Put Build Number In Web.config?

Oct 12, 2010

I'm trying to get my build number into the web.config of an ASP.Net MVC project (long story, but there is a reason)... something like this:

<appSettings>
<add key="version" value="1.0.3936.27150" />
</appSettings>

Right now, I'm doing it with an executable on the post-build event by looking at the assembly to get the version and stuff that into the web.config. It works, but isn't exactly what I was looking for.

View 1 Replies

C# - Debug Wrong Copy Of Project In MVC?

Feb 10, 2011

i just upgrade my MVC 1 project to MVC 3. and now in my current project [MVC3] have no views as old have.

when i run them or debug i found that everything i can see means all pages i can see by debug this blanks views project who still not have any views. i am wonder. i restart them and try by disk cleaning but their is nothing goes right. don't wonder if you not understand it:-

i have two project [first in MVC1 and 2nd in MVC3] MVC1 project have views. MVC3 project still not have any views but for testing i make blanks page. i wonder by debugging blanks views MVC3 project i can see everything who already My MVC1 project have. why this problem come are reason is that same name of both project. i am trying this when i run only project MVC3 [no-views] but they show me everything i can see in MVC1 project. well are their any way to solve this problem

NExT STEP:

i found that the problem is that i have two copy of a project. first in MVC 1 and 2nd in MVC 3 [razor] i found that when i run in MVC3 project who is in D drive the code they debug is MVC1 who is in C drive. i find out this by checking server.mappath i wonder how they debug mvc1 project when i debug MVC3 project

View 1 Replies

A Project Build But Not Compile?

Jan 3, 2010

I've noticed that my project builds successfully when I hit F6.But when I run it with F5 the compilation errors in my C# surface.Why is this?Is it because the JIT compilation happens when I debug with F5 but not when I build with F6?

View 6 Replies

Build Installer To Update ASP Web.config

Nov 12, 2010

I have an add-on for a commercial ASP.NET website. My add-on requires people to merge entries into their web.config, add/overwrite existing files, and add some DLL files to the bin folder. Is there a good and safe way to create an installer than can do this with a wizard type of installation?

View 2 Replies

Installation :: How To Copy And Paste Project/website

Jun 30, 2010

i have developed simple login form as my web application. I wanted to connect it with database to add some more features. However, my VS 2008 was unable to connect with SQL Server 2008 on my laptop, I thought, I should copy and paste my entire web application folder into my web space provided by university. I have done that through ftp. However, when I have tried to debug my application (through remote desktop connection on my university server) I got some weired error.

Furthermore, when I have tried to debug my application on my laptop, it gave me an error that "Web.config file has been renamed, changed or deleted........."

So, my question is, "Is it possible to copy and paste your project simply like you do with your other files (songs, movies or photos etc...) and can debug (source as well as destination) without doing any further editing or chages?"........If no, what are the other alternatives?......

View 1 Replies

MVC :: Is Better To Create An 2 Project And Copy 1 Relevant Files

Mar 13, 2010

I followed the instructions from the release notes, except for one thing. I did not include the following in my web.config. Thas the the "bindingRedirect oldversion 1.0.0.0 to newVersion 2.0.0.0". I got an error message to the effect that I could not have 2 configuration sections in the web.config. I was told that as long as I had the system.web.mvc 2.0.0.0 in my BIN and, I was refereincing this same version dll that I should be fine? I am wondering if I should just create a new MVC2 project and copy my MVC1 relevent files into this MVC2 project, not sure.

View 1 Replies

Build And Deploy .net Mvc Project Using TFS Configuration?

Mar 28, 2010

I need to build and deploy my asp.net mvc project using TFS Configuration

View 1 Replies

Configuration :: How To Merge A Distribution Web.config File And An Existing Web.config File

Mar 30, 2010

I'm preparing to deploy a ASP.NET web application. The target server has already a previous version of my web application with parameters specified on the web.config file.

In the new version of this web application, the web.config file contains new sections I would like they appear into the target web.config file on the server.

However I can't find the way to merge the new web.config sections into the existing web.config file ?

Does I have to do it programmatically, or is there a tool to merge the both files during installation ? (I'm using Web Setup Project).

View 2 Replies

Team Build 2010 And Web.config Transformation?

Nov 25, 2010

I'm struggling to get web.config transformations working with automated builds. We have a reasonably large solution, containing one ASP.NET web application and eight class libraries. We have three developers working on the project and, up to now, each has "published" the solution to a local folder then used file copy to deploy to a test server. I'm trying to put an automated build/deploy solution in place using TFS 2010. I created a build definition and added a call to msdeploy.exe in the build process template, to get the application deployed to the test server. So far, so good!

I then tried to implement web.config transforms and I just can't get them to work. If I build and publish locally on my PC, the "publish" folder has the correct, transformed web.config file. Using team build, the transformation just does not happen, and I just have the base web.config file. I tried adding a post-build step in the web application's project file, as others have suggested, similar to:

<target name="AfterBuild">
<TransformXml Source="Web.generic.config"
Transform="$(ProjectConfigTransformFileName)"
Destination="Web.Config" />
</target>

but this fails beacuse the source web.config file has an "applicationSettings" section. I get the error Could not find schema information for the element 'applicationSettings'.I've seen suggstions around adding arguments to the MSBuild task in the build definition like

/t:TransformWebConfig /p:Configuration=Debug

But this falls over when the class library projects are built, presumably because they don't have a web.config file.

View 3 Replies

.net - Equivalent Of Reference 'Copy Local' In Web Site Project?

Nov 25, 2010

I don't see any exact duplicates in the Related Questions above, so here goes. Please don't stone me if it is a duplicate.Is there any way to achieve the same end as setting 'Copy Local' to True on a web application reference? I could probably map a custom config section to the <compilation><assemblies> config section, and simple copy all assemblies to local, but that would be quite rude. Should I be looking at tapping into a build provider or something? I think the main issue here is identifying listed assemblies not normally present on the target platform, but this seems a very difficult task to me without simply using a hard-coded list,

View 2 Replies

C# - Cannot Find Missing Reference / Copy Code From One Project To Another

Sep 22, 2010

I am trying to copy code from one project to another. There is one problem however:

The type 'Microsoft.Practices.EnterpriseLibrary.Data.Sql.SqlDatabase' is defined in an assembly that is not referenced. You must add a reference to assembly 'Microsoft.Practices.EnterpriseLibrary.Data, Version=3.1.0.0, Culture=neutral, PublicKeyToken=null'.

View 3 Replies

Visual Studio :: Unable To Copy Project Folder?

Apr 26, 2010

I currenty have a project hosted on our server, when i open that project folder i see about half of the folders i should normally see, i dont see the Controllers folder, Properties folder, obj folder, as well as the csproj file. Before I could copy this same folder and put it on my laptop and after it brought all of them over it would show these folders. Now it wont, it just copies over what it sees, not the other folders...I'm trying to create a copy on my laptop that I can work on then publish it to the server...I was able to do this before just fine, now its not copying/generating the necessary folders/files to my comp

View 2 Replies

Configuration :: How To Move To The Testbox From Project Build

Mar 10, 2010

I have created a service project in VS 2005 that is ready for test. What files do I need to move to the test box from my project build?

View 9 Replies

How To Get Visual Studio 'Publish' Functionality To Include Files From Post Build Event

Jun 29, 2010

I am currently attempting to use Visual Studio 2010 'Publish' and MSDeploy functionality to handle my web deployment needs but have run into a roadblock with regards to customizing the package depending on my build configuration.

I develop in a 32bit environment but need to create a release package for a 64bit environment, so in the 'Release' configuration I have a post build event that copies the 64bit version of a third-party dll into the bin directory overwriting the 32bit version. When I use the 'Publish' functionality, even though the correct 64bit dll is being copied to the bin directory, it doesn't get included in the package.

Is there a way to get the 'Publish' to include files that have been copied into the bin directory during a post build event?

View 2 Replies

Getting "cannot Copy Assembly" Errors When Trying To Build Website

Feb 25, 2010

I'm getting two of these errors when trying to build the full solution for our website. Here's the full text of the errors:

Error 91 Cannot copy assembly 'Emcom.DataAccess.dll' to file 'C:workevan-moor.com-trunk2007.evan-moor.comBinEmcom.DataAccess.dll'. Unable to add 'C:workevan-moor.com-developmentEmcom.DataAccessinDebugEmcom.DataAccess.dll' to the Web site. Unable to add file 'BinEmcom.DataAccess.dll'. The process cannot access the file because it is being used by another process.
C:...2007.evan-moor.com

Error 92 Cannot copy assembly 'Emcom.DataAccess.Generated.dll' to file 'C:workevan-moor.com-trunk2007.evan-moor.comBinEmcom.DataAccess.Generated.dll'. Unable to add 'C:workevan-moor.com-developmentEmcom.DataAccessinDebugEmcom.DataAccess.Generated.dll' to the Web site. Unable to add file 'BinEmcom.DataAccess.Generated.dll'. The process cannot access the file because it is being used by another process.
C:...2007.evan-moor.com

I've done everything I can think of short of reinstalling Visual Studio to try and fix this and nothing works. One of my co-workers also gets these errors, but another one does not. I suspect one of us might have done a merge incorrectly to cause this given that it's referring to the development folder in here while I'm trying to build the solution of the trunk.

I've checked and double checked all the dlls, and the two projects referenced here and neither of them are using the development folder, which I suspected might have caused this. I also did a clean brand new checkout of our trunk, and still got these errors. Then I tried deleting all the .NET temporary files to solve it, and still no luck. I did a google search for this issue and found a Microsoft hotfix for the problem which involved replacing a dll - but that was for Visual Studio 2003, and I'm using 2008. The dll in question on my computer is two full versions newer than the replacement version they list in the hotfix, so I'm not sure it'd be a good idea to replace what I've got with what's mentioned there.

Short of reinstalling Visual Studio and reformatting my computer, I'm out of ideas. Reinstalling might do it, but reformatting would be too much work just to fix this bug.

View 2 Replies

Visual Studio :: Web.config Transformations On Build/debug

Mar 3, 2010

I really like the new transformation feature for the web.config. It seems to work when I do "Build deployment package" but not when I just want to locally start the debugging using the green arrow. It just uses the web.config without processing theWeb.Debug.config. I can prove that because in web.config I have debug="false" with a transformation in Web.Debug.config so that it gets true but everytime VS asks if it should modify the web.config to enable debugging which it should've done automatically with the following transformation:

[Code]....

Am I missing something here? I used to work with NAnt to modify/create the web.config as a pre-build event but I thought that I wouldn't need it anymore. Am I wrong? The project is a freshly created asp.net mvc 2 web application.

View 20 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved