diff --git a/SharpCompress.sln b/SharpCompress.sln
index 8b23c22e..ff49d65d 100644
--- a/SharpCompress.sln
+++ b/SharpCompress.sln
@@ -1,7 +1,7 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2013
-VisualStudioVersion = 12.0.30110.0
+VisualStudioVersion = 12.0.21005.1
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Testing", "Testing", "{932BBFCC-76E3-45FF-90CA-6BE4FBF4A097}"
EndProject
@@ -22,7 +22,7 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharpCompress.PortableTest"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharpCompress.Test.Portable", "SharpCompress.Test\SharpCompress.Test.Portable.csproj", "{E9C3C94B-FB27-4B4F-B225-57513C254D37}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharpCompress.LinqBridge", "SharpCompress\SharpCompress.LinqBridge.csproj", "{9A6F69DC-258D-4EB4-859E-09EFC7A14A3F}"
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharpCompress.NET2", "SharpCompress\SharpCompress.NET2.csproj", "{9A6F69DC-258D-4EB4-859E-09EFC7A14A3F}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
diff --git a/SharpCompress/Archive/AbstractWritableArchive.Extensions.cs b/SharpCompress/Archive/AbstractWritableArchive.Extensions.cs
index 01744b20..f678f06d 100644
--- a/SharpCompress/Archive/AbstractWritableArchive.Extensions.cs
+++ b/SharpCompress/Archive/AbstractWritableArchive.Extensions.cs
@@ -74,7 +74,11 @@ namespace SharpCompress.Archive
where TEntry : IArchiveEntry
where TVolume : IVolume
{
+#if NET2
foreach (var path in Directory.GetFiles(filePath, searchPattern, searchOption))
+#else
+ foreach (var path in Directory.EnumerateDirectories(filePath, searchPattern, searchOption))
+#endif
{
var fileInfo = new FileInfo(path);
writableArchive.AddEntry(path.Substring(filePath.Length), fileInfo.OpenRead(), true, fileInfo.Length,
diff --git a/SharpCompress/Common/Rar/Headers/RarHeaderFactory.cs b/SharpCompress/Common/Rar/Headers/RarHeaderFactory.cs
index c80072cc..5e630732 100644
--- a/SharpCompress/Common/Rar/Headers/RarHeaderFactory.cs
+++ b/SharpCompress/Common/Rar/Headers/RarHeaderFactory.cs
@@ -93,7 +93,11 @@ namespace SharpCompress.Common.Rar.Headers
{
if (!Options.HasFlag(Options.KeepStreamsOpen))
{
+#if NET2
reader.Close();
+#else
+ reader.Dispose();
+#endif
}
throw new InvalidFormatException("Error trying to read rar signature.", e);
}
diff --git a/SharpCompress/SharpCompress.LinqBridge.csproj b/SharpCompress/SharpCompress.NET2.csproj
similarity index 97%
rename from SharpCompress/SharpCompress.LinqBridge.csproj
rename to SharpCompress/SharpCompress.NET2.csproj
index 54b13ddd..7bf3ee41 100644
--- a/SharpCompress/SharpCompress.LinqBridge.csproj
+++ b/SharpCompress/SharpCompress.NET2.csproj
@@ -49,8 +49,8 @@
true
full
false
- ..\bin\LinqBridge\
- TRACE;DEBUG;DISABLE_TRACE
+ ..\bin\NET2\
+ TRACE;DEBUG;DISABLE_TRACE;NET2
prompt
4
true
@@ -63,7 +63,7 @@
pdbonly
true
- ..\bin\LinqBridge\
+ ..\bin\NET2\
TRACE
prompt
4
diff --git a/SharpCompress/Writer/IWriter.Extensions.cs b/SharpCompress/Writer/IWriter.Extensions.cs
index 5aa91bc1..d5594b4c 100644
--- a/SharpCompress/Writer/IWriter.Extensions.cs
+++ b/SharpCompress/Writer/IWriter.Extensions.cs
@@ -35,7 +35,11 @@ namespace SharpCompress.Writer
{
throw new ArgumentException("Directory does not exist: " + directory);
}
- foreach (string file in Directory.GetFiles(directory, searchPattern, option))
+#if NET2
+ foreach (var file in Directory.GetFiles(directory, searchPattern, option))
+#else
+ foreach (var file in Directory.EnumerateDirectories(directory, searchPattern, option))
+#endif
{
writer.Write(file.Substring(directory.Length), file);
}