|
264 | 264 | project.Disconnect() |
265 | 265 | |_->() |
266 | 266 |
|
| 267 | +letinvalidPathChars= set(Path.GetInvalidPathChars()) |
| 268 | +letisPathWellFormed(path:string)=not(String.IsNullOrWhiteSpace path)&& path|> Seq.forall(fun c->not(Set.contains c invalidPathChars)) |
| 269 | + |
267 | 270 | overridethis.Initialize()= |
268 | 271 | base.Initialize() |
269 | 272 |
|
@@ -304,27 +307,31 @@ and |
304 | 307 |
|
305 | 308 | /// Sync the information for the project |
306 | 309 | memberthis.SyncProject(project:AbstractProject,projectContext:IWorkspaceProjectContext,site:IProjectSite,workspace,forceUpdate)= |
307 | | -lethashSetIgnoreCase x=new HashSet<string>(x, StringComparer.OrdinalIgnoreCase) |
308 | | -letupdatedFiles= site.SourceFilesOnDisk()|> hashSetIgnoreCase |
309 | | -letworkspaceFiles= project.GetCurrentDocuments()|> Seq.map(fun file-> file.FilePath)|> hashSetIgnoreCase |
| 310 | +letwellFormedFilePathSetIgnoreCase(paths:seq<string>)= |
| 311 | + HashSet(paths|> Seq.filter isPathWellFormed, StringComparer.OrdinalIgnoreCase) |
| 312 | + |
| 313 | +letupdatedFiles= site.SourceFilesOnDisk()|> wellFormedFilePathSetIgnoreCase |
| 314 | +letworkspaceFiles= project.GetCurrentDocuments()|> Seq.map(fun file-> file.FilePath)|> wellFormedFilePathSetIgnoreCase |
310 | 315 |
|
311 | 316 | let mutableupdated= forceUpdate |
312 | 317 |
|
313 | 318 | for filein updatedFilesdo |
314 | 319 | ifnot(workspaceFiles.Contains(file))then |
315 | 320 | projectContext.AddSourceFile(file) |
316 | 321 | updated<-true |
| 322 | + |
317 | 323 | for filein workspaceFilesdo |
318 | 324 | ifnot(updatedFiles.Contains(file))then |
319 | 325 | projectContext.RemoveSourceFile(file) |
320 | 326 | updated<-true |
321 | 327 |
|
322 | | -letupdatedRefs= site.AssemblyReferences()|>hashSetIgnoreCase |
323 | | -letworkspaceRefs= project.GetCurrentMetadataReferences()|> Seq.map(fun ref-> ref.FilePath)|>hashSetIgnoreCase |
| 328 | +letupdatedRefs= site.AssemblyReferences()|>wellFormedFilePathSetIgnoreCase |
| 329 | +letworkspaceRefs= project.GetCurrentMetadataReferences()|> Seq.map(fun ref-> ref.FilePath)|>wellFormedFilePathSetIgnoreCase |
324 | 330 |
|
325 | 331 | for refin updatedRefsdo |
326 | 332 | ifnot(workspaceRefs.Contains(ref))then |
327 | 333 | projectContext.AddMetadataReference(ref, MetadataReferenceProperties.Assembly) |
| 334 | + |
328 | 335 | for refin workspaceRefsdo |
329 | 336 | ifnot(updatedRefs.Contains(ref))then |
330 | 337 | projectContext.RemoveMetadataReference(ref) |
|