Skip to content
This repository has been archived by the owner on Aug 30, 2023. It is now read-only.

Added support to framework 4.0 and 4.5 #45

Closed
wants to merge 1 commit into from
Closed

Added support to framework 4.0 and 4.5 #45

wants to merge 1 commit into from

Conversation

RealBrubru
Copy link
Contributor

Added the file build.bat to compile and create the package for framewoks 4.0 and 4.5. Also changed the project to support both frameworks.

…s 4.0 and 4.5. Also changed the project to support both frameworks.
@asbjornu
Copy link
Contributor

Great stuff. There's only a couple of problems:

  1. The build fails on TeamCity. I think we need to build the solution twice; once for .NET 4.0 and once for .NET 4.5
  2. If we build it twice, we'd end up with only the last assemblies that were built, as both builds have the same target directory, which might cause problems for the NuGet package.

The build fails as follows:

[13:10:38]  [Step 2/3] src\SharpRaven.sln.teamcity: Build target: TeamCity_Generated_Build
[13:10:38]      [src\SharpRaven.sln.teamcity] TeamCity_Generated_Build
[13:10:38]          [TeamCity_Generated_Build] MSBuild
[13:10:38]              [MSBuild] src\SharpRaven.sln: Build default targets
[13:10:38]                  [src\SharpRaven.sln] ValidateSolutionConfiguration
[13:10:38]                      [ValidateSolutionConfiguration] Error
[13:10:38]                          [Error] D:\BuildAgent-01\work\c379eb2eb77ef67b\src\SharpRaven.sln.metaproj error MSB4126: The specified solution configuration "Release|Mixed Platforms" is invalid. Please specify a valid solution configuration using the Configuration and Platform properties (e.g. MSBuild.exe Solution.sln /p:Configuration=Debug /p:Platform="Any CPU") or leave those properties blank to use the default solution configuration.
[13:10:38]                  [src\SharpRaven.sln] Project src\SharpRaven.sln failed.
[13:10:38]      [src\SharpRaven.sln.teamcity] Project src\SharpRaven.sln.teamcity failed.

There's also a minor issues with the removal of the <releaseNotes> element, but that's easy to reintroduce. Do you have any TeamCity experience and know how this can be fixed? If not, I'll have to do a bit of digging to figure out how we can get this branch to work with TeamCity.

And lastly, the next time you do a pull request, create a new branch for whatever work you're doing first, so all future commits won't be included in the same pull request. If you push new code into your master branch now before this pull request is merged, those commits will end up in this pull request, since the pull isn't limited to the commits you have at the time you request it, but will include all changes made to the branch until it is merged. Just FYI. :)

@RealBrubru
Copy link
Contributor Author

Good to know about the branch.. This was my first time with github.. I thought only a fork would be enough.. thanks.. ;-)

About the , the NuGet was complaining about it when trying to create the package. Forgot to tell.. sorry..

The output path is different for each framework version:

  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release 4.5|AnyCPU' ">
    <DebugType>pdbonly</DebugType>
    <Optimize>true</Optimize>
    <OutputPath>bin\Release\net45\</OutputPath>
    <DefineConstants>TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
    <DocumentationFile>bin\Release\net45\SharpRaven.xml</DocumentationFile>
    <Prefer32Bit>false</Prefer32Bit>
    <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release 4.0|AnyCPU'">
    <OutputPath>bin\Release\net40\</OutputPath>
    <DefineConstants>TRACE;NET40</DefineConstants>
    <DocumentationFile>bin\Release\net40\SharpRaven.xml</DocumentationFile>
    <Optimize>true</Optimize>
    <DebugType>pdbonly</DebugType>
    <PlatformTarget>AnyCPU</PlatformTarget>
    <ErrorReport>prompt</ErrorReport>
    <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
  </PropertyGroup>

That's how the nuget package worked here.. at the build.bat the solution is build twice.. once for framework 4.0 and other for 4.5..

I don't have any experience with TeamCity but I'll take a look.. ;-)

[]'s
Bruno

@RealBrubru
Copy link
Contributor Author

Hi @asbjornu,

Got it how to do it. The build is failing because the project is configured to run with the "Visual Studio (sln)" runner type. This "runner" will compile with the default solution properties and we cannot have more than one default solution property.

What we need to do, is to disable this buid step and create another 2 steps with "MSBuild" runner type. For both, the "Build file path" property will be the project file path and the "Command line parameters" will be "/p:Configuration="Release 4.0" for one and "/p:Configuration="Release 4.5" for the other.

This way, we'll end up with both builds:
\bin\net45\Release
\bin\net40\Release

At the nuspec file, we'll set the files that this way:

    <files>
        <file src="bin\Release\**\SharpRaven.*" target="lib" />
    </files>

Let's do it!? ;-)

[]'s
Bruno

asbjornu added a commit that referenced this pull request Nov 10, 2014
…46.

Conflicts:
	src/app/SharpRaven/packages.config
@asbjornu
Copy link
Contributor

Since this is a duplicate of #46 and that was merged in ee36b01, I'm closing this.

@asbjornu asbjornu closed this Nov 10, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants