BUG: ServiceInstall uses wrong path when file has OriginalFilename property #7822
Unanswered
BryanCrotaz
asked this question in
Questions
Replies: 2 comments
-
I've read that this can happen when building instead of publishing, but I've instructed Wix to publish: <Project Sdk="WixToolset.Sdk/4.0.2" TreatWarningsAsErrors="true" Name="Agent">
<PropertyGroup>
<PreBuildEvent>
</PreBuildEvent>
</PropertyGroup>
<ItemGroup>
<ProjectReference
Include="..\AgentService\AgentService.csproj"
Publish="true"
/>
</ItemGroup>
</Project> <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
<Fragment>
<ComponentGroup Id="AgentServiceFiles" Directory="INSTALLFOLDER">
<Component Id="ServiceExe">
<File
BindPath="..\AgentService\bin\release\net7.0\publish\win-x64"
Source="AgentService.exe"/>
<ServiceInstall
Name="Agent"
DisplayName="Agent"
Type="ownProcess"
Start="auto"
ErrorControl="normal"
/>
<!-- <ServiceControl/> -->
</Component>
<Component Id="AppSettings">
<File
BindPath="..\AgentService\bin\release\net7.0\publish\win-x64"
Source="appsettings.json"/>
</Component>
</ComponentGroup>
</Fragment>
</Wix> |
Beta Was this translation helpful? Give feedback.
0 replies
-
Is this what I should be using to force the project to publish after build? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Trying posting bugs here, really not sure where I should be posting them now - please move to the correct issue/discussion/somewhere else as needed.
Something is wrong with my build, and my MyProject.exe has an
Original filename
property with a value of MyProject.dll.Edit: This is normal for a project built in .Net5+
That's not a problem because the file is written correctly to the bin folder with the correct extension, and runs quite happily.
However
<ServiceInstall/>
uses theOriginal filename
when registering the service instead of the actual filename on disk. So the service doesn't start up.Expected
ServiceInstall uses the file name
Actual
ServiceInstall uses the file's
Original filename
propertyBeta Was this translation helpful? Give feedback.
All reactions