Posts

how to copy NuGet packages from one project to another

You probably faced that problem at least once, here you are working on your modules trying to build a new model for your solution, create a new dll project and ... here it comes, NuGet packages, you need to have manually install all these NuGet packages that you know form the base of needed libraries for your new module or plug-in, and you need to get every package plus the versions right. If you are like me this would be a soul crushing task to do, so in order for me to be more "efficient" i searched for a way to copy that to the new project, at first i thought well that is easy, just copy "package.json" file, right? , wrong see for some reason this didn't work for me, i was not able to simply do this and restore packages, things went crazy and it seems it's like taking forever! so i have to come up with something even more "efficient" so here you go, hope this save you sometime and but smile on your face just execute below on Visual Studio...

Microsoft TechNet Gallery is going away

Image
so Microsoft is retiring TechNet Gallery where i proudly shared with the public two power shell scripts i have written and where downloaded almost a thousand time through this. so i had to move these somewhere else and re-share them with the world. check them out at https://dev.azure.com/platworx/public-powershell/ , i did a couple of small utilties in my life that i am i am proud of, this is one of them.

How to exclude files with specific extension from your web deploy package

i had to re-visit the topic of Web Deploy Package and how to exclude specific files from your package. and sometimes you get even better results then second round you check how to do something. and if you re like me "Mr. i did it before but now i have no idea how" you will get that chance a lot! actually this is one of the main reasons i started this blog, it's kind of my personal information technology, development and DevOps notes that i share with the world. so i wanted to remove all debug (*.pdb), all dll.config and all xml files from my package bin folder. first i found some search results that mention using "ExcludeFilesFromDeployment" tag in your pubxml publish profile file, but examples was to remove a single file by name, or even a multiple by using ; as a delimiter. then i though, what if i tried some common wild card patterns in there. so i came up with this under the "Project" tag <ExcludeFilesFromDeployment>bin\**\*.pdb;...

Pass empty model to razor view

i needed to pass empty instance for a model i have to my razor view so Vue (as my client side) can use it, as i was avoiding re-type the whole model again. usually when you pass you model with values in ViewBag if you use @Html.Raw(ViewBag.ModelClass) Copy to Clipboard you get Json, but to my surprise that is not the case if it's just an empty no values instance, in that case this code will return the object name! to solve this i added Json.Serialize to the mix, so @Html.Raw(Json.Serialize(ViewBag.ModelClass)) Copy to Clipboard will return an empty value json representing the model empty instance.

add extra files on deploy ASP Core web app using publish profile

So i have been struggling with this for a while now. i used to be able to add file to my ASP .NET projects through publish profiles using the following customization <!--Cutome entry to include custom DLLs--> <target name="CollectHelpers"> <itemgroup> <_customfiles include="$(MSBuildProjectDirectory)\bin\Custom*.dll"> <filesforpackagingfromproject include="%(_CustomFiles.Identity)"> <destinationrelativepath>bin\%(RecursiveDir)%(Filename)%(Extension)</DestinationRelativePath> </filesforpackagingfromproject> </_customfiles> </target> <target name="CollectCustomizations"> <itemgroup> <_customfiles include="$(MSBuildProjectDirectory)\bin\*Custom*.dll"> <filesforpackagingfromproject include="%(_CustomFiles.Identity)"> <destinationrelativepath>bin\%(RecursiveDir)%(Filename)%(Extensio...

.NET Core stdoutLog in web.config

So i am hosting my project  https://www.worknxt.com at host site which uses plesk, that dosen't give you broad access to logs which you need to look at spicealy if you .NET Core website which was working fine on your laptop 😀, now is not working at all on host! but thanks to stdoutLog that you can find in web.config you can have some idea on why your web app fail to start, the problem is even after setting this to true i didn't find any log created 😢 as always the problem came from my own expectations about how things should work, see the entry by default have a path of \logs\stdoutLog and i though well fine if .NET Core didn't find the folder it would create it, WRONG! see once i created the folder i got that stdoutLog and realized i was missing a DLL, now everything works just fine 😉

Historical name servers records

I recently bought a domain and used various free appraisal services to evaluate the domain name. To my surprise one of these services indicated the name have MOZ rank! So i thought this name must has been used/bought before. But how to verify that? A quick google search and i found this https://whoisrequest.com/history/ And i was right this domain name and actually another couple i own where created and dropped way back. Lucky me