Skip to content

Conversation

@srivatsn
Copy link
Contributor

@srivatsn srivatsn commented Sep 7, 2016

  • Added a C# classlibrary template
  • Created a VB template VSIX which has templates for consoleapp\classlibrary.
  • Upgraded VSIX projects to Dev15 and removed them from the core-SDK.sln (which still opens in Dev14).
  • Added language specific props and targets
  • VB compiler outputs an exe when outputtype is exe even if the output path is a dll. This needs to be fixed with a new switch in the compiler but for now changing the extension post compile.
  • Using VBCore (VBRuntime=Embed) to not introduce new dependencies.

@dotnet/project-system @eerhardt @livarcocc @brthor

Also fixes #107


<PropertyGroup>
<WarningLevel>4</WarningLevel>
<NoWarn>$(NoWarn);1701</NoWarn>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$(NoWarn);1701 [](start = 12, length = 14)

Issue #107, this arrangement seems to be adding an extra semicolon to the Suppress warnings dialog box. @davkean suggests replacing with <NoWarn>1701</NoWarn>

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

<Icon>ClassLibrary.png</Icon>
<ProjectType>CSharp</ProjectType>
<RequiredFrameworkVersion>2.0</RequiredFrameworkVersion>
<SortOrder>1</SortOrder>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 [](start = 4, length = 24)

Not sure how we determine Sort Order, but this should be similar to the ConsoleApplication (currently 12). Ditto the two VB templates

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Made it 21 so that it comes after the desktop class library template.

@natidea
Copy link
Contributor

natidea commented Sep 8, 2016

:shipit:

<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

<!--
TODO: The VB compiler outputs foo.dll.exe when the output type is Exe even when we pass in /o:foo.dll.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we log a bug for this so it is tracked? And then add a reference to the bug here.

@eerhardt
Copy link
Member

eerhardt commented Sep 8, 2016

class Class1

I think this should have a namespace, and the class should be marked "public".

Here's the template we have in the CLI today:

using System;

namespace ClassLibrary
{
    public class Class1
    {
        public void Method1()
        {    
        }
    }
}

Refers to: src/Templates/ProjectTemplates/CSharp/.NETCore/ClassLibrary/Class1.cs:1 in 88d9050. [](commit_id = 88d9050, deletion_comment = False)

@@ -0,0 +1,10 @@
{
"dependencies": {
"NETStandard.Library": "1.3",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this version exists.

https://www.nuget.org/packages/NETStandard.Library/

@blackdwarf
Copy link

blackdwarf commented Sep 8, 2016

@eerhardt namespaces can be omitted for single-file samples. However, for class libs, the class should be marked public I think. For console apps, Program class should not be public.

@eerhardt
Copy link
Member

eerhardt commented Sep 8, 2016

@eerhardt namespaces can be omitted for single-file samples.

This isn't a sample. It is our template for building class libraries. And I don't think we want to give the impression that we are discouraging class libraries from using namespaces. (Unless that is the impression we want to give - in which case that is news to me.)

@blackdwarf
Copy link

@eerhardt was news to me as well. :) However, you are right, for a class library namespace makes a lot more sense than for a console app.

@srivatsn
Copy link
Contributor Author

srivatsn commented Sep 8, 2016

I've added the namespace for the C# class library template. VB types are implicitly under the default namespace and so we don't put explicit namespaces in the templates.

@srivatsn
Copy link
Contributor Author

srivatsn commented Sep 8, 2016

@dotnet-bot test this please

1 similar comment
@srivatsn
Copy link
Contributor Author

srivatsn commented Sep 8, 2016

@dotnet-bot test this please

@srivatsn
Copy link
Contributor Author

srivatsn commented Sep 8, 2016

I keep getting failures because the workspace failed to cleaned up:

ERROR: [WS-CLEANUP] Cannot delete workspace: remote file operation failed: D:\j\workspace\release_windo---dfb4e122 at hudson.remoting.Channel@2858d3ac:Azure0908111430: java.nio.file.AccessDeniedException: D:\j\workspace\release_windo---dfb4e122\packages\microsoft.vssdk.buildtools\15.0.25604-preview4\tools\vssdk\Microsoft.VsSDK.Build.Tasks.dll

Anyone run into this before?

@srivatsn
Copy link
Contributor Author

srivatsn commented Sep 8, 2016

@dotnet-bot test this please

@eerhardt
Copy link
Member

eerhardt commented Sep 8, 2016

keep getting failures because the workspace failed to cleaned up:
ERROR: [WS-CLEANUP] Cannot delete workspace: remote file operation failed: D:\j\workspace\release_windo---dfb4e122 at hudson.remoting.Channel@2858d3a:Azure0908111430: java.nio.file.AccessDeniedException: D:\j\workspace\release_windo---dfb4e122\packages\microsoft.vssdk.buildtools\15.0.25604-preview4\tools\vssdk\Microsoft.VsSDK.Build.Tasks.dll

@mmitche

@mmitche
Copy link
Member

mmitche commented Sep 8, 2016

@dotnet-bot test Windows_NT Release

@mmitche
Copy link
Member

mmitche commented Sep 8, 2016

@eerhardt Are you guys passing /nr:false to msbuild?

@mmitche
Copy link
Member

mmitche commented Sep 8, 2016

@dotnet-bot test Windows_NT Release

@srivatsn srivatsn merged commit 0060dac into dotnet:master Sep 9, 2016
@srivatsn srivatsn deleted the templates branch September 9, 2016 00:38
@eerhardt
Copy link
Member

eerhardt commented Sep 9, 2016

@eerhardt Are you guys passing /nr:false to msbuild?

Not that I can see:

https://github.com/dotnet/sdk/blob/master/build.ps1#L62-L78

I didn't even know what that did until you asked and I had to look it up.

nguerrera pushed a commit that referenced this pull request Oct 10, 2016
Adding templates for C# Classlibrary, VB Consoleapp\classlibrary
GangWang01 pushed a commit to GangWang01/sdk that referenced this pull request Mar 20, 2023
* update urls for in-repo stuff

* Documentation cleanup

* finish CHECKLIST.md

* Update DEVGUIDE.md

Co-authored-by: Rainer Sigwald <raines@microsoft.com>

* Update README.md

Co-authored-by: Rainer Sigwald <raines@microsoft.com>

Co-authored-by: Rainer Sigwald <raines@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Warnings have prefix'd ';'

6 participants