Invalid option '7.3' for /langversion; must be ISO-1, ISO-2, Default, Latest or a valid version in range 1 to 7.1.

Posted on

This compiler error occurs sometime because of version change where dotnet compiler version and c# version are incompatible.

Error:

Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.            
Compiler Error Message: CS1617: Invalid option ‘6’ for /langversion; must be ISO-1, ISO-2, 3, 4, 5 or Default


Compiler Error Message: Invalid option ‘7.3’ for /langversion; must be ISO-1, ISO-2, Default, Latest or a valid version in range 1 to 7.1.


Solution:

Solution 1: The easiest way is to update the following NuGet packages (whichever installed) to resolve the problem:

  • Microsoft.CodeDom.Providers.DotNetCompilerPlatform
  • Microsoft.Net.Compilers

Solution 2: Pay attention to compiler “type” in the Web.Config file, when changing Framework version:

for 4.5 and C#5 –

type="Microsoft.CSharp.CSharpCodeProvider...

for 4.6 and C#6 –

type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatfor

Workaround:

<system.codedom>
    <compilers>
      <compiler language="c#;cs;csharp" extension=".cs" type="Microsoft.CSharp.CSharpCodeProvider, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" warningLevel="4" compilerOptions="/langversion:6 /nowarn:1659;1699;1701">
          <providerOption name="CompilerVersion" value="v4.0"/>
      </compiler>
      <compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.VBCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel="4" compilerOptions="/langversion:14 /nowarn:41008 /define:_MYTYPE=\&quot;Web\&quot; /optionInfer+"/>
    </compilers>
  </system.codedom>

Attribute  “compilerOptions” needs to be replaced:

 “langversion:6” -> ‘langversion:5

How to update files of Azure hosted site

Posted on

Rijwan Ansari

There are few steps need to follow to edit and update files of application which are hosted in azure. Follow following steps.

  1. Login to azure portal, Click on App Services and Go to App Service Editor (Preview) under the Development Tools.

1

2. Click on GO . All the files of application will be listed on left side.

22.1

3. Click on file that you want to edit, and file will be opened as shown in below and change according to your need and then save it. If you forget to save your changes then don’t worry, it saves the newly changed values automatically.

3

View original post

Change the session timeouts in SharePoint sites

Posted on

Some cases, our clients (SharePoint Client) may request to change the session time out of SharePoint sites. It is allowed to set timeout of the user session in SharePoint so that users are logged out after certain time of inactivity. Additionally, current page state will be expired based configure timeout. There are multiple ways, we can configure session timeout.

From central Administrator:

Go to SharePoint  Central Admin
Go to Application Management
Select Configure Session State
Under Timeout, change the default value stored there.

Power Shell ( SharePoint Management Shell)

This is handy for forms which have to be filled within certain period of time before they expire. Alternatively, if you want to extend the timeout – you can do that.

$spsite = Get-SPSite("[site collection url]")
$webApp = $spsite.WebApplication
$webApp.Enabled = $true
$webApp.Expires = $true
$webApp.Timeout = New-TimeSpan -Hours 2 -Minutes 30
$webApp.Update()

This will enable session expiration and set page content to timeout after 2 hours and 30 minutes.

If you’re using claims authentication and would like for your provider to expire sessions after certain period of inactivity, here is how to do that with Power Shell:

$tokenservice = Get-SPSecurityTokenServiceConfig
$tokenservice.UseSessionCookies = $true
$tokenservice.LogonTokenCacheExpirationWindow = New-TimeSpan -Minutes 5
$tokenservice.Update()

Logon expiry will be set to 5 mins.

Create SQL Server Database Project With Visual Studio. Create or compare two Databases.

Posted on Updated on

Here, we are going to learn about SQL Server Database Project (Template) available in Visual Studio. I will cover following points:

  • Introduction of SQL Server Database Project.
  • Create New SQL Server Database Project.
  • Import database schema from an existing database, a .sql script file or a Data-tier application (.dacpac) the Project.
  • Publish to create new Database in SQL server.
  • Compare Two Database and find differences.
  • Compare, Update or Create update Scripts.

Database plays a most important role in any application and it becomes difficult to manage the project when number of tables, views, stored procedures increases.

Consider scenarios where multiple developers are working on a project for next release, some are working on Bugs or adding new features which again require some or many changes in database. Most of the cases developers take note of DB (Database) changes manually. Some time they miss some changes which cost in production. There are many cases that Dev, UAT and production DB are different which is again hassle to identify the differences.

There are number of tools available in market for comparing DBs but are costly or paid solution.

So, in this article we will discuss and learn about SQL Server Database Project with is available in Visual Studio which is free. Yes Free!!

Prerequisites: Visual Studio (2015 or 2017) and MS SQL  Server. I am using VS2017 and SQL Server 2017 Developer for illustration.

Introduction:

You can create a new database project and import database schema from an existing database, a .sql script file or a Data-tier application (.dacpac). You can then invoke the same visual designer tools (Transact-SQL Editor, Table Designer) available for connected database development to make changes to the offline database project, and publish the changes back to the production database. The changes can also be saved as a script to be published later. Using the Project Properties pane, you can change the target platform to different versions of SQL Server (including SQL Azure). (copied MS Docs)

Create New SQL Server Database Project

  1. Open Visual Studio and create a blank solution.

2. Add a Project.

3. Select SQL Server from Left panel and SQL Server Database Project. Name the project ( here SampleAccount.)

Import database schema from an existing database, a .sql script file or a Data-tier application (.dacpac) the Project

4. Right click on project and select import. There will be three options: Data-Tier Application (.dacpac), Database, Scripts. Select Database.

5. Provide Connection string. i.e. Select/Insert Server, authentication type, Database.

6. Set the import settings as highlighted.

7. Click Start which will show the progress window as:

After Finish we will see the tables, views and stored procedures in our project.

This is how we can add the database in the SQL Server Database Project.

Publish to create new Database in SQL server.

The database above in the project can be used to create new database with same schema.

  1. Right click on the project and choose the publish option.

2. Provide Connection: Server name, Authentication Type , credentials. If we want to publish as new database then choose default database, or choose specific database to publish.

3. We can generate script or publish directly. You can explore advance options as well to apply rules on publish.

Now our new database is created or generated script can used to create.

Compare Two Database and find differences.

This section we will how to compare two database to identify the differences like Dev, UAT or UAT, Prod likewise.

  1. Right click in the SQL Database project and choose schema compare.

2. Select Source and Target database. Prove connection. Note: we can compare two databases or another database with the project database.


3. Click Compare

The we will the differences between source and target database.

There will be deleted, edited and added objects as shown.

Compare, Update or Create update Scripts.

Another we can update the target database or generate update script to push source version.

  1. Complete the compare part. then there is option to do the job.

Update option directly update to target database and generate script will give sql script.

From above consideration, we don’t need to create migration script or plan for DB. We can easily compare the relevant database tables, views and stored procedures in no time.

So, any changes can be incorporated and make database managing in effective and efficient way.

SharePoint Error: Updates are currently disallowed on GET requests. To allow updates on a GET, set the ‘AllowUnsafeUpdates’ property on SPWeb.

Posted on Updated on

This error occurs while clicking General setting of Web Application in SharePoint Central Administrator.

SharePoint Central Administrator >> Manage Web Applications >> Select Web Application (From List) >> General Settings >> General Settings.

Resolution:

Using Powershell Scripts ( SharePoint Management Shell):

Run this powershell script:

$web = get-spwebapplication http://SharepointUrl
$web.HttpThrottleSettings
$web.Update()

Kind Regards!

Angular Basic Concept

Posted on

Rijwan Ansari

Angular Directives

In Angular, Directives are good features for re-usability.

-Directives are used for reusable purpose for example Time Picker Controller, Data Picker Controller, File Upload Controller as well as any kind of custom logic and custom validation to control that as required by the program.

-Directives are like user control in ASP.NET Web Pages and HTML extension in ASP.NET MVC applications.

-Keep in mind that if you are creating Directive for reusable purpose then it should not use the scope of any controller and should work independent of scope or controller.

-Don’t write any Directive name starting with ng- as it may create the conflict with Angular directives also can generate the ambiguity.

Global Variable in Angular

Since, a Single Page App it is very necessary to avoid the Global Variable because the Garbage Collector will never be triggered out to clear the Global Variable in SPA.

Unit Testing

View original post 87 more words

Visual Studio Installation Guide for Starter

Posted on

Rijwan Ansari

Step 1: Make sure your computer is ready for Visual Studio

  1. whether your computer supports Visual Studio 2017 or not Please check the system requirements.
  1. Apply the latest Windows updates. These updates ensure that your computer has both the latest security updates and the required system components for Visual Studio.
  2. Reboot the computer to ensure any pending installs or updates are completed and they don’t hinder the Visual Studio install.
  3. If you don’t have enough space, then Free up. Remove unneeded files and applications from your %SystemDrive% by, for example, running the Disk Cleanup app.

Step 2: Download Visual Studio 2017

Click the following link, click Save and then Open file.

DOWNLOAD VISUAL STUDIO 2017

Step 3: Install the Visual Studio Installer

Now, run the bootstrapper file to install the Visual Studio Installer. This new lightweight installer includes everything you need to both install and customize Visual Studio 2017.

View original post 265 more words