Tried googling and found this:
I have one executable project, let's say A, which is launching another executable project Bin the run. In order to have a B.exe in A's current working folder, I add B as A's reference so that after the compilation a B.exe will be copied into A's folder. However, I noticed the configuration that I make for B is not copied or generated in A's folder (there is no B.exe.config file in A's folder, only B.exe), and hence the stuff such as tracing for B is not configured correctly.
I can of course copy the B.exe.config manually to A's folder, but I bet there is some automatic way to do that. Could anybody help me?
Reference: How to include the App.config info in a reference executable in .NET?
Then i followed this answer . Put it in my .vbproj file
A much simpler solution would be to simply include the following in the csproj file. This includes the matching file extensions for the referenced files.
<PropertyGroup>
<AllowedReferenceRelatedFileExtensions>
.pdb;
.xml;
.exe.config;
.dll.config
</AllowedReferenceRelatedFileExtensions>
</PropertyGroup>
This is my .vbproj file after include:
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{00000000-0000-0000-0000-000000000000}</ProjectGuid>
<OutputType>WinExe</OutputType>
<StartupObject>ClisxClient.My.MyApplication</StartupObject>
<RootNamespace>ClisxClient</RootNamespace>
<AssemblyName>ClisxClient</AssemblyName>
<FileAlignment>512</FileAlignment>
<MyType>WindowsForms</MyType>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<TargetFrameworkProfile />
<IsWebBootstrapper>true</IsWebBootstrapper>
<PublishUrl>D:\WebApps\ClisX\Installer\3.5\ClisxClient\</PublishUrl>
<Install>true</Install>
<InstallFrom>Web</InstallFrom>
<UpdateEnabled>true</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>true</UpdateRequired>
<MapFileExtensions>false</MapFileExtensions>
<InstallUrl>http://somesite.com</InstallUrl>
<SupportUrl>http://somesite.com</SupportUrl>
<ErrorReportUrl>http://online.ptar.uitm.edu.my/ClisX/ClientError.aspx</ErrorReportUrl>
<ProductName>ClisX Smart Client</ProductName>
<PublisherName>PTAR</PublisherName>
<SuiteName>PTAR Apps</SuiteName>
<MinimumRequiredVersion>1.0.0.0</MinimumRequiredVersion>
<CreateWebPageOnPublish>true</CreateWebPageOnPublish>
<WebPage>install.htm</WebPage>
<AutorunEnabled>true</AutorunEnabled>
<ApplicationRevision>7</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<UseApplicationTrust>false</UseApplicationTrust>
<PublishWizardCompleted>true</PublishWizardCompleted>
<BootstrapperEnabled>true</BootstrapperEnabled>
<AllowedReferenceRelatedFileExtensions>
.pdb;
.xml;
.exe.config;
.dll.config
</AllowedReferenceRelatedFileExtensions>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<DefineDebug>true</DefineDebug>
<DefineTrace>true</DefineTrace>
<OutputPath>bin\Debug\</OutputPath>
<DocumentationFile>ClisxClient.xml</DocumentationFile>
<NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
<Prefer32Bit>false</Prefer32Bit>
<UseVSHostingProcess>true</UseVSHostingProcess>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<DefineDebug>false</DefineDebug>
<DefineTrace>true</DefineTrace>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DocumentationFile>ClisxClient.xml</DocumentationFile>
<NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup>
<OptionExplicit>On</OptionExplicit>
</PropertyGroup>
<PropertyGroup>
<OptionCompare>Binary</OptionCompare>
</PropertyGroup>
<PropertyGroup>
<OptionStrict>Off</OptionStrict>
</PropertyGroup>
<PropertyGroup>
<OptionInfer>On</OptionInfer>
</PropertyGroup>
<PropertyGroup>
<ApplicationManifest>My Project\app.manifest</ApplicationManifest>
</PropertyGroup>
<PropertyGroup>
<ManifestCertificateThumbprint>00000000000</ManifestCertificateThumbprint>
</PropertyGroup>
<PropertyGroup>
<ManifestKeyFile>ClisxClient_TemporaryKey.pfx</ManifestKeyFile>
</PropertyGroup>
<PropertyGroup>
<GenerateManifests>true</GenerateManifests>
</PropertyGroup>
<PropertyGroup>
<SignManifests>true</SignManifests>
</PropertyGroup>
<PropertyGroup>
<TargetZone>LocalIntranet</TargetZone>
</PropertyGroup>
<PropertyGroup>
<SignAssembly>true</SignAssembly>
</PropertyGroup>
<PropertyGroup>
<AssemblyOriginatorKeyFile>
</AssemblyOriginatorKeyFile>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Deployment" />
<Reference Include="System.Drawing" />
<Reference Include="System.Runtime.Serialization" />
<Reference Include="System.ServiceModel" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
</ItemGroup>
<ItemGroup>
<Import Include="Microsoft.VisualBasic" />
<Import Include="System" />
<Import Include="System.Collections" />
<Import Include="System.Collections.Generic" />
<Import Include="System.Data" />
<Import Include="System.Drawing" />
<Import Include="System.Diagnostics" />
<Import Include="System.Windows.Forms" />
<Import Include="System.Linq" />
<Import Include="System.Xml.Linq" />
<Import Include="System.Threading.Tasks" />
</ItemGroup>
<ItemGroup>
<Compile Include="Form1.vb">
<SubType>Form</SubType>
</Compile>
<Compile Include="Form1.Designer.vb">
<DependentUpon>Form1.vb</DependentUpon>
<SubType>Form</SubType>
</Compile>
<Compile Include="frmAppBarTopWin7.Designer.vb">
<DependentUpon>frmAppBarTopWin7.vb</DependentUpon>
</Compile>
<Compile Include="frmAppBarTopWin7.vb">
<SubType>Form</SubType>
</Compile>
<Compile Include="frmConnector.Designer.vb">
<DependentUpon>frmConnector.vb</DependentUpon>
</Compile>
<Compile Include="frmConnector.vb">
<SubType>Form</SubType>
</Compile>
<Compile Include="frmIdle.Designer.vb">
<DependentUpon>frmIdle.vb</DependentUpon>
</Compile>
<Compile Include="frmIdle.vb">
<SubType>Form</SubType>
</Compile>
<Compile Include="frmLockScreen.Designer.vb">
<DependentUpon>frmLockScreen.vb</DependentUpon>
</Compile>
<Compile Include="frmLockScreen.vb">
<SubType>Form</SubType>
</Compile>
<Compile Include="frmMaintainer.Designer.vb">
<DependentUpon>frmMaintainer.vb</DependentUpon>
</Compile>
<Compile Include="frmMaintainer.vb">
<SubType>Form</SubType>
</Compile>
<Compile Include="frmTweaks.Designer.vb">
<DependentUpon>frmTweaks.vb</DependentUpon>
</Compile>
<Compile Include="frmTweaks.vb">
<SubType>Form</SubType>
</Compile>
<Compile Include="Libraries\MyLib\Alive.vb" />
<Compile Include="Libraries\MyLib\CommandList.vb" />
<Compile Include="Libraries\MyLib\Ect.vb" />
<Compile Include="Libraries\MyLib\FormStandards.vb" />
<Compile Include="Libraries\MyLib\GlobalVariables.vb" />
<Compile Include="Libraries\MyLib\RunMaintainer.vb" />
<Compile Include="Libraries\Process\Check.vb" />
<Compile Include="Libraries\Process\Run.vb" />
<Compile Include="Libraries\MyLib\Styles.vb" />
<Compile Include="Libraries\MyLib\Xml.vb" />
<Compile Include="Libraries\Registry\Policies.vb" />
<Compile Include="Libraries\Registry\Startup.vb" />
<Compile Include="My Project\AssemblyInfo.vb" />
<Compile Include="My Project\Application.Designer.vb">
<AutoGen>True</AutoGen>
<DependentUpon>Application.myapp</DependentUpon>
</Compile>
<Compile Include="My Project\Resources.Designer.vb">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<Compile Include="My Project\Settings.Designer.vb">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
<Compile Include="Service References\ServiceReference1\Reference.vb">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Reference.svcmap</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Form1.resx">
<DependentUpon>Form1.vb</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="frmAppBarTopWin7.resx">
<DependentUpon>frmAppBarTopWin7.vb</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="frmConnector.resx">
<DependentUpon>frmConnector.vb</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="frmIdle.resx">
<DependentUpon>frmIdle.vb</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="frmLockScreen.resx">
<DependentUpon>frmLockScreen.vb</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="frmMaintainer.resx">
<DependentUpon>frmMaintainer.vb</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="frmTweaks.resx">
<DependentUpon>frmTweaks.vb</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="My Project\Resources.resx">
<Generator>VbMyResourcesResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.vb</LastGenOutput>
<CustomToolNamespace>My.Resources</CustomToolNamespace>
<SubType>Designer</SubType>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<None Include="ClisxClient_TemporaryKey.pfx" />
<None Include="My Project\app.manifest" />
<None Include="My Project\Application.myapp">
<Generator>MyApplicationCodeGenerator</Generator>
<LastGenOutput>Application.Designer.vb</LastGenOutput>
</None>
<None Include="My Project\DataSources\System.Data.DataTable.datasource" />
<None Include="My Project\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<CustomToolNamespace>My</CustomToolNamespace>
<LastGenOutput>Settings.Designer.vb</LastGenOutput>
</None>
<None Include="App.config" />
</ItemGroup>
<ItemGroup>
<WCFMetadata Include="Service References\" />
</ItemGroup>
<ItemGroup>
<Content Include="Libraries\dlls.txt" />
<Content Include="Libraries\Registry\Readme.txt" />
<Content Include="Resources\background-lock.jpg" />
<Content Include="Resources\clock copy.png" />
<Content Include="Resources\uitm_icon.png" />
<None Include="nashamaya.pfx" />
<None Include="naspenang.pfx" />
<None Include="Service References\ServiceReference1\Clis1.disco" />
<None Include="Service References\ServiceReference1\Clis1.wsdl" />
<None Include="Service References\ServiceReference1\Clis3.xsd">
<SubType>Designer</SubType>
</None>
<None Include="Service References\ServiceReference1\Clis31.xsd">
<SubType>Designer</SubType>
</None>
<None Include="Service References\ServiceReference1\Clis32.xsd">
<SubType>Designer</SubType>
</None>
<None Include="Service References\ServiceReference1\Reference.svcmap">
<Generator>WCF Proxy Generator</Generator>
<LastGenOutput>Reference.vb</LastGenOutput>
</None>
<None Include="Service References\ServiceReference1\configuration.svcinfo" />
<None Include="Service References\ServiceReference1\configuration91.svcinfo" />
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1</ProductName>
<Install>true</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Windows.Installer.4.5">
<Visible>False</Visible>
<ProductName>Windows Installer 4.5</ProductName>
<Install>true</Install>
</BootstrapperPackage>
</ItemGroup>
<ItemGroup>
<WCFMetadataStorage Include="Service References\ServiceReference1\" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\ClisStarter\ClisStarter.vbproj">
<Project>{0000000}</Project>
<Name>ClisStarter</Name>
</ProjectReference>
<ProjectReference Include="..\ShellBasics\ShellLib.csproj">
<Project>{0000000}</Project>
<Name>ShellLib</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
No comments:
Post a Comment