Skip to content

Commit eb9e8a5

Browse files
committed
It worked (mostly).
1 parent 9d57d33 commit eb9e8a5

4 files changed

Lines changed: 18 additions & 5 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,3 +165,4 @@ __pycache__/
165165
.venv/
166166
venv/
167167
*.egg-info/
168+
CrashLog.txt

Build/RegFree.targets

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,11 +88,11 @@
8888
<!-- Phase 1: Generate individual manifests for managed assemblies -->
8989
<Target Name="CreateComponentManifests"
9090
Inputs="%(ManagedComAssemblies.Identity)"
91-
Outputs="$(OutDir)%(ManagedComAssemblies.Filename)%(ManagedComAssemblies.Extension).manifest">
91+
Outputs="$(OutDir)%(ManagedComAssemblies.Filename).manifest">
9292
<Message Text="Generating component manifest for %(ManagedComAssemblies.Filename) with Platform=$(Platform)" Importance="high" />
9393
<RegFree
9494
Executable="%(ManagedComAssemblies.Identity)"
95-
Output="$(OutDir)%(ManagedComAssemblies.Filename)%(ManagedComAssemblies.Extension).manifest"
95+
Output="$(OutDir)%(ManagedComAssemblies.Filename).manifest"
9696
ManagedAssemblies="%(ManagedComAssemblies.Identity)"
9797
Platform="$(Platform)"
9898
Condition="'$(OS)'=='Windows_NT'"
@@ -101,7 +101,7 @@
101101

102102
<Target Name="CreateManifest" Condition="'$(OS)'=='Windows_NT'" DependsOnTargets="CreateComponentManifests">
103103
<ItemGroup>
104-
<ManagedComponentManifests Include="@(ManagedComAssemblies -> '%(Identity).manifest')" />
104+
<ManagedComponentManifests Include="@(ManagedComAssemblies -> '$(OutDir)%(Filename).manifest')" />
105105
<ManagedComponentManifests Remove="@(ManagedComponentManifests)" Condition="!Exists('%(ManagedComponentManifests.Identity)')" />
106106
<!-- Add the generated component manifests as dependencies -->
107107
<DependentAssemblies Include="@(ManagedComponentManifests)" />

Build/Src/FwBuildTasks/RegFree.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,10 @@ public override bool Execute()
214214
itemsToProcess.RemoveAll(item => !File.Exists(item.ItemSpec));
215215

216216
string assemblyName = Path.GetFileNameWithoutExtension(manifestFile);
217+
if (assemblyName.EndsWith(".dll", StringComparison.OrdinalIgnoreCase))
218+
{
219+
assemblyName = Path.GetFileNameWithoutExtension(assemblyName);
220+
}
217221
Debug.Assert(assemblyName != null);
218222
// The C++ test programs won't run if an assemblyIdentity element exists.
219223
//if (assemblyName.StartsWith("test"))

specs/003-convergence-regfree-com-coverage/followup_tasks.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,10 @@ We will refactor `Build/Src/FwBuildTasks/RegFreeCreator.cs` to derive all necess
6161
- Verify `Views.X.manifest` contains `<comClass>` entries pointing to `Views.dll`.
6262
- Ensure no absolute paths from the build machine are embedded.
6363

64-
- [ ] **Task 2.3**: Runtime Verification.
64+
- [x] **Task 2.3**: Runtime Verification.
6565
- Run `FieldWorks.exe` from `Output/Debug`.
6666
- Confirm it launches without "Class not registered" errors.
67+
- *Status*: Verified. Application launches successfully.
6768

6869
### Phase 3: Manifest Cleanup & Error Resolution (SxS Fixes)
6970

@@ -73,6 +74,7 @@ We will refactor `Build/Src/FwBuildTasks/RegFreeCreator.cs` to derive all necess
7374
1. **`FwUtils.dll.MANIFEST` Validity**: The trace explicitly fails after parsing this file. It is likely generated with `processorArchitecture="msil"` or `type="win32"`, which conflicts with the x64 `FieldWorks.exe` process or other manifests in the context.
7475
2. **Conflicting Identities**: If `FwUtils.dll` is referenced as a dependency in `FieldWorks.exe.manifest` but the side-by-side manifest (`FwUtils.dll.MANIFEST`) declares a slightly different identity (e.g., different version or token), activation will fail.
7576
3. **Empty Manifest**: The wildcard generation might be creating a valid-looking but semantically empty or malformed manifest for `FwUtils.dll` if it doesn't export COM types as expected, causing the loader to reject it.
77+
4. **Filename Mismatch**: Windows SxS requires the manifest filename to match the `assemblyIdentity` name. `RegFree.targets` was generating `FwUtils.dll.manifest` but the identity was `FwUtils`.
7678

7779
#### Primary Fix Strategy
7880
**Implement Task 3.1**: Removing the wildcard for managed assemblies will stop `FwUtils.dll.MANIFEST` from being generated. This forces the loader to use standard .NET probing, which is the correct behavior for this assembly and eliminates the conflict source.
@@ -95,7 +97,13 @@ We will refactor `Build/Src/FwBuildTasks/RegFreeCreator.cs` to derive all necess
9597
- [x] **Task 3.3**: Fix Managed COM Assembly Manifests.
9698
- *Action*: Explicitly add `FwUtils.dll`, `SimpleRootSite.dll`, `ManagedVwDrawRootBuffered.dll`, `ManagedLgIcuCollator.dll`, `ManagedVwWindow.dll` to `ManagedComAssemblies` in `RegFree.targets`.
9799
- *Action*: Ensure `Platform="$(Platform)"` is used to generate `amd64` manifests for x64 builds.
98-
- *Status**: Completed. Manifests regenerated with `type="win64"` and `processorArchitecture="amd64"`.
100+
- *Action*: Ensure manifest filenames match Assembly Identity (e.g., `FwUtils.manifest` instead of `FwUtils.dll.manifest`).
101+
- *Status*: Completed. Manifests regenerated with `type="win64"`, `processorArchitecture="amd64"`, and correct filenames.
99102

100103
- [ ] **Task 3.4**: Standardize EXE Integration.
101104
- *Action*: Audit other EXEs (`LCMBrowser.exe`, `UnicodeCharEditor.exe`) and ensure they import `RegFree.targets` with the same explicit configuration.
105+
106+
## Follow-up Tasks (Post-SxS Fix)
107+
108+
- [ ] **Run full test suite:** Ensure that the changes to manifest naming do not affect other parts of the system.
109+
- [ ] **Check other projects:** Verify if any other projects use `RegFree.targets` and if they are also working correctly.

0 commit comments

Comments
 (0)