You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docker run -it --rm microsoft/dotnet:1.0.3-sdk-msbuild-rc4
mkdir new
cd new
dotnet new console
dotnet restore
dotnet build
Expected behavior
Builds successfully.
Actual behavior
Program.cs(3,11): error CS1001: Identifier expected [/new/new.csproj]
Program.cs(3,11): error CS1514: { expected [/new/new.csproj]
Program.cs(3,11): error CS0116: A namespace cannot directly contain members such as fields or methods [/new/new.csproj]
Program.cs(4,1): error CS1022: Type or namespace definition, or end-of-file expected [/new/new.csproj]
The root cause is dotnet new uses the directory name as the namespace in the generated code, without first checking if the directory name is a valid namespace identifier.
using System;
namespace new
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Hello World!");
}
}
}
Environment data
dotnet --info output:
.NET Command Line Tools (1.0.0-rc4-004883)
Product Information:
Version: 1.0.0-rc4-004883
Commit SHA-1 hash: fa2c9e025c
Runtime Environment:
OS Name: debian
OS Version: 8
OS Platform: Linux
RID: debian.8-x64
Base Path: /usr/share/dotnet/sdk/1.0.0-rc4-004883
Copied from original issue: dotnet/cli#5825
The text was updated successfully, but these errors were encountered:
This issue was last touched some years ago. We are working on a new delivery road map. Please reopen if this is something we want & we'll properly assess its' priority compared to other work aimed at improving the overall templating UX.
From @mikeharder on February 23, 2017 21:52
Steps to reproduce
Expected behavior
Builds successfully.
Actual behavior
The root cause is
dotnet new
uses the directory name as the namespace in the generated code, without first checking if the directory name is a valid namespace identifier.Environment data
dotnet --info
output:Copied from original issue: dotnet/cli#5825
The text was updated successfully, but these errors were encountered: