Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Fixed ilmerge using the wrong reference assemblies if you have .NET 4.5 installed (when compiling against .Net 4.0). #140

Closed
wants to merge 2 commits into from

2 participants

@AGiorgetti

Currently EventStore il compiled against .NET 4.0 (it's hardcoded in the build scripts), but when you have .NET 4.5 installed the wrong reference assemblies can be used during the Ilmerge process.

take a look at this article:

http://www.mattwrock.com/post/2012/02/29/What-you-should-know-about-running-ILMerge-on-Net-45-Beta-assemblies-targeting-Net-40.aspx

The same problem (and fix) applies to CommonDomain too.

@damianh damianh was assigned
@damianh
Owner

I'll take the first change set only here

@damianh
Owner

This PR actually contains an unrelated change set (MongoDB driver). Going to cherry pick change set 27a96c4

@damianh damianh referenced this pull request from a commit in damianh/NEventStore
@damianh damianh Fixed ilmerge using the wrong reference assemblies if you have .NET 4…
….5 installed (when compiling against .Net 4.0). Cherry picked from PR #140 NEventStore#140
a573d1e
@damianh damianh closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Nov 22, 2012
  1. @AGiorgetti

    Fixed ilmerge using the wrong reference assemblies if you have .NET 4…

    AGiorgetti authored
    ….5 installed (when compiling against .Net 4.0).
Commits on Nov 28, 2012
  1. @AGiorgetti
This page is out of date. Refresh to see the latest.
View
3  build/Modules/ILMerge.psm1
@@ -1,13 +1,14 @@
$script:ilMergeModule = @{}
$script:ilMergeModule.ilMergePath = $null
+<# see this aricle: http://www.mattwrock.com/post/2012/02/29/What-you-should-know-about-running-ILMerge-on-Net-45-Beta-assemblies-targeting-Net-40.aspx #>
function Merge-Assemblies {
Param(
$files,
$outputFile,
$exclude,
$keyfile,
- $targetPlatform="v4,C:/WINDOWS/Microsoft.NET/Framework/v4.0.30319"
+ $targetPlatform="v4,C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0"
)
$exclude | out-file ".\exclude.txt"
View
10 src/proj/EventStore.Persistence.MongoPersistence/EventStore.Persistence.MongoPersistence.csproj
@@ -42,13 +42,11 @@
<Project>{03946843-F343-419C-88EF-3E446D08DFA6}</Project>
<Name>EventStore</Name>
</ProjectReference>
- <Reference Include="MongoDB.Bson, Version=1.5.0.4566, Culture=neutral, PublicKeyToken=f686731cfb9cc103, processorArchitecture=MSIL">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\..\packages\mongocsharpdriver.1.5\lib\net35\MongoDB.Bson.dll</HintPath>
+ <Reference Include="MongoDB.Bson">
+ <HintPath>..\..\packages\mongocsharpdriver.1.7\lib\net35\MongoDB.Bson.dll</HintPath>
</Reference>
- <Reference Include="MongoDB.Driver, Version=1.5.0.4566, Culture=neutral, PublicKeyToken=f686731cfb9cc103, processorArchitecture=MSIL">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\..\packages\mongocsharpdriver.1.5\lib\net35\MongoDB.Driver.dll</HintPath>
+ <Reference Include="MongoDB.Driver">
+ <HintPath>..\..\packages\mongocsharpdriver.1.7\lib\net35\MongoDB.Driver.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.configuration" />
View
8 src/proj/EventStore.Persistence.MongoPersistence/MongoPersistenceEngine.cs
@@ -35,15 +35,15 @@ public MongoPersistenceEngine(MongoDatabase store, IDocumentSerializer serialize
this.commitSettings = this.store.CreateCollectionSettings<BsonDocument>("Commits");
this.commitSettings.AssignIdOnInsert = false;
- this.commitSettings.SafeMode = SafeMode.True;
+ this.commitSettings.WriteConcern = WriteConcern.Acknowledged;
this.snapshotSettings = this.store.CreateCollectionSettings<BsonDocument>("Snapshots");
this.snapshotSettings.AssignIdOnInsert = false;
- this.snapshotSettings.SafeMode = SafeMode.False;
+ this.snapshotSettings.WriteConcern = WriteConcern.Unacknowledged;
this.streamSettings = this.store.CreateCollectionSettings<BsonDocument>("Streams");
this.streamSettings.AssignIdOnInsert = false;
- this.streamSettings.SafeMode = SafeMode.False;
+ this.streamSettings.WriteConcern = WriteConcern.Unacknowledged;
}
public void Dispose()
@@ -136,7 +136,7 @@ public virtual void Commit(Commit attempt)
try
{
// for concurrency / duplicate commit detection safe mode is required
- this.PersistedCommits.Insert(commit, SafeMode.True);
+ this.PersistedCommits.Insert(commit, WriteConcern.Acknowledged);
this.UpdateStreamHeadAsync(attempt.StreamId, attempt.StreamRevision, attempt.Events.Count);
Logger.Debug(Messages.CommitPersisted, attempt.CommitId);
}
View
4 src/proj/EventStore.Persistence.MongoPersistence/MongoPersistenceFactory.cs
@@ -18,7 +18,9 @@ public MongoPersistenceFactory(string connectionName, IDocumentSerializer serial
public virtual IPersistStreams Build()
{
var connectionString = this.TransformConnectionString(this.GetConnectionString());
- var database = MongoDatabase.Create(connectionString);
+ // var database = MongoDatabase.Create(connectionString);
+ MongoConnectionStringBuilder builder = new MongoConnectionStringBuilder(connectionString);
+ var database = (new MongoClient(connectionString)).GetServer().GetDatabase(builder.DatabaseName);
return new MongoPersistenceEngine(database, this.serializer);
}
View
2  src/proj/EventStore.Persistence.MongoPersistence/packages.config
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
- <package id="mongocsharpdriver" version="1.5" targetFramework="net40" />
+ <package id="mongocsharpdriver" version="1.7" targetFramework="net40" />
</packages>
Something went wrong with that request. Please try again.