Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Topshelf debug issue #1830

Closed
tigerclawn82 opened this issue Jul 22, 2016 · 27 comments
Closed

Topshelf debug issue #1830

tigerclawn82 opened this issue Jul 22, 2016 · 27 comments
Labels

Comments

@tigerclawn82
Copy link

Description

Installed Topshelf pinned to specific version via Paket having project based paket.references and i was not able to install/debug but able to build successfully.

Repro steps

  1. Add nuget Topshelf == 3.3.1 in paket.dependencies
  2. Add Topshelf in xxx.vbproj.paket.references

Expected behavior

Package should be added as reference and should be able run as normal as if i added via Nuget

Actual behavior

Package was added as dependency but was not able to debug, i added via nuget and then was able to Debug as usual.

Known workarounds

Add topshelf via Nuget and everything should work as expected.

Related information

  • Window Server 2008 R2
  • Latest/Stable
  • .NET Runtime
@forki
Copy link
Member

forki commented Jul 23, 2016

What is the difference in the vbproj?
Can you create a minimal repro? Any ideas what's going wrong?

On Jul 22, 2016 9:35 PM, "Waqas Ahmed" [email protected] wrote:

Description

Installed Topshelf pinned to specific version via Paket having project
based paket.references and i was not able to install/debug but able to
build successfully.
Repro steps

Add nuget Topshelf == 3.3.1 in paket.dependencies
2.

Add Topshelf in xxx.vbproj.paket.references

Expected behavior

Package should be added as reference and should be able run as normal as
if i added via Nuget
Actual behavior

Package was added as dependency but was not able to debug, i added via
nuget and then was able to Debug as usual.
Known workarounds

Add topshelf via Nuget and everything should work as expected.
Related information

  • Window Server 2008 R2
  • Latest/Stable
  • .NET Runtime


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#1830, or mute the thread
https://github.com/notifications/unsubscribe-auth/AADgNE4FqrmOReka6R4tyBWWmramKNm_ks5qYRuGgaJpZM4JTEGO
.

@smoothdeveloper
Copy link
Contributor

Add Topshelf in xxx.vbproj.paket.references

Could you make sure that the file name is just paket.references and sits next to .vbproj file?

@smoothdeveloper
Copy link
Contributor

Mhh scratch that, you are able to compile.

Could you check the diff of vbproj file when you use nuget and paket, maybe topshelf has some special target which aren't caught by paket for some reason.

@tigerclawn82
Copy link
Author

Hi, i am attaching project file created with Paket and Nuget.

Paket-Issue.zip

Hopefully it would help

@smoothdeveloper
Copy link
Contributor

@tigerclawn82 is there anything under packages\Topshelf in your working copy?

@smoothdeveloper
Copy link
Contributor

@forki that is how paket reference the package:

  <Choose>
    <When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And ($(TargetFrameworkVersion) == 'v3.5' Or $(TargetFrameworkVersion) == 'v4.0')">
      <ItemGroup>
        <Reference Include="Topshelf">
          <HintPath>..\packages\Topshelf\lib\net35\Topshelf.dll</HintPath>
          <Private>True</Private>
          <Paket>True</Paket>
        </Reference>
      </ItemGroup>
    </When>
    <When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And ($(TargetFrameworkVersion) == 'v4.0' Or $(TargetFrameworkVersion) == 'v4.5' Or $(TargetFrameworkVersion) == 'v4.5.1' Or $(TargetFrameworkVersion) == 'v4.5.2' Or $(TargetFrameworkVersion) == 'v4.5.3' Or $(TargetFrameworkVersion) == 'v4.6' Or $(TargetFrameworkVersion) == 'v4.6.1' Or $(TargetFrameworkVersion) == 'v4.6.2' Or $(TargetFrameworkVersion) == 'v4.6.3')">
      <ItemGroup>
        <Reference Include="Topshelf">
          <HintPath>..\packages\Topshelf\lib\net40-full\Topshelf.dll</HintPath>
          <Private>True</Private>
          <Paket>True</Paket>
        </Reference>
      </ItemGroup>
    </When>
  </Choose>

it is strange that framework 4.0 seems to overlap both net-35 and >= 4 conditions.

nuget

    <Reference Include="Topshelf, Version=3.3.154.0, Culture=neutral, PublicKeyToken=b800c4cfcdeea87b, processorArchitecture=MSIL">
      <HintPath>..\packages\Topshelf.3.3.1\lib\net40-full\Topshelf.dll</HintPath>
      <Private>True</Private>
    </Reference>

@tigerclawn82
Copy link
Author

Yes, i do have Topshelf in packages, here is the screenshot

packages-topshelf

@smoothdeveloper
Copy link
Contributor

@tigerclawn82 for now I think if you add framework: >= net40 it would work around the issue (hopefully you don't need support for 3.5)

@smoothdeveloper
Copy link
Contributor

(in paket.depedencies)

@matthid
Copy link
Member

matthid commented Jul 25, 2016

This looks like the net40-client and net40 quirk :)

@tigerclawn82
Copy link
Author

adding framework: >= net40 in paket.depedencies didn't help. I guess, i should stick with nuget reference untill i didn't get any work around. I am using Paket with FAKE to streamline CI/CD and i wanted to only use Paket.

It would really appreciate to get any workaround to only stick with paket

@tigerclawn82
Copy link
Author

i am targetting .net40 but topshelf is available for .net35

@smoothdeveloper
Copy link
Contributor

@tigerclawn82 did you run paket install after changin paket.dependencies?

Another work around would be to remove Topshelf from paket.references and add the assembly manually to your project, this should work flawlessly, even if you upgrade topshelf in future.

@forki
Copy link
Member

forki commented Jul 25, 2016

Will take a look at the repro tomorrow

On Jul 25, 2016 6:25 PM, "Gauthier Segay" [email protected] wrote:

@tigerclawn82 https://github.com/tigerclawn82 did you run paket install
after changin paket.dependencies?

Another work around would be to remove Topshelf from paket.references and
add the assembly manually to your project, this should work flawlessly,
even if you upgrade topshelf in future.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#1830 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AADgNKlnYatjZkMzryeAYZU8qku1DNu1ks5qZOOGgaJpZM4JTEGO
.

@forki
Copy link
Member

forki commented Jul 26, 2016

from what I can see the referenced topshelf looked good.
TBH we never had issues with the topshelf package together with paket.

I think what I need is a real repro sample. Can you please attach a zipped full solution that uses paket and doesn't work. Also please describe what you do to debug. I think I need very detailed steps here since currently I can't see any issue.

@tigerclawn82
Copy link
Author

It just doesn't work. I tried adding manual reference from net35 after suggestion from @smoothdeveloper but it didn't work and i have to add reference from net40-full then it worked. I am attaching sample solution, hopefully it will help.
TopshelfService.zip

Thanks

@forki
Copy link
Member

forki commented Jul 26, 2016

<When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And $(TargetFrameworkVersion) == 'v4.0'">
  <ItemGroup>
    <Reference Include="Topshelf">
      <HintPath>..\packages\Topshelf\lib\net35\Topshelf.dll</HintPath>
      <Private>True</Private>
      <Paket>True</Paket>
    </Reference>
  </ItemGroup>
</When>
<When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And ($(TargetFrameworkVersion) == 'v4.0' Or $(TargetFrameworkVersion) == 'v4.5' Or $(TargetFrameworkVersion) == 'v4.5.1' Or $(TargetFrameworkVersion) == 'v4.5.2' Or $(TargetFrameworkVersion) == 'v4.5.3' Or $(TargetFrameworkVersion) == 'v4.6' Or $(TargetFrameworkVersion) == 'v4.6.1' Or $(TargetFrameworkVersion) == 'v4.6.2' Or $(TargetFrameworkVersion) == 'v4.6.3')">
  <ItemGroup>
    <Reference Include="Topshelf">
      <HintPath>..\packages\Topshelf\lib\net40-full\Topshelf.dll</HintPath>
      <Private>True</Private>
      <Paket>True</Paket>
    </Reference>
  </ItemGroup>
</When>

I think I found something strange. Can you please go to line 57 in TopshelfService.csproj and try to change

 <When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And $(TargetFrameworkVersion) == 'v4.0'">

to

<When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' >

does this solve the issue?

It looks like $(TargetFrameworkVersion) == 'v4.0'" gets emitted twice.

@forki
Copy link
Member

forki commented Jul 26, 2016

oups. I meant change that line to

 <When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And $(TargetFrameworkVersion) == 'v3.5'">

@forki forki added the bug label Jul 26, 2016
@forki
Copy link
Member

forki commented Jul 26, 2016

I think I found the bug. working on a fix

@tigerclawn82
Copy link
Author

thanks @forki
I really appreciate you guys quick responses, you guys are a really vibrant community.

@forki
Copy link
Member

forki commented Jul 26, 2016

fix is underway. will take about 15min to pass all integration tests.

@forki forki closed this as completed in 08480c3 Jul 26, 2016
@forki
Copy link
Member

forki commented Jul 26, 2016

please retry with latest and let me know if things work

@tigerclawn82
Copy link
Author

yeah, thanks. Its working fine now. I really appreciate your help.

@forki
Copy link
Member

forki commented Jul 27, 2016

Unfortunately I introduced a new bug. This is now fixed, but can you please verify that 3.9.6 still works for you?

@tigerclawn82
Copy link
Author

yeah, v3.9.6 is also working fine.
Thanks

@wahmedswl
Copy link

Hi, got bitten by this. I have targetted .net framework 4 in Project. I had framework: >= net40 in paket.dependencies but now i changed that to framework: net40.

Now, Topshelf references are again messed up. Before i had following in csproject

<Choose>
    <When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And ($(TargetFrameworkVersion) == 'v4.0' And $(TargetFrameworkProfile) == 'Client')">
      <ItemGroup>
        <Reference Include="Topshelf">
          <HintPath>..\packages\Topshelf\lib\net35\Topshelf.dll</HintPath>
          <Private>True</Private>
          <Paket>True</Paket>
        </Reference>
      </ItemGroup>
    </When>
    <When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And ($(TargetFrameworkVersion) == 'v4.0' Or $(TargetFrameworkVersion) == 'v4.5' Or $(TargetFrameworkVersion) == 'v4.5.1' Or $(TargetFrameworkVersion) == 'v4.5.2' Or $(TargetFrameworkVersion) == 'v4.5.3' Or $(TargetFrameworkVersion) == 'v4.6' Or $(TargetFrameworkVersion) == 'v4.6.1' Or $(TargetFrameworkVersion) == 'v4.6.2' Or $(TargetFrameworkVersion) == 'v4.6.3')">
      <ItemGroup>
        <Reference Include="Topshelf">
          <HintPath>..\packages\Topshelf\lib\net40-full\Topshelf.dll</HintPath>
          <Private>True</Private>
          <Paket>True</Paket>
        </Reference>
      </ItemGroup>
    </When>
  </Choose>

But now, its been changed to

<When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And $(TargetFrameworkVersion) == 'v4.0'">
      <ItemGroup>
        <Reference Include="Topshelf">
          <HintPath>..\packages\Topshelf\lib\net35\Topshelf.dll</HintPath>
          <Private>True</Private>
          <Paket>True</Paket>
        </Reference>
      </ItemGroup>
    </When>

Its not good, it should include net40-full\Topshelf.dll, as for framework: net40 both net35 and net40-full folders are available.

Thanks

@forki
Copy link
Member

forki commented Oct 4, 2016

please use net40-full in the deps file

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants