Friday, May 27, 2022

ERROR: Runtime dotnet-isolated not supported for os windows, When creating a function app

I was trying to create an Azure function app for .NET 6.0 with dotnet-isolated and functions ver 4 in May 2022 when I got these errors:


Error: Command failed: az functionapp create --name myapp-functions-qa --storage-account myappsaqa --runtime dotnet-isolated --app-insights-key "myapp-functions-ai-qa" --os-type Windows --plan myapp-functions-asp-qa --functions-version 4


ERROR: Runtime dotnet-isolated not supported for os windows. Supported runtimes for os windows are: ['dotnet', 'dotnet', 'node', 'node', 'node', 'java', 'java', 'powershell', 'powershell', 'custom']. Run 'az functionapp list-runtimes' for more details on supported runtimes. 


Surprisingly, I was able to create a function app a month earlier using the dotnet-isolated runtime. Something must have changed with Azure. Lot of search didn't lead me to any solution.

After trying several things, the workaround I found was to create the function app with dotnet runtime as below:

az functionapp create --name myapp-functions-qa --storage-account myappsaqa --runtime dotnet --app-insights-key "myapp-functions-ai-qa" --os-type Windows --plan myapp-functions-asp-qa --functions-version 4


After the app is created, I simply updated the app runtime to dotnet-isolated. And this surprisingly worked.


az functionapp config appsettings set --name myapp-functions-qa --resource-group MYAPP_RG --settings "FUNCTIONS_WORKER_RUNTIME=dotnet-isolated"

Now your function app should work in dotnet-isolated mode.

Till Microsoft makes the dotnet-isolated runtime official, use this workaround.


Friday, May 20, 2016

CA1050 Declare types in namespaces 'FilterConfig'

Running code analysis on my ASP.NET MVC application gives the following warning.

CA1050 Declare types in namespaces 'FilterConfig' should be declared inside a namespace. appname.xxx FilterConfig.cs 4

The FilterConfig.cs or RouteConfig.cs or Global.asax are created by the application without any namespaces.

I would say, just update your rule (if custom ruleset) to ignore this. Else right click and suppress the message.


Saturday, December 14, 2013

Upgrading Office project from Visual Studio 2008 to Visual Studio 2012 (Targetting Framework 4.0/4.5)

Upgrading Office project from Visual Studio 2008 to Visual Studio 2012 (Targetting Framework 4.0/4.5).

All hell broke loose when I opened my 2008 visual studio office project in Visual Studio 2012 hoping that VS will take care of the upgrade seamlessly.

It upgraded and gave me a report that all is well. (Well the deployment project failed to upgrade as that option was removed. About that in probably another post).

Went ahead and tried to build the solution. bam !!. 105 errors. Mainly in the ribbon's designer file.

The common error:
'New' cannot be used on an interface

What...
When did the class change to an interface...

Me.Separator1 = New Microsoft.Office.Tools.Ribbon.RibbonSeparator
fails.

Me.MyButton1= New Microsoft.Office.Tools.Ribbon.RibbonButton
fails

Finally found the link that saved me from all those errors:
http://msdn.microsoft.com/en-us/library/ee712589.aspx

Thursday, September 13, 2012

Separating the Model and the Controller+View in different projects in MVC4 and EF5

Created a solution in visual studion 2012. (MyProject)
Created a web/UI MVC4 project using the provided template. (MyProject.UI)
Created a data access layer project. (MyProject.DAL)

Using entity framework 5 connected to sql server database and created edmx file in the DAL project.
Build the DAL project.
Go to the UI project and add a reference to the DAL project.

Copy the connection string from app.config of the DAL project to the web.config of the UI project.
This will ensure you don't get the following error:

Unable to retrieve metadata ...... No connection string named .... could be found ......




Thursday, September 6, 2012

How to create a simple CRUD controller using Database First MVC4 and EF 5




How to create a simple CRUD controller using the following:
Visual Studio 2012
Microsoft MVC 4 Framework
Entity Framework EF5
Database First
Create a database called MusicDb
 
Create table Album
(AlbumId int identity(1,1) PRIMARY KEY,
Name varchar(50),
Artist varchar(50))
 
In visual studio, create a new project and select the MVC 4 template (assuming you have your VS configured with MVC4 and EF5)
Adding Model
ADDING A CONTROLLER
Now build and run your project.
It shows default page.
Enter the following after your URL
http://yourURL/Album
You should now be able to add, update and delete albums from your db.


Tuesday, September 4, 2012

Visual Studio 2012 Setup failed - Visual C++ 2012 x64 Minimum runtime error

When installing Visual studio 2012 on windows 7 machine, it failed with the following error:

setup failed.
Visual C++ 2012 x64 Minimum runtime error
incorrect function





The iso was downloaded from msdn.

Tried repairing .net framework 4.0 as suggested on some sites - didn't work.

It was probably corrupted iso during download. Re-downloaded the iso from Microsoft site and was able to proceed with installation.



Monday, September 3, 2012

ORA-12154:TNS: could not resolve the connect identifier specified, visual studio, ODP.NET

Trying to connect from Visual Studio 2010 to Oracle Express 11g on my local machine using ODP.NET.

However get the following error message:





ORA-12154:TNS: could not resolve the connect identifier specified

1. Able to connect from Oracle XE database from Oracle SQL Developer, TOAD, Erwin etc.

What Worked
In the data source name box, instead of XE use:

localhost:1521/XE

 It worked flawlessly.