-
Visual Studio 2012
Where do I begin when your aging development environment starts to…. well… eat itself.
To be completely transparent, I’m not a big fan of using old dev environments to try to get production ready code up and running. Normally it’s not an issue, really. But, when one has folks mucking about with the domain and changing things that affect one’s working environment, there’s where the trouble starts.
My VS 2012 environment started to act up last week, and at some point I simply had to terminate VS. Ya, not the best way to go about matters, but what can one do? The trouble started not in killing the VS process, rather trying to get it to run again. As I started up a new VS 2012 in Admin mode and “BlamO” a non-responsive process. The damn thing just would not start up. CRAP! After switching into “SafeMode”, I find that my old domain profile file locations had been removed from the Domain (you know that “Documents” folder location “App Data” where hidden things related to VS lives?) Wonderful, now what?!
One might ask, well why not move on to VS 2015 or better yet VS 2017 (I really like 2017!). Well one has to understand our production level systems. In a word, or two – they are OLD! I have to use VS 2012 to create SSIS projects for our SQL 2012 servers. While one can certainly develop SSIS packages for SQL 2012 using VS 2015, one cannot create the Initial package using anything but VS 2012 (yeap, one of perpetual jokes about how some teams at MS don’t cross pollinate should be inserted at this point- I’m think the SQL team and the VS team should talk more).
Anyway, believing that there is solution- an odd fact about Moi- one finds these parameters for VS 2012
- /ResetUserData – (AFAICT) Removes all user settings and makes you set them again. This will get you the initial prompt for settings again, clear your recent project history, etc.
- /ResetSettings – Restores the IDE’s default settings, optionally resets to the specified VSSettings file.
- /ResetSkipPkgs – Clears all SkipLoading tags added to VSPackages.
- /ResetAddin – Removes commands and command UI associated with the specified Add-in
The important one here is /ResetUserData – Since I already know something is screwed up with my domain profile (as revealed via safemode), this is where we start. Upon executing DEVENV.exe /ResetUserData VS starts and gives me all kinds to popups about component this missing and error loading that- and I’m thinking ‘oh joy this thing is really mucked now’.
Patience….. after the dust settles… VS 2012 pops up into life, granted it’s missing some things on the start screen…. but it’s running! I quickly go into some settings to make sure I don’t run into some domain related problems. And now I’m back at the OLD 2012 dev environment.
Did I mention that I’m not really a big fan of using Old dev environments? 🙄
The last part on this fixing my broken VS 2012 was to do a repair- turns out there was also some corruption of some the basic VS components… which is odd based on the fact that VS 2012 was still functional mostly. I suspect there where some installed extensions that may have been at the root of the problems. This part only took about an hour.
~ScottGeek
-
ASP .NET Core – the new stuff
The latest read concerning ASP.Net Core 2.1
[visual-link-preview encoded=”eyJ0eXBlIjoiZXh0ZXJuYWwiLCJwb3N0IjowLCJwb3N0X2xhYmVsIjoiIiwidXJsIjoiaHR0cHM6Ly9tc2RuLm1pY3Jvc29mdC5jb20vZW4tdXMvbWFnYXppbmUvbXQ4Mjk3MDYiLCJpbWFnZV9pZCI6Njg3LCJpbWFnZV91cmwiOiJodHRwczovL3Njb3R0Z2Vlay50ZWNobm9sb2d5L3dwLWNvbnRlbnQvdXBsb2Fkcy8yMDE4LzA4L0lDODc5ODU5LmpwZyIsInRpdGxlIjoiQVNQLk5FVCBDb3JlIC0gV2hhdCdzIE5ldyBpbiBBU1AuTkVUIENvcmUgMi4xIiwic3VtbWFyeSI6Ik1pY3Jvc29mdCByZWNlbnRseSByZWxlYXNlZCBBU1AuTkVUIENvcmUgMi4xIGFsb25nIHdpdGggLk5FVCBDb3JlIDIuMSBhbmQgRW50aXR5IEZyYW1ld29yayAoRUYpIENvcmUgMi4xLiBDb21iaW5lZCwgdGhlc2UgcmVsZWFzZXMgb2ZmZXIgc29tZSBncmVhdCBpbXByb3ZlbWVudHMgaW4gcGVyZm9ybWFuY2UsIGFzIHdlbGwgYXMgYWRkaXRpb25hbCBmZWF0dXJlcyBmb3IgLk5FVCBDb3JlIGRldmVsb3BlcnMuIE1pY3Jvc29mdCBpcyBhbHNvIG9mZmVyaW5nIExvbmctVGVybSBTdXBwb3J0IChMVFMpIHdpdGggdGhpcyByZWxlYXNlLCBtZWFuaW5nIGl0IHdpbGwgcmVtYWluIHN1cHBvcnRlZCBmb3IgdGhyZWUgeWVhcnMuIFRoaXMgYXJ0aWNsZSBwcm92aWRlcyBhbiBvdmVydmlldyBvZiB0aGUgaW1wcm92ZW1lbnRzIGluIEFTUC5ORVQgQ29yZSAyLjEuIFRvIGxlYXJuIG1vcmUgYWJvdXQgd2hhdOKAmXMgbmV3IGluIEVGIENvcmUgMi4xLCBjaGVjayBvdXQgdGhpcyBtb250aOKAmXMgRGF0YSBQb2ludHMgY29sdW1uIGJ5IEp1bGllIExlcm1hbiwg4oCcRGVlcCBEaXZlIGludG8gRUYgQ29yZSBIYXNEYXRhIFNlZWRpbmfigJ0gYW5kIGhlciBjb2x1bW4gbGFzdCBtb250aCAobXNkbi5jb20vbWFnYXppbmUvbXQ4NDcxODQpIHRoYXQgIGRlbHZlcyBpbnRvIHRoZSBuZXcgRUYgQ29yZSAyLjEgUXVlcnkgVHlwZSBmZWF0dXJlLCB3aGljaCBsZXRzIHlvdSBtb3JlIGVhc2lseSBxdWVyeSBhIGRhdGFiYXNlIHdpdGhvdXQgbmVlZGluZyB0cnVlIGVudGl0aWVzIHdpdGgga2V5IHByb3BlcnRpZXMgdG8gY29uc3VtZSB0aGUgcmVzdWx0cy4iLCJ0ZW1wbGF0ZSI6ImRlZmF1bHQifQ==”]
-
Blazor and EF Core to Nowhere land.
In the long decent into “Experimental” frameworks- this one being Blazor, I’ve been finding some challenges with getting Blazor to work with the latest EF Core. There’s a few examples of Blazor being used with EF Core (i.e. the CRUD example that’s floating around the inter-Tubes), but nothing that seems to work with the latest Blazor Lang template in the latest VS release.
One can go to a lower EF Core version, well mostly… I’ve yet to get my Blazor Hosted Core test app to compile…. let alone the DB-Context to Scaffold… it just spews errors no matter which direction I go in… Oh Bother….
I have to remember that Blazor is “Experimental” – But it would be nice if would keep up with the forward moving components like EF Core and the latest VS releases. I wonder what all of the Blazor Template releases are doing- seems like each time I run up VS there’s a new Blazor Lang Update. Curious…
-
Windows UI Library Preview released! – Windows Developer Blog
Windows UI Library Preview released! – Windows Developer Blog
Windows UI Library Preview released! – Windows Developer Blog
We’re excited to announce the first preview release of the Windows UI Library! The Windows UI Library (or WinUI for short) is a new way to get and use Fluent controls and styles for building Windows 10 UWP apps: via NuGet packages. The WinUI NuGet packages contain new and popular UWP XAML controls and features …
Source: blogs.windows.com
-
AS2 and the Mysterious Certificate
Before the knowledge gets left somewhere forgotten…
You will need makecert.exe (and place on a dev or tst where you can generate a cert with a private key) **The matter to remember here is that we will be using the logged user’s private Certificate store to actually generate the private key file.
So the mysterious Makecert:
makecert -r -pe -n “CN=<Your CN name or a full CN set of values>”
-b 07/13/2018 -e 07/13/2023 -len 2048 -eku 1.3.6.1.5.5.7.3.1
-ss my “<Name of CER file>.cer” -sr currentuser -sky exchange
-sp “Microsoft Enhanced RSA and AES Cryptographic Provider” -sy 24 -a “sha256” -nscp
The important parts:
-n ‘CN=<NAME THAT CERT>”
-b and -e are the start and expire dates
-len 2028 1 KB multiples of how long the key needs to be (not what type of key i.e. sha256, 512, etc)
-ss my “<Name of the cer file>” This is the actual cer file to share with the external- is has the public key. Do not share files with private keys!
When you execute this Markcert – you will get a <Name of cer file> in the local directory. (don’t panic, we’re not finished).
Next we run the mmc.exe:
Add/Remove Snap-in… (unless you saved a console, then just open it)
Add Certificates and select “My user account”:
“Finish” and “OK”
Look in the Personal/Certificates (note the name is the CN=value)
That’s the Server cert we just created… next we need to export to a Private PFX…
Right-Click cert… All Tasks… Export.
Make sure you select Yes, export the private key:
Next
Must have a password:
Next… pick a name for the pfx file
Next… Finish:
Now you have the two cert files:
The cer file is what is shared with externals. NEVER Share your pfx (private key file) and password with external folks!!
The pfx file is what you need to add to the Cert stores on your server than needs to encrypt or decrypt files
When importing the PFX make sure you select Personal Information Exchange and Not the cer file:
A new cert going into the Trusted Root Cert Authority will get this warning. This just means that you are about to trust the cert you just created. That’s normal for a seft-signed cert…
This is what a good cert should looks like:
Now for BizTalk AS2 to use these new Certs, you must install them in the
- Trusted Root Certification Authorities (this insures that the self-signed is trusted)
- Other People (this is where the Sent Port Certificate browse with look)
- Personal (this is imported that you use the AS2 Host ISO user account! Otherwise you will get a AS2 error about the cert cannot be found)
I think that the most of it…
~ScottGeek
-
.net Core 2.1 and SQL via EF Core 2.1 -The revisit
It’s time to revisit this topic but for the latest up dates for .Net Core (v 2.1.1) and EF Core (v 2.1)
Let’s start with the common project using, in my case, VS 2017 15.7.4. Start a .Net Project based on v 2.1.x (I currently have installed .Net Core SDK v 2.1.301
(Gee think we have enough versions of things 😯 )I’m doing a .Net Core Class so I can get my DBContext and Table models in place….
We start with some Packages:Microsoft.EntityFrameworkCore.SqlServer (2.1.1) Microsoft.EntityFrameworkCore.SqlServer.Design (1.1.5) Microsoft.EntityFrameworkCore.Tools (2.1.1)
Next, time for a database and let’s Scaffold a DB Context and our models… On the .Net Core project start up the Package Manager Console.
dotnet ef dbcontext scaffold "Server={ServerName};DataBase={DataBaseName};Integrated Security=True;Connect Timeout=30;Encrypt=False;TrustServerCertificate=True;ApplicationIntent=ReadWrite;MultiSubnetFailover=False" Microsoft.EntityFrameworkCore.SqlServer --output-dir Models --table {table1Name} --table {table1Name} --table {table1Name} .....
For Connection Strings to SQL with a user/pass, an example would be "Server={ServerName;DataBase={DataBaseName}g;Integrated Security=False; User ID={sql user};Password={sql user Pass}; Connect Timeout=30;Encrypt=False;TrustServerCertificate=True; ApplicationIntent=ReadWrite;MultiSubnetFailover=False"
The Walk-Through…
Line 1 – dotnet ef dbcontext scaffold This is the start of the command. As we see dotnet is the actual start of the SDK utility. It is worth looking this up. “ef dbcontext scaffold” is how we start the EF scaffold. Line 2 – The Connection String **1
“Server={ServerName};DataBase={DataBaseName};Integrated Security=True;Connect Timeout=30;Encrypt=False;TrustServerCertificate=True;ApplicationIntent=ReadWrite;MultiSubnetFailover=False”Line 3 – This is the provider used for MS SQL server. Yes it would be different if another database was being used. Line 4 – The –output param is giving us a way to make sure we put all models/dbcontext in a folder in the project. Line 5 – The –table allows one to generate models (and DbContext) for only certain tables in the DB. **1 This is the standard SQL connection string. This will take on various forms depending on what you are connecting to. And yes, one can use the localdb.
-
ASP.Net Core Identity and Bootstrap 4
UPDATING ASP.NET CORE IDENTITY TO USE BOOTSTRAP 4
I still need to read this: The Article
How to Scaffold Identity UI in ASP.NET Core 2.1: Scaffold Article
-
Dotnet Core Templates, or DOTNET new -i “the magic”
Time to touch on this topic again… because every time a new DOTNET SDK comes out I seem to lose the new templates. I understand the why, and ya I wish the .Net Core group would fix it.
The “why”- each time one updates to a new Core SDK, the template scaffolds get placed into a new folder (usually under your users directory in a annoying place like ….\.templateengine\dotnetcli\”version of sdk”\). So each time you move to a new DOTNET SDK, this becomes a problem.
The second part of of DOTNET new -i that is an issue, is if you have different nuget repositories set in VS. It’s a great feature in VS 2017 where one can add additional package management sources… problem is with the DOTNET command line when you want to bring in new templates.
So, why am I going on about this? Well as I move from SDK version to version… I would like the damn templates I’ve added to either get updated (the standard ones do), or at least make sure they are available to the new SDK…. How hard can it be….
So here’s the list of what I keep installing from (dotnet Templates on github)
Here’s my list:
dotnet new -i “Microsoft.AspNetCore.SpaTemplates::*” – this one always
dotnet new -i “Boxed.Templates::*” – I’m still undesided about boxed.
dotnet new -i Microsoft.AspNetCore.Blazor.Templates::* – nice little framework that has become a 1st class citizen in VS. Make sure you also check out the VS extension.
dotnet new -i “RaspberryPi.Template::*” – who does not like Iot stuff. Also available in VS as a 1st class citizen.
Update: So as we now have SDK version… 2.1.400 I notice that some of the SPA templates remain off the list…
The SPA templates after SDK update:
ASP.NET Core with Angular angular [C#] Web/MVC/SPA
ASP.NET Core with React.js react [C#] Web/MVC/SPA
ASP.NET Core with React.js and Redux reactredux [C#] Web/MVC/SPAAnd the templates after the dotnet new -i of the SPA’s:
ASP.NET Core with Aurelia aurelia [C#] Web/MVC/SPA
ASP.NET Core with Knockout.js knockout [C#] Web/MVC/SPA
ASP.NET Core with Vue.js vue [C#] Web/MVC/SPA
ASP.NET Core with Angular angular [C#] Web/MVC/SPA
ASP.NET Core with React.js react [C#] Web/MVC/SPA
ASP.NET Core with React.js and Redux reactredux [C#] Web/MVC/SPAThe ones in bold seem to gone still…. oh well.
-
BizTalk: The almost lost secret sauce
As I was poking about trying to move a support utility forward- I noticed that one command in me “grunt” works console app made use of a Stored Procedure I buried in the BizTalk MSG DB. It’s not big thing. Until I realized that when our systems where upgraded and moved about, I didn’t move my magic SP forward… Well Duh! (I won’t go into how one should never really bolt on crap to a server product, but it was a useful tool)…
The SP was just complicated enough not to be able to just re-create from scratch – Yeah, one of those.
In a nutshell, the SP looks through active ports within a BizTalk system and does an active message count for each port that is processing a message (like I said- Not a trivial matter. Lucky, or was I foreseeing the future? I placed the SP code inside my console app- so as not to lose it….. Wow, I must be a “genus”.
[sql highlight=”5,6,7,8,9″]
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
— =============================================
— Author: Scott Edwards
— Create date: way back
— Description: Used by the integration tool to get port message counts.
— =============================================
CREATE PROCEDURE MHK_PortMSGcounts
AS
BEGIN
SET NOCOUNT ON;
SET TRANSACTION ISOLATION LEVEL READ COMMITTED
SET DEADLOCK_PRIORITY LOWCREATE TABLE #Temp (MaxRetries int, Active int, SendPort nvarchar(256), IsPrimaryTransport int)
declare @nvcAppName sysnamedeclare MyCursor CURSOR FAST_FORWARD FOR
SELECT nvcApplicationName FROM [BizTalkMsgboxDb]..[Applications] WITH (NOLOCK)open MyCursor
FETCH NEXT FROM MyCursor INTO @nvcAppName
WHILE (@@FETCH_STATUS = 0)
BEGIN
INSERT INTO #Temp
exec (‘ SELECT MAX(q.nRetryCount) AS MaxRetries
,COUNT(*) AS Active<br>
,sp.nvcName AS SendHandlersHostServiceName
,spt.bIsPrimary AS IsPrimaryTransport
FROM ‘ + @nvcAppName + ‘Q as q WITH (NOLOCK)
INNER LOOP JOIN Subscription as s WITH (NOLOCK) ON q.uidServiceID = s.uidServiceID AND s.uidPortID = q.uidPortID
INNER LOOP JOIN [BizTalkMgmtDb]..[bts_sendport] as sp WITH (NOLOCK) ON q.uidServiceID = sp.uidGUID
INNER LOOP JOIN [BizTalkMgmtDb]..[bts_sendport_transport] as spt WITH (NOLOCK) ON sp.nID = spt.nSendPortID AND spt.uidGUID = q.uidPortID
GROUP BY sp.nvcName, s.uidPortID, spt.bIsPrimary
ORDER BY SendHandlersHostServiceName ASC’)
FETCH NEXT FROM MyCursor INTO @nvcAppName
END
SELECT * FROM #Temp ORDER BY Active DESC
close MyCursor
deallocate MyCursor
DROP TABLE #Temp
END
GO
[/sql] -
Windows Community Toolkit Major update
In the “… case you didn’t hear department…”, looks like UWP Toolkit or are we just now calling it Windows Community Toolkit got a major revision…
Check it out:
WindowsCommunityToolkit – The Windows Community Toolkit is a collection of helper functions, custom controls, and app services. It simplifies and demonstrates common developer tasks building UWP ap…And… on Docs:
The Windows Community Toolkit is a collection of helper functions, custom controls, and app services. It simplifies and demonstrates common developer tasks building UWP apps for Windows 10.