https://discord.umbraco.com logo
Anybody face issues in deploying App_
# package-development
v
Anybody face issues in deploying App_Plugins folder with contents from a nuget package to a Umbraco solution?
m
Are you using the umbraco RCL template? (or lottie's opinionated package starter) And are we talking staticWebAssets (html/js/css) or RCL views (cshtml) ??
v
Hi Mike, this is an internal package that we built that I'm trying to install in an Umbraco site like a clean starter kit. Not using static web assets.
Installing the nuget does not create the App_Plugins/packagename/... assets in the project I'm installing too.
When I open the built package in dotPeek I can see that it has all the assets
m
does dotpeek do the same as nugetpackage explorer?
v
Have not tried the nuget package explorer
Is that a testing tool?
think it's also the build/{package}.targets file that has the copy what files where...
v
I've got a targets file in a folder called buildTransitive
m
just exactly what it says on the tin.. a package explorer to interogate the package.nuget file you've generated.
v
Been trying all kinds of things with the targets file and csproj file to try to get it to create this folder and assets. Just not happening
m
hmm.. I have a
<Copy Condition="!Exists('$(MSBuildProjectDirectory)\App_Plugins\%(RecursiveDir)%(Filename)%(Extension)')" SourceFiles="@(SourcePluginsFiles)" DestinationFiles="$(MSBuildProjectDirectory)\App_Plugins\%(RecursiveDir)%(Filename)%(Extension)" />
in my build tagets. with
<SourcePluginsFiles Include="$(MSBuildThisFileDirectory)..\content\any\any\App_Plugins\**\*.*" />
though you prob wouldn't want the condition. (this was a specifc requirement for one time delivery of the assets)
v
Is your package in Github?
m
sorry no.. commercial
l
You don't need a build transitive when it's an RCL () If it's a package, I always put the App_Plugins in wwwroot, so: wwwroot/App_Plugins. wwwroot is always going to end up i n the package. And in the project file I always put these two parameters: . / Just to put the App_Plugins in the root of the package. That works all the time for me. If you keep having issues, you might want to open a topic on the forum πŸ™‚
m
@Luuk Peters (Proud Nerds) don't think this is RCL + staticWebAssets.. πŸ˜‰
Hi Mike, this is an internal package that we built that I'm trying to install in an Umbraco site like a clean starter kit. Not using static web assets.
l
Well if you are messing with an App_Plugins folder and a buildTransitive file, you are messing with static assets....right? That you can fix by using a Razor Class Library πŸ˜„
b
@Luuk Peters (Proud Nerds) build transitive behaves weird on linux, so it might be related to using it on linux ;P (i had to do conditional paths to make it work on both OSes lol πŸ™‚ )
l
Hehe true! But that's why RCL's are grreat! Getting rid of those horrible manual copy actions
b
yep rcl solves that, and i advocated it in every team which i worked with, as it is almost 0 effort big impact thing πŸ˜„
m
I'm guessing removing Tech Debt isn't an option for @Vivek Ayer at this point. ⏲️
b
@Mike Chambers i mean that takes 10 minute to switch, but yeah it require some testing afterwards, so it depends on Viveks time line πŸ™‚
m
RCL does bring it's own problems like having to have your cshtml files available as defaults for override (like UForms) somewhere/somehow... Still not quite worked out a best solution for that.
b
if you specify them in RCL, you dont need them in project and you can override them in project, there other issues, but yeah generally you can create Views path in RCl and it will work fine, as long you add IViewLocationExpander πŸ˜› but yeah that's fun part to figure out how to do it ;p
m
you can override in the project.. but how do you know what the original code was to inform your override? πŸ™‚
l
Documentation.....?"πŸ₯΅
m
Exactly that's the RCL overhead mentioned... for having these hidden views.. And on upgrade of the package, end user must revisit all the overrides still match... Not saying that I don't endorse RCL.. just sometimes think hmmmm..
l
But if you copy the files over to the target project and someone alters the file and you have an update of your package, what then?
On publish the files are actually copied over by the way. In development, it just reads the file from the NuGet folder.
m
this is all part of the hmmm moments with RCL's πŸ™‚ But also not suggesting that you do just stick the files into the same location.. team discussions had around well we'll copy out to a slightly different location, so then you have the rcl source in the project (correct versions) for the end user, but override still works.. vs documentation, or separate download available....... which was where I started with RCL have foibles and not sure what is best for all parties. and also there are two different mechanisms in place.. staticwebassets, yes on publish do appear in the wwwroot folder, but don't have override.. razor views cshtml don't appear as files on publish, but can be overriden if placeing in the same filelocation..
v
Thanks guys for all the contributions. I did try RCL way but could not get it to work. I have a lang/*.xml resource files that apparently cannot be part of static web assets and have to copied over. So reverted back to the .targets thing of just copying files under App_Plugins/PackageName
p
@User May I suggest β€œall” instead of "guys"? We use gender inclusive language in this Discord πŸ˜€ ([read more](https://skrift.io/issues/happy-new-year-umbracians-let-s-start-our-conversations-friendly/))
l
I dunno, I really doubt you need it because so far I've never EVER needed to have a targets file since switching over to RCLs. Doesn't mean I'm right ofcourse, but I'm pretty sure I have packges with language files that don't need the targets file.
v
I think clearing nuget cache resolved the issue! Doing more testing...
11 Views