Sunday, April 19, 2020

How to get an offline version of Visual Studio 2019 ?

How to get an offline version of Visual Studio 2019? Or simply, is it possible to have an offline version of Visual Studio 2019?

Answer: Yes, It's possible; and the solution is provided by Microsoft itself in this Link.

Why do i need an Offline Installer?


Answer - With an Offline Installer, i can install visual Studio; just by clicking the Setup.EXE executable file.  


How can I get this offline installer?

Answer: Here, we will highlight Visual Studio Enterprise 2019 for Windows 10; however the same process should work for Windows 8.1 and Windows 7.

This is a 2-Step process

Step 1. Download the Visual Studio bootstrapper file   

Download the Visual Studio bootstrapper file for your chosen edition of Visual Studio. 

Edition
Bootstrapper File Link
Visual Studio Community  
Visual Studio Professional 
Visual Studio Enterprise 

Step 2. Create a local install cache


Ø  Open Command Prompt in Administrator mode
Ø  To create a complete local layout with all features, run:
§  vs_enterprise__2132243952.1587278346.exe --layout c:\vslayout --lang en-US

Ø  For .NET web and .NET desktop development, run:
§  vs_enterprise__2132243952.1587278346.exe --layout c:\vslayout --add Microsoft.VisualStudio.Workload.ManagedDesktop --add Microsoft.VisualStudio.Workload.NetWeb --add Component.GitHub.VisualStudio --includeOptional --lang en-US

Ø  For .NET desktop and Office development, run:
§  vs_enterprise__2132243952.1587278346.exe --layout c:\vslayout --add Microsoft.VisualStudio.Workload.ManagedDesktop --add Microsoft.VisualStudio.Workload.Office --includeOptional --lang en-US

Ø  For C++ desktop development, run:
§  vs_enterprise__2132243952.1587278346.exe --layout c:\vslayout --add Microsoft.VisualStudio.Workload.NativeDesktop --includeRecommended --lang en-US


Thursday, December 31, 2015

ERROR - "the 'microsoft.ace.oledb.12.0' provider is not registered on the local machine" - RESOLUTION

Scenario:

ERROR - "the 'microsoft.ace.oledb.12.0' provider is not registered on the local machine"

RESOLUTION :

There are lot of scenarios for which we might get "The 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine" error when attempting to connect to either an accdb or an xlsx file. 

I have spent a couple of hours searching Google for a resolution of this issue but somehow I was not getting the correct solution. Ultimately, the below solution worked best for me 100%.

Step 2. in VS, add references (say Microsoft.Office.Interop.Excel)  and write necessary business logic. 
Hope this helps.. Cheers... :)



Wednesday, December 30, 2015

Check-box 'Prefer 32-bit' disabled in Visual Studio 2012. Why?

Question: 

Check-box 'Prefer 32-bit' disabled in Visual Studio 2012. Why?

Answer: 


In Visual Studio, Switch the project to .NET 4.5 (on the Build tab of the project properties). This would re-enable the check-box "Prefer 32 bit" for AnyCPU.

Monday, July 6, 2015

Import Microsoft Access .accdb File to MS SQL Server

Steps to Import Microsoft Access .accdb File to MS SQL Server

  1. Open MS SQL Server Import and Export Wizard.
  2. For “Data Source” choose “Microsoft Office 12.0 Access Database Engine OLE DB Provider”.
  3. Click “Properties” enter the location of the .accdb file in the “Data Source” field.
  4. Under login information, choose a blank username and be sure to check “Blank Password”.
  5. Test the connection. If it works, click OK.
  6. For the “Data Destination” choose “Microsoft OLE DB Provider for SQL Server”.
  7. Enter the MS SQL server name or choose from the dropdown menu.
  8. Enter your SQL credentials and select the database you wish to import the data to, the database should show up in the dropdown menu if your MS SQL info is correct.
  9. Select “Copy data from one or more tables or views”.
  10. Select the tables you want copied and edit the mappings if needed.
  11. Continue through the wizard and hit finish to begin the import.

Ref : http://serversideguy.com/2014/02/05/import-microsoft-access-accdb-file-to-ms-sql-server/ 


Friday, July 3, 2015

The page you are requesting cannot be served because of the extension configuration

Scenario:

I was getting the below error message when trying to run my application having .svc file. 

HTTP Error 404.3 - Not Found The page you are requesting cannot be served because of the extension configuration. If the page is a script, add a handler. If the file should be downloaded, add a MIME map.

Screenshot of the error page: 

alt text

Solution 1:

Please follow the below two steps on IIS 8.0.
Step 1. Add new MIME type 
  1. Extension: .svc, MIME type: application/octet-stream
Step 2: Add new HttpHandler

  1. Request path: *.svc, Type: System.ServiceModel.Activation.HttpHandler, Name: svc-Integrated
Step 3: Restart IIS

Solution 2:

In Windows 7 and earlier, run aspnet_regiis -i 
Note: but this command seems to have been deprecated in Windows 8 yielding response This option is not supported on this version of the operating system. (...).



Friday, June 26, 2015

SQL server - Intellisense not showing the DB Objects (say, Table names) in Query Analyzer Window

Problem Scenario 1:

I was attempting to create a Stored Procedure in my database. However, the SSMS intellisense does not recognize lot of the tables which exists in the database.
Problem Scenario 2:

While writing the select queries, the Intellisense does not work as expected and is not showing the DB Objects (say, Table names) in Query Analyzer Window

Solution:

Try:
Edit -> IntelliSense -> Refresh Local Cache
This should refresh the data cached by Intellisense to provide typeahead support and pre-execution error detection.

Note: Pressing Ctrl + Shift + R refreshes intellisense in management studio 2008 as well.

Once we create a new SQL Server object, the newly created object does not get updated in the IntelliSence Local Cache and due to this, it shows red line underneath that object. So we need to refresh SSMS IntelliSence Local Cache and once we refresh it, IntelliSence will automatically add newly created object in the cache and the red line will disappear. 
Try this
Edit -> IntelliSense -> Refresh Local Cache 
or
Ctrl + Shift + R 


enter image description here

Ref URL: http://stackoverflow.com/questions/1362531/sql-server-invalid-object-name-but-tables-are-listed-in-ssms-tables-list 


Monday, May 18, 2015

ASP.NET MVC View Model / Model not binding on HTTP Post

Problem Scenario:

I am having an issue that when I post to a controller, I loose model binding and everything in my model is NULL. Here is the code that I am using:
View:

@model Models.StateDTO
@using (Html.BeginForm("AddState", "Home",new {area="Admin" }, FormMethod.Post))
{
@Html.AntiForgeryToken()
@Html.ValidationSummary(true)


State Name



@Html.TextBoxFor(m => m.State)
@Html.ValidationMessageFor(m => m.State)





}

Model:

public class StateDTO
    {        
        public int Id { get; set; }
  
        [Required]
        public string State { get; set; }      
    }

Controller:

        [HttpPost]
        [ValidateAntiForgeryToken]
        public ActionResult AddState(StateDTO state)
        {
            if (state != null && ModelState.IsValid)
            {
                //.....
            }
            return View();
        }

Why is everything in my model (i.e. StateDTO state) NULL?

Solution:

One possible reason for view model is NULL :
·         The name of model in action parameter be the same as one of view model's properties

Ex: Here, same name means case insensitive (State is same as state)

Hence, the correct controller action method should be like below:

        [HttpPost]
        [ValidateAntiForgeryToken]
        public ActionResult AddState(StateDTO vwState)
        {
            if (vwState != null && ModelState.IsValid)
            {
                //.....
            }
            return View();
        }

Here, "State" property name in model is different then action parameter i.e."vwState"

Hope this helps... Cheers :)


VS Code # Warning - npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead

Error : VS Code - NPM Warning - npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead Solution:  Foll...