Posts

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

VS 2019 is the last version of visual studio with load tests feature and coded UI tests feature

Image
Why Microsoft, why you do that, this is a beautiful piece of a tool that you are putting to waste. according to this . just open source it please, i mean look how good .NET Core is (in my own opinion)

S/MIME Certificate and GMail

So i was asked to have x.509 certificate for a client e-mail. that client happen to use Gmail, which do have a document on how to install that if you are using Gsuite. the problem is it's only enterprise version!, why for a simple feature like that i have to go enterprise level. i would say even free Gmail users should have the ability to use their own S/MIME Personal X.509 certificates to sign and encrypt e-mails.