You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the Picture Fixer sample app there's some custom logic to handle a .razor.js file as a static web asset which appear to be broken now with .NET 6 Preview 7. A .NET 6 Preview 7 version of Picture Fixer can be found here: https://github.com/danroth27/PictureFixer/tree/net6p7.
Here's the custom logic:
<ItemGroup>
<!-- Make any .js files in Pages or Shared available as static content -->
<JavaScriptModulesInclude="Pages\**\*.js; Shared\**\*.js"RelativePath="%(Identity)" />
<StaticWebAssetInclude="@(JavaScriptModules->'%(FullPath)')"SourceType=""SourceId="$(PackageId)"RelativePath="%(RelativePath)"BasePath="$(StaticWebAssetBasePath)"ContentRoot="$(MSBuildProjectDirectory)" />
</ItemGroup>
System.InvalidOperationException: Unknown source type '' for 'C:\Users\daroth\Documents\GitHub\SteveSandersonMS\PictureFixer\PictureFixer\Client\Pages\Editor\EditImage.razor.js'.
at Microsoft.AspNetCore.Razor.Tasks.StaticWebAsset.Validate()
at Microsoft.AspNetCore.Razor.Tasks.StaticWebAsset.FromTaskItem(ITaskItem item)
at System.Linq.Enumerable.ToDictionary[TSource,TKey,TElement](IEnumerable`1 source, Func`2 keySelector, Func`2 elementSelector, IEqualityComparer`1 comparer)
at Microsoft.AspNetCore.Razor.Tasks.ComputeReferencedProjectAssets.Execute()
PictureFixer.Client C:\Program Files\dotnet\sdk\6.0.100-preview.7.21369.19\Sdks\Microsoft.NET.Sdk.Razor\build\netstandard2.0\Microsoft.NET.Sdk.Razor.StaticWebAssets.targets 668
@javiercn Can you confirm whether this breaking change is intentional?
The text was updated successfully, but these errors were encountered:
It's not normal that folks define assets this way, this fails here because of how it was defined. We already upgrade existing V1 assets in packages; I don't mind if we upgrade existing asset definitions in the csproj files, but I would prefer if we give you instructions on how to update them to slowly phase out the old format/metadata.
As I mentioned, its not a common operation to do this here and it can be solved quickly.
I tried setting SourceType to Discovered and then I hit this error:
System.InvalidOperationException: The 'OriginalItemSpec' for the asset must be defined for 'C:\Users\daroth\Documents\GitHub\SteveSandersonMS\PictureFixer\PictureFixer\Client\Pages\Editor\EditImage.razor.js'.
at Microsoft.AspNetCore.Razor.Tasks.StaticWebAsset.Validate()
at Microsoft.AspNetCore.Razor.Tasks.StaticWebAsset.FromTaskItem(ITaskItem item)
at System.Linq.Enumerable.ToDictionary[TSource,TKey,TElement](IEnumerable`1 source, Func`2 keySelector, Func`2 elementSelector, IEqualityComparer`1 comparer)
at Microsoft.AspNetCore.Razor.Tasks.ComputeReferencedProjectAssets.Execute()
PictureFixer.Client C:\Program Files\dotnet\sdk\6.0.100-preview.7.21369.19\Sdks\Microsoft.NET.Sdk.Razor\build\netstandard2.0\Microsoft.NET.Sdk.Razor.StaticWebAssets.targets 668
In the Picture Fixer sample app there's some custom logic to handle a .razor.js file as a static web asset which appear to be broken now with .NET 6 Preview 7. A .NET 6 Preview 7 version of Picture Fixer can be found here: https://github.com/danroth27/PictureFixer/tree/net6p7.
Here's the custom logic:
@javiercn Can you confirm whether this breaking change is intentional?
The text was updated successfully, but these errors were encountered: