DotEnvControl.csproj 1.0.0

dotnet add package DotEnvControl.csproj --version 1.0.0
                    
NuGet\Install-Package DotEnvControl.csproj -Version 1.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="DotEnvControl.csproj" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="DotEnvControl.csproj" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="DotEnvControl.csproj" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add DotEnvControl.csproj --version 1.0.0
                    
#r "nuget: DotEnvControl.csproj, 1.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package DotEnvControl.csproj@1.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=DotEnvControl.csproj&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=DotEnvControl.csproj&version=1.0.0
                    
Install as a Cake Tool

DotEnv-AspNet

1- Após adicionar o pacote DotEnvControl pelo nuget, chame o método EnvControl.CriarEnvs() no seu Global.asax;

2- Ponha o nome da pasta do seu diagrama de base de dados, caso use Entity. Se não usar, pode por uma string vazia;

3- Altere o .csproj dos seus projetos para permitir transformção em Build e Rebuild (inclusive para App.Config);

4- Crie uma versão base para cada arquivo de configuração (Web.Base.config e App.Base.config);

5- Edite os arquivos transformadores de configuração dos projetos Web adicionando o seguinte:

<Import Project="..\packages\Microsoft.ApplicationInsights.Web.2.13.1\build\Microsoft.ApplicationInsights.Web.targets" Condition="Exists('..\packages\Microsoft.ApplicationInsights.Web.2.13.1\build\Microsoft.ApplicationInsights.Web.targets')" />  
<Target Name="BeforeBuild">
    <TransformXml Source="Web.Base.config" Transform="Web.$(Configuration).config" Destination="Web.config" />
</Target>
<Target Name="BeforeRebuild">
    <TransformXml Source="Web.Base.config" Transform="Web.$(Configuration).config" Destination="Web.config" />
</Target>

6- Edite os arquivos transformadores de configuração dos projetos library adicionando o seguinte:

<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<UsingTask TaskName="TransformXml" AssemblyFile="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\Web\Microsoft.Web.Publishing.Tasks.dll" />
<Target Name="BeforeBuild" Condition="Exists('App.$(Configuration).config')">
    <TransformXml Source="App.config" Destination="App.config" Transform="App.$(Configuration).config" />
</Target>
<Target Name="AfterBuild" Condition="Exists('App.$(Configuration).config')">
    <TransformXml Source="App.config" Destination="$(IntermediateOutputPath)$(TargetFileName).config" Transform="App.$(Configuration).config" />
    <ItemGroup>
    <AppConfigWithTargetPath Remove="App.config" />
    <AppConfigWithTargetPath Include="$(IntermediateOutputPath)$(TargetFileName).config">
        <TargetPath>$(TargetFileName).config</TargetPath>
    </AppConfigWithTargetPath>
    </ItemGroup>
</Target>
<Target Name="BeforeRebuild" Condition="Exists('App.$(Configuration).config')">
    <TransformXml Source="App.config" Destination="App.config" Transform="App.$(Configuration).config" />
</Target>
<Target Name="AfterRebuild" Condition="Exists('App.$(Configuration).config')">
    <TransformXml Source="App.config" Destination="$(IntermediateOutputPath)$(TargetFileName).config" Transform="App.$(Configuration).config" />
    <ItemGroup>
    <AppConfigWithTargetPath Remove="App.config" />
    <AppConfigWithTargetPath Include="$(IntermediateOutputPath)$(TargetFileName).config">
        <TargetPath>$(TargetFileName).config</TargetPath>
    </AppConfigWithTargetPath>
    </ItemGroup>
</Target>

7- Substitua a referência do App.config no .csproj por:

<ItemGroup>
<None Include="App.config">
  <SubType>Designer</SubType>
</None>
<None Include="App.Debug.config">
  <DependentUpon>App.config</DependentUpon>
</None>
<None Include="App.Release.config">
  <DependentUpon>App.config</DependentUpon>
</None>
<None Include="App.Base.config" />
</ItemGroup>
There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0 876 12/17/2022

Summary of changes made in this release of the package.