shaigem / BlazorPanzoom

Blazor wrapper for timmywil's panzoom library that helps make zooming and panning of Blazor components and elements easier
https://shaigem.github.io/BlazorPanzoom/
MIT License
44 stars 12 forks source link

Issue when publishing #9

Closed SkinnySackboy closed 2 years ago

SkinnySackboy commented 2 years ago

Hi,

We are using this library (works great!) but have come across an issue when we publish our application (Blazor server). As soon as we run dotnet publish, we are shown the following error:

C:\Program Files\dotnet\sdk\5.0.203\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Publish.targets(238,5): error MSB3030: Could not copy the file "C:\Users\autobuilder\.nuget\packages\blazorpanzoom\0.2.0\staticwebassets\panzoom-4.4.1.min.js" because it was not found.

When we compile and run normally it works, this is only an issue while publishing but I cannot see anywhere that we have referenced this particular *.js file. Is this something we're doing incorrectly?

Thanks in advance!

SkinnySackboy commented 2 years ago

Further to my previous message, these are the steps to reproduce this problem:

  1. Create a server-side Blazor application (I called mine BlazorPanZoomPublishIssue)
  2. Add a reference to BlazorPanzoom (I'm using the latest version, 0.2.0)
  3. Add a publish profile (I tried a few and they all failed, but you can test it with the default Folder profile in the Publish menu wizard)

At this stage, you can compile/run etc. and it all works fine, whether or not any code uses BlazorPanzoom.

The problem arises when you execute the following publish command:

$ dotnet publish BlazorPanZoomPublishIssue.sln --configuration Release -p:PublishProfile=Profile.pubxml
Microsoft (R) Build Engine version 16.10.1+2fd48ab73 for .NET
Copyright (C) Microsoft Corporation. All rights reserved.

  Determining projects to restore...
  All projects are up-to-date for restore.
  BlazorPanZoomPublishIssue -> C:\Users\username\source\repos\BlazorPanZoomPublishIssue\BlazorPanZoomPublishIssue\bin\Release\net5.0\BlazorPanZoomPublishIssue.dll
  BlazorPanZoomPublishIssue -> C:\Users\username\source\repos\BlazorPanZoomPublishIssue\BlazorPanZoomPublishIssue\bin\Release\net5.0\BlazorPanZoomPublishIssue.Views.dll
C:\Program Files\dotnet\sdk\5.0.301\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Publish.targets(238,5): error MSB3030: Could not copy the file "C:\Users\username\.nuget\packages\blazorpanzoom\0.2.0\staticwebassets\panzoom-4.4.1.min.js" because it was not found. [C:\Users\username\source\repos\BlazorPanZoomPublishIssue\BlazorPanZoomPublishIssue\BlazorPanZoomPublishIssue.csproj]

It's not clear to me where this is coming from. Is someone able to assist us with this please, as we would very much like to continue using this library but are currently blocked from being able to publish and therefore release? Currently it seems as though the published nuget package is missing the file panzoom-4.4.1.min.js under the staticwebassets directory.

shaigem commented 2 years ago

Sorry about the problem! The issue should be fixed in version 0.2.1 on nuget.

For some reason, the nuget package was still referencing the old panzoom-4.4.1.min.js.

Let me know if it fixes the issue for you.

SkinnySackboy commented 2 years ago

Many thanks for the quick fix @shaigem it works now, cheers!