Quantcast
Channel: Active questions tagged nuget-package - Stack Overflow
Viewing all articles
Browse latest Browse all 3067

How do you properly integrate a framework/boilerplate NuGet package into your web app in ASP.NET Core?

$
0
0

I have written a prototype RCL, which contains the following structure:

directory structure

Now I want to implement this logic to override the local files in an another web app, using this directory structure above as a framework, which overrides files.

For that I wrote the following .props file:

<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"><Target Name="CopyFiles" BeforeTargets="Build"><ItemGroup><File Include="$(MSBuildThisFileDirectory)..\Areas\**\*.*"></File><File Include="$(MSBuildThisFileDirectory)..\Areas\**\**\*.*"></File></ItemGroup><Exec Command="xcopy /I/e/d/s/y %(File.Identity) $(ProjectDir)Pages\Shared"></Exec></Target></Project>

.csproj has this appended:

<ItemGroup><None Include="Areas\**\*.*" Pack="true" PackagePath="Areas"></None><None Include="Areas\**\**\*.*" Pack="true" PackagePath="Areas"></None><None Include="build\libnamehere.props" Pack="true" PackagePath="build"></None></ItemGroup>

But this appears to only copy the .cshtml.cs files, which is not good enough...

  • How do I copy the .cshtml files as well?

  • Is there a better method to use the _Layout.cshtml from the RCL?

I am using ASP.NET Core 6 (.NET 6) if that matters.


Viewing all articles
Browse latest Browse all 3067

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>