MSbuild Getting The Current Configuration From The Solution File?

Jul 31, 2009

In my VB.NET project I have three configurations DEBUG|TEST|RELEASE.

Currently when I am building using MSbuild and TeamCity I hard code the configuration, which smells badly!, to TEST

<Configuration Condition=" '$(Configuration)' == '' ">Test</Configuration>

Now before everyone screams at me not to hardcode this, the reason this was done was becuase we could NEVER seem to get $(Configuration) populated.

So my question is within MSBuild how can I read the currently selected configuration from the solution file commited to SVN?

View 1 Replies


ADVERTISEMENT

Retrieve Keys From DLL Configuration File Not From Current EXE Configuration File?

Feb 7, 2011

I have 3 components :

1.Manager : dll containing Iterface definition and other things

2.Implementation: dll containing Implementation of the Interface

3.Executable: (maybe this one could be a external application or another dll using the libraries)

I have particular methods (iside the interface dll file) that extract information of real Implementation from AppSettings keys in order to instance it using reflection. I use the Manager inside the Excecutable, but when I try to retrieve a especific key defined in "Manager.dll.config" (appSettings), the value returned is empty because the configuration file used is "Excecutable.exe.config" I need this configuration information in Manager config file because this Manager will be used from other programs and the configuration must be centralized into that config file to replicate the possible changes to every app calling this dll.How can I to specify that the ConfigurarionManager.AppSettings must extract values from manager.dll.config file?

View 3 Replies

FilePath For Current Application's Default Configuration?

Jun 4, 2009

FilePath for the Current Application's Default Configuration

View 3 Replies

FilePath For The Current Application's Default Configuration?

Jun 4, 2009

FilePath for the Current Application's Default Configuration .I am writing several DLL's that each have their on configuration file. I am trying to set the Application Default Configuration to be the DLL's Default Configuration - not the EXE's Default Configuration. How can I determine the pathfile for the current Application Default Configuration??I have tried using FILEPATH of SYSTEM.CONFIGURATION.CONFIGURATION but can not get the syntax correct.

View 1 Replies

Save Current Configuration Of Services And Be Able To Restore

May 23, 2010

I have an application that has a part of it that modifies several windows services. When the form loads it checks the registry for the current status of the services.

What I would like to do is have it so that the application takes a snapshot of all the defined services when it is first installed and stores the defined settings for each of them. This way the services can be restored at a later time to there original settines. I would also like to make it so that a custom settings file can be created so that this custom configuration could be loaded which contains changes. The result would be the first file made would allow everything to be reset prior to any changes the second file would contain all the setting changes.

View 20 Replies

Msbuild - Modify The AssemblyInfo.vb File Of The Main Executable?

Jan 6, 2011

I currently have a nightly build system running as a windows scheduled task, calling at batch file, that works sort of like this: Check out the latest revision from subversion Modify the AssemblyInfo.vb file of the main executable and the librarys to set the version number to 0.0.0.revision Invoke MSBuild to build everything (including the installer) Upload the installer and a log of the build to an FTP server This works ok, but step 2 is dirty and fragile, and I can't imagine that this the only way to do what I want. Any ideas?

View 1 Replies

Opening A Solution File It Was Saying "The Selected Fiel Is Not A Valid Solution File"?

Mar 27, 2012

Till yesterday I was working fine with my Project.I din install anything new, am not trying to open my solution file with a different version also.Today when i tried opening my solution, it was saying

"The Selected Fiel is not a valid solution file"

"The Operation could not be completed.Unspecified Error"

Microsoft Visual Studio Solution File, Format Version 10.00

# Visual Studio 2008

Project("{54435603-DBB4-11D2-8724-00A0C9A8B90C}") = "??E", "..Setup2Setup2.vdproj", "{600F8FB2-B9A9-4138-B7E7-FE7B39815CC1}"

EndProject[code].....

View 6 Replies

'ConfigurationManager' Is Not A Member Of 'Configuration' Even When A Reference To System.Configuration.dll Is Added To Project?

Nov 16, 2010

Receive 'ConfigurationManager' is not a member of 'Configuration' in VS2008.I read all of the topics in the forum about this error Tried adding areference to System.Configuration.dll to the project and an "Imports System.Configuration" to the vb file.Still get an error

View 7 Replies

Making A File That The User Doesn't Have Access To And Changing The Location Of The Configuration File?

Jun 25, 2011

on my program i have an activation in it and in order to activate the program you need to enter a code that is stored in the settings. so i was looking through my computer and i found the programs config file. and so I opened it and i found all of the codes for the activation. I need to find out how to make the file so the user doesn't have access to it and then how to move it to a more hidden place in the C: drive.

View 3 Replies

.net - MSBuild Fails On Lambda Expressions?

Jul 25, 2011

I have an issue with building a project using the MSBuild (ver 4) from the command line when declaring lambda expression like this:

Private Sub Foo(ByVal s As String)
Dim WL = Sub(str As String)
If Not String.IsNullOrEmpty(str) Then[code]......

View 1 Replies

Force MSBuild To Compile For 32-bit Mode?

Jul 2, 2009

I'm using MSBuild (via NAnt) to compile a bunch of VB.NET assemblies. Because these assemblies depend on COM Interop, I need to guarantee that they run in 32-bit mode on 64 bit OS's. I can get the executable assemblies to compile to 32-bit by changing the project in Visual Studio, but I'd really like to be able to force all of the executables to be compiled to 32 bit mode on the build server.I've tried a number of command-line parameters to MSBuild with no luck:

/p:Platform=win32
/p:Platform=x86
/p:ProcessorArchitecture=x86

View 5 Replies

Add And Use Configuration File In The Application?

Mar 26, 2010

how to add and use configuration file in the vb.net application like web config file can i change the value in the configuration file

View 14 Replies

Asp.net - MSBuild _CopyWebApplication Not Copying <link> From Vbproj

May 11, 2011

We have a CMD file which loads an MSBuild XML file and builds and publishes our VB .NET Web App. I noticed today that one of the user controls we're using is not being copied to the UserControls folder in the output directory. However when I build and publish the project from within Visual Studio 2008 that file is there.

I believe the reason this is happening is because the file that is in the UserControls folder in the project is a shortcut to a file in a different solution within the same project. The ItemGroup XML in the MyProject.vbproj file looks like this:

<Content Include="..OtherSolutionUserControlFile.ascx">
<Link>UserControlsUserControlFile.ascx</Link>
</Content>

In the MSBuild.xml file we have, the following is being run after the solution has been built:

<MSBuild Projects="$(ProjectRootPath)MyProject.vbproj"
Targets="_CopyWebApplication;_BuiltWebOutputGroupOutput"
Properties="OutDir=$(BuildFilesPath)" />

why the shortcut is not being copied to the OutDir?

View 1 Replies

IDE :: Visual Studio / MsBuild Freezes While Building?

Dec 5, 2009

I have recently stumbled across a problem in the last week where Visual Studio (both 2005 and 2008) will lock up while building my solution. The status in Visual Studio will show "started building" or however the first message reads and then just sit there. At this point, the IDE will lock up (focus is lost and I can not regain it) and my machine's CPU usage will go to 100%. The only way to stop it is to force quit the application or process (either Visual Studio or my Command prompt if I am using MSBuild directly). Of course, the system still seems to be trying to process something because my machine still sits at around 100% basically forcing me to restart my machine to try again.

View 2 Replies

List Obsolete Classes / Methods In Msbuild

Jun 28, 2010

I have upgraded a visual basic 2005 project to visual basic 2010 (.net framework 4.0). I want to list all obsolete functions used in this project in order to change it with newer ones. How can I treat obsolete functions warnings as errors in visual basic 2010 ms-build?

View 1 Replies

Extracted File - When Open The New Project Solution File, It Doesn't Show Me Anything?

Feb 17, 2011

It is saved on my desktop for easy access.I can close the program. I can click the solution to open it right back up, no problems.I then zip my file (also to the desktop)

My problem: I moved the original file (Project A) to another folder and extracted the unzipped Project A onto the desktop. When I open the new Project A's solution file, nothing happens besides VB starting up. It doesn't show me anything.

View 6 Replies

Change Configuration Manager File

Jul 30, 2011

I have a vb.net 2008 desktop application to make changes to it. Since the production database will be changing within a month, I know that i need to change the .net remoing.

1.I change the configuration manager file (app.config) in debug mode to point to the 'new' test database, however the changes are not pick up. The application is still pointing to the current database. Thus can you tell when what kind of files.I need to change so that this application picks up the 'test' data base?

2. After I have tested the changes that need to be made, I will need to deploy the changes. Thus i am assuming that I will need to do something different so I can put the application changes into production. Thus, can you tell what kind of extra dlls,exe, xml, and other files I will need to include in the deployment package? Is there anything else I need to do in the deployment package? This application uses .net remoting to have the database connect to the various proejct files in the entire solution file.

View 1 Replies

Encrypting Configuration File Using RSAProtectedConfigurationProvider?

Mar 6, 2009

I finally managed to encrypt the user settings in my app.config with the following

[code].....

View 3 Replies

Read Configuration File For A Setting?

Jun 11, 2009

My configuration file has the following settings for logging. I want to read the Switches Value attribute to see if Debug is set to 4 (Debug logging) so that I can retain some temporary files. How to I read the value using configuration manager?[code]...

View 3 Replies

Reading Database Configuration From INI File?

Jul 14, 2010

How can in include registry file when compiling my program?

I want to include an .ini to give the users the ability to change the database path for example

[DBConnection]
DATADIRECTORY
p:data

[Code]....

how to program it, or is there a better way than using ini files?

I'm using visual studio 2008.

View 3 Replies

Open The Assignment File On Destop To Access The Solution File?

Sep 18, 2009

I have been trying to open a solution file downloaded from my class for the past two days. When I open the assignment file on my destop to access the solution file, it's not there. I have the variables design, obj, bin, and others but not the .sln file which is the one that I need. How can I fix that problem?

View 2 Replies

.net - Logging From Msbuild Custom Task Using Console Class?

Feb 28, 2011

I'm trying to convert an existing command line tool into msbuild custom task.This tool logs messages and errors using the System.Console class.I've added to the tool's assembly a class that inherits from Microsoft.Build.Utilities.Task and calls the tool main function, and the custom tool works fine - but no messages/errors are displayed (on the Visual Studio output window).I would like to avoid changing the original tool's code (otherwise I could change every "Console.Error.WriteLine" to "Log.LogError").I thought of changing the stdout and stderr streams of console by calling Console.SetOut and SetError before calling the tool's main function. For that, I would need to implement a class that inherits from TextWriter.

[Code]...

View 2 Replies

Error: Cannot Open The Configuration File Patch.cfg

Nov 3, 2008

I'm trying to open an .exe file via vb code using this method: [Code] But I get the following error message: "Cannot open the configuration file patch.cfg", How can I get round this? Do I need to concurrently open the exe and cfg file? If so, how?

View 12 Replies

System.Configuration Config File Name Missing

Nov 3, 2009

I am trying to execute a VB .net console application called Application1 that I created using Visual Studio 2008 with .net framework 3.5. When I run it under the windows scheduler or from a command prompt it works fine. When I try to run it under a purchased job scheduler, I get a message stating that directory APPLIC~1.config is missing. What properties does system.configuration use when it tries to find an application's .config file? Can these be set when my application starts?

Note: I was able to use ConfigurationManager.OpenExeConfiguration(My.Application.Info.DirectoryPath & "" & My.Application.Info.AssemblyName & ".exe") to get around this issue but would like a cleaner solution. I do not want to do this each time I want to retrieve an appSetting entry.

View 6 Replies

VS 2005 Runtime Configuration File(Assembly)?

Jun 5, 2009

Well i m going through a problem, may be anyone knows the solution or may guide me.abcconfig file contains

<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">

[code].....

View 1 Replies

VS 2010 Create An Application Configuration File?

Nov 19, 2009

So i'm trying to create a save configuration file and I found the Application Configuration file which seems like it'll do what I want it to do what

View 3 Replies

How To Build Custom Configuration Section In App.Config File

May 6, 2010

I am trying to build custom configuration section in my app.config file. I am using the following as my example: [URL]. According to this article, I am supposed to inherit from the ConfigurationSection class, add the desired section to my app.config file, and then specify a "configSections" declaration in the app.config file to identify the section and the class that should process it. My problem is that I cannot get the class loader to load my class for processing the section.

If I follow the example and set up my "configSections" as:
<configSections>
<section name="MyStuff.Configuration"
type="MyStuff.MyConfigurer"
allowLocation="true"
allowDefinition="Everywhere" />
</configSections>

I get the following error:
Could not load type 'MyStuff.MyConfigurer' from assembly 'System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.

I think the error is telling me it can't load my class from the System.Configuration DLL and that makes sense; the class is in my application code. So how do I tell it to look in my application code to find the class? Do I have to put my class in its own DLL to get this to work? As an alternative approach, is there some way I can just find the section in the application configuration and process the XML myself? The app.config file is the ideal location for this information. Also, this would be easier for me than going through all of these contortions to do what should be a relatively easy operation.

View 2 Replies

Simple Read/Write App.config Configuration File

Feb 6, 2010

I have a program with various settings, all stored in the app.config file. Often, I have a need to edit the connection string setting. I cannot do so using the My.Settings.myConnectionStringVariable method, as this is read-only. What I would like to do is have a big text box, and simply load the entire app.config file into it. The user could modify whatever they wanted, click save, and the program would save the new edits to the app.config file, and restart the program. I don't have a huge need to only pull out the connection string, as getting the text for the entire config file would suffice. However, if it is easier to pull out just the connection string from the config file, that would work too.

View 1 Replies

Sql - Configuration File For .net (Unable To Pass In Correct Values)

Aug 30, 2011

An exert from my config file looks liek this.

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<appSettings>

[Code].....

EDIT: I am able to pass in the string perfectly when using Visual Studio 2005. But when using VS 2003 and a loiwer .net framework it will not let me, unless I hard code it in.

Could something be enabled/disabled on one of these instances of VS? Or could this just be an error with the older versions of .net? I think I am using 1.1??(will have to check) in 2003.

View 2 Replies

VS 2005 - How To Edit Connection String In Configuration File

Oct 12, 2010

How To Editing The "Connection String" in the Configuration file by the Code in the Runtime. This is my Code
My.MySettings.Default.Item("ConString") = "New Connection String"
My.MySettings.Default.Save()
This code can edit the Configuration file in the run Time but if I restart the system the Configuration file will return back to the first Configuration.

View 1 Replies







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