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
Copy file name to clipboardExpand all lines: README.md
+46-13Lines changed: 46 additions & 13 deletions
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,23 @@ Please see the blog [Enabling the .NET Compiler Platform (“Roslyn”) in ASP.N
5
5
for an introduction to Microsoft.CodeDom.Providers.DotNetCompilerPlatform.
6
6
7
7
## Updates
8
-
+#### Version 4.1.0 (preview1)
8
+
9
+
+#### Version 4.5.0
10
+
-#### Refreshed compilers
11
+
In keeping with the new versioning scheme for this project, the version has been revved to 4.5 to match the version of the compilers included.
12
+
13
+
:information_source: The source of compiler tools in this package has been updated to [Microsoft.Net.Compilers.**Toolset**](https://www.nuget.org/packages/Microsoft.Net.Compilers.Toolset) from the old, deprecated `Microsoft.Net.Compilers` package that had been used before. There shouldn't be any behavioral change due to this change in Roslyn packages.
14
+
15
+
-#### Fixed targets-based tool copy
16
+
The msbuild targets-based identification and copy of Roslyn files to the project output was not working correctly in the last version. This has been fixed to ensure that Roslyn compiler files are copied to the correct location during build.
17
+
18
+
-#### Still .Net >= 4.7.2
19
+
This change was made with the introduction of the 4.X series of this package. But is worth mentioning here, as the call-out of that change is now hidden in the collapsed section below.
20
+
21
+
<details>
22
+
<summary>Older Updates</summary>
23
+
24
+
+#### Version 4.1.0
9
25
-#### :warning: Drop install.ps1, Rely more on msbuild :warning:
10
26
Nuget has moved on from install.ps1. We had one foot in the msbuild camp before, and one foot still in the install.ps1 camp. Time to just jump in with both feet. See the 'RoslynRegisterInConfig' setting description below.
11
27
@@ -20,7 +36,11 @@ for an introduction to Microsoft.CodeDom.Providers.DotNetCompilerPlatform.
20
36
-#### .Net >= 4.7.2
21
37
As a result of not keeping older compilers packaged in this project, we can no longer support versions before 4.7.2 because compiler versions 3.0 and newer only support 4.7.2+.
22
38
23
-
+#### Version 3.11.0 (preview1)
39
+
+#### Version 3.11.1
40
+
-#### Fixed targets-based tool copy
41
+
The msbuild targets-based identification and copy of Roslyn files to the project output was not working correctly in the last version. This has been fixed to ensure that Roslyn compiler files are copied to the correct location during build.
42
+
43
+
+#### Version 3.11.0
24
44
-#### Refreshed compilers
25
45
In keeping with the new versioning scheme for this project, the version has been revved to 3.11 to match the version of the compilers included.
26
46
@@ -30,6 +50,10 @@ for an introduction to Microsoft.CodeDom.Providers.DotNetCompilerPlatform.
30
50
-#### Non-web apps and 'aspnet:RoslynCompilerLocation'
31
51
The appSetting `aspnet:RoslynCompilerLocation` can still be used to point at a specific download of the Roslyn compiler tools, but this package is hopefully a little more forgiving when searching for a default location and should accomodate both web projects as well as non-web projects without requiring this setting.
32
52
53
+
+#### Version 3.6.1
54
+
-#### Fixed targets-based tool copy
55
+
The msbuild targets-based identification and copy of Roslyn files to the project output was not working correctly in the last version. This has been fixed to ensure that Roslyn compiler files are copied to the correct location during build.
56
+
33
57
+#### Version 3.6.0
34
58
-#### Refreshed compilers (and versioning)
35
59
This is most likely the update everyone has been looking for. This package contains updated Roslyn bits for newer target frameworks. If your project is targeting 4.7.2 or above, this package will use `Microsoft.Net.Compilers` version 3.5 with your build. You might notice that we have revved our package version to match the most recent compiler version included. For target frameworks 4.6 through 4.7.1, the 2.10 version of compilers is used. (A slight update from 2.9 that shipped with our last package.) And as before, projects targeting 4.5.* will get version 1.3.2 of the compilers. (Note that the language version for 4.6 and above is set to "default", which means C# 7.3 max for full framework projects.)
@@ -55,36 +79,39 @@ for an introduction to Microsoft.CodeDom.Providers.DotNetCompilerPlatform.
55
79
56
80
-#### What shall I do?
57
81
If you are using Visual Studio 2017 with latest update, you should upgrade Microsoft.CodeDom.Providers.DotNetCompilerPlatform nupkg to 2.0.0 and **remove Microsoft.Net.Compilers nupkg from your project**.
58
-
82
+
</details>
59
83
60
84
## Configurations
61
85
Generally, command-line options for the codedom compilers can be specified using the `compilerOptions` attribute of the compiler when it is registered in configuration. There are however, a handful of options for controlling some behaviors of this package that are not command-line options. These options fall into two broad categories and can be set as follows:
62
86
63
87
### Build-time Options
64
-
+**(V2) Specify the path to copy Roslyn compiler at build time** - When building projects, target files included by the Microsoft.CodeDom.Providers.DotNetCompilerPlatform nupkg will copy appropriate Roslyn compiler into bin\roslyn folder. With this setting, you can specify a custom path from which the build process will copy the Roslyn compiler, rather than using one of the pre-packaged Roslyn compilers.
88
+
+#### <u>Setting: RoslynToolPath</u>
65
89
66
-
**Setting name** - RoslynToolPath
90
+
**(V2) Specify the path to copy Roslyn compiler at build time** - When building projects, target files included by the Microsoft.CodeDom.Providers.DotNetCompilerPlatform nupkg will copy appropriate Roslyn compiler into bin\roslyn folder. With this setting, you can specify a custom path from which the build process will copy the Roslyn compiler, rather than using one of the pre-packaged Roslyn compilers.
67
91
68
92
**How to use it** - ```msbuild mysolution.sln /t:build /p:RoslynToolPath="[Roslyn compiler folder full path]"```
69
93
70
94
**Use case** - In 2.0.0 version, Microsoft.CodeDom.Providers.DotNetCompilerPlatform nupkg removes the dependency on Microsoft.Net.Compilers nupkg. Instead, it embeds one version of Roslyn compiler inside the nupkg. It's possible that the embeded version of Roslyn compiler is not the one you want, so through this setting you can specify a version of Roslyn compiler at build time which will be copied to bin\roslyn folder.
71
95
72
-
+**(V4) Skip copying Roslyn compiler at build time** - When building projects, target files will copy the appropriate binaries specified by the 'RoslynToolPath' setting described above and copy them into the project output for runtime use. This copy step can be skipped by using this project setting.
96
+
+#### <u>Setting: RoslynCopyToOutDir</u>
73
97
74
-
**Setting name** - RoslynCopyToOutDir
98
+
**(V4) Skip copying Roslyn compiler at build time** - When building projects, target files will copy the appropriate binaries specified by the 'RoslynToolPath' setting described above and copy them into the project output for runtime use. This copy step can be skipped by using this project setting.
75
99
76
100
**How to use it** - ```msbuild mysolution.sln /t:build /p:RoslynCopyToOutDir="[true|false]"```
77
101
78
-
+**(V4) Don't modify config at build time** - CodeDom providers are not magically picked up from referenced assemblies. They must be explicitly registered in config in order to be used. Prior to the Version 4 update, all modifications to config were performed via powershell scripts included in the nuget package. This powershell method worked with 'packages.config' apps, but does not work with 'PackageReference' apps. As more applications move towards the preferred 'PackageReference' way of doing things, we have updated our method of config registration to be an msbuild task instead of a powershell install script. We take care not to stomp over existing settings. But this step gets checked/performed on every build now instead of just on package install. Use this setting to skip the config update.
102
+
+#### <u>Setting: RoslynRegisterInConfig</u>
79
103
80
-
**Setting name** - RoslynRegisterInConfig
104
+
**(V4) Don't modify config at build time** - CodeDom providers are not magically picked up from referenced assemblies. They must be explicitly registered in config in order to be used. Prior to the Version 4 update, all modifications to config were performed via powershell scripts included in the nuget package. This powershell method worked with 'packages.config' apps, but does not work with 'PackageReference' apps. As more applications move towards the preferred 'PackageReference' way of doing things, we have updated our method of config registration to be an msbuild task instead of a powershell install script. We take care not to stomp over existing settings. But this step gets checked/performed on every build now instead of just on package install. Use this setting to skip the config update.
81
105
82
106
**How to use it** - ```msbuild mysolution.sln /t:build /p:RoslynRegisterInConfig="[true|false]"```
83
107
84
108
**Use case** - This config-manipulation step happens on ever build. (Even designer builds.) We take care to be as non-invasive as possible, but if you want us to stay entirely hands-off and update your config registrations manually, this setting enables that.
85
109
86
110
### Run-time Options
87
-
+**Specify the path to load Roslyn compiler at runtime** - When asp.net compiles the views at runtime or precompile time(using aspnet_compiler to precompile the web app), Microsoft.CodeDom.Providers.DotNetCompilerPlatform needs a path to load Roslyn compiler. This setting can be used to specify this loading path.
111
+
112
+
+#### <u>Roslyn Compiler Location</u>
113
+
114
+
**Specify the path to load Roslyn compiler at runtime** - When asp.net compiles the views at runtime or precompile time(using aspnet_compiler to precompile the web app), Microsoft.CodeDom.Providers.DotNetCompilerPlatform needs a path to load Roslyn compiler. This setting can be used to specify this loading path.
88
115
89
116
1.**Environment variable** - This is the first setting Microsoft.CodeDom.Providers.DotNetCompilerPlatform reads. If this setting is used, Microsoft.CodeDom.Providers.DotNetCompilerPlatform will ignore the other setting.
90
117
@@ -112,7 +139,9 @@ Generally, command-line options for the codedom compilers can be specified using
112
139
113
140
4.**Default setting** - The default location is bin\roslyn folder.
114
141
115
-
+**Specify the TTL of Roslyn compiler server** - Microsoft.CodeDom.Providers.DotNetCompilerPlatform leverages Roslyn compiler server(VBCSCompiler.exe) to compile the generated code. In order to save system resources, VBCSCompiler.exe will be shutdown after idling 10 seconds in the server environment. However, in the development environment(running your web application from visual studio) the idle time is set to 15 mininutes. The reason behind this is to improve the startup performance of your web application when you run/debug the application in Visual Studio, since VBCSCompiler.exe takes several seconds to start if relevant Roslyn assemblies are not NGen'd. With this setting, you can control the idle time of VBCSCompiler.exe.
142
+
+#### <u>Roslyn Server TTL</u>
143
+
144
+
**Specify the TTL of Roslyn compiler server** - Microsoft.CodeDom.Providers.DotNetCompilerPlatform leverages Roslyn compiler server(VBCSCompiler.exe) to compile the generated code. In order to save system resources, VBCSCompiler.exe will be shutdown after idling 10 seconds in the server environment. However, in the development environment(running your web application from visual studio) the idle time is set to 15 mininutes. The reason behind this is to improve the startup performance of your web application when you run/debug the application in Visual Studio, since VBCSCompiler.exe takes several seconds to start if relevant Roslyn assemblies are not NGen'd. With this setting, you can control the idle time of VBCSCompiler.exe.
116
145
117
146
1.**Environment variable** - This is the first setting Microsoft.CodeDom.Providers.DotNetCompilerPlatform reads. If this setting is used, Microsoft.CodeDom.Providers.DotNetCompilerPlatform will ignore the other setting.
118
147
@@ -128,15 +157,19 @@ Generally, command-line options for the codedom compilers can be specified using
128
157
129
158
**How to use it** - Add this providerOption into your config file under the `system.codedom/compilers/compiler` to which you want it to apply.
130
159
131
-
+**Disable ASP.Net "Magic"** - If the helpful manipulation of `compilerOptions` for running smoothly in an ASP.Net environment is not so helpful for your environment, you can disable this and Microsoft.CodeDom.Providers.DotNetCompilerPlatform will get out of your way, using the `compilerOptions` provided to it with no additions or manipulations.
160
+
+#### <u>ASP.Net "Magic"</u>
161
+
162
+
**Disable ASP.Net "Magic"** - If the helpful manipulation of `compilerOptions` for running smoothly in an ASP.Net environment is not so helpful for your environment, you can disable this and Microsoft.CodeDom.Providers.DotNetCompilerPlatform will get out of your way, using the `compilerOptions` provided to it with no additions or manipulations.
132
163
133
164
**Provider Option** - This is the only option to specify whether `compilerOptions` manipulation should happen automatically or not.
**How to use it** - Add this providerOption into your config file under the `system.codedom/compilers/compiler` to which you want it to apply.
138
169
139
-
+**Treat Warnings as Errors** - This `System.CodeDom.Compiler.CompilerParameters` property is unfortunately at a conflict with ability to tell the compiler how to behave directly with a `compilerOption`. Prior to v3.5, Microsoft.CodeDom.Providers.DotNetCompilerPlatform would always set this to false. Now developers have a choice in how to manage this conflict.
170
+
+#### <u>Warnings as Errors</u>
171
+
172
+
**Treat Warnings as Errors** - This `System.CodeDom.Compiler.CompilerParameters` property is unfortunately at a conflict with ability to tell the compiler how to behave directly with a `compilerOption`. Prior to v3.5, Microsoft.CodeDom.Providers.DotNetCompilerPlatform would always set this to false. Now developers have a choice in how to manage this conflict.
140
173
141
174
**Provider Option** - `<providerOption name="WarnAsError" value="[true|false]" />` - The default is false.
Copy file name to clipboardExpand all lines: src/Packages/Microsoft.CodeDom.Providers.DotNetCompilerPlatform/Readme.md
+9Lines changed: 9 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -8,6 +8,15 @@ Please see the blog [Enabling the .NET Compiler Platform (“Roslyn”) in ASP.N
8
8
for an introduction to Microsoft.CodeDom.Providers.DotNetCompilerPlatform. The [project github](https://github.com/aspnet/RoslynCodeDomProvider) also has the most up-to-date documentation of the various settings available for configuring this provider.
9
9
10
10
## Updates
11
+
+#### Version 4.5.0
12
+
-#### Refreshed compilers
13
+
In keeping with the new versioning scheme for this project, the version has been revved to 4.5 to match the version of the compilers included.
14
+
15
+
:information_source: The source of compiler tools in this package has been updated to [Microsoft.Net.Compilers.**Toolset**](https://www.nuget.org/packages/Microsoft.Net.Compilers.Toolset) from the old, deprecated `Microsoft.Net.Compilers` package that had been used before. There shouldn't be any behavioral change due to this change in Roslyn packages.
16
+
17
+
-#### Fixed targets-based tool copy
18
+
The msbuild targets-based identification and copy of Roslyn files to the project output was not working correctly in the last version. This has been fixed to ensure that Roslyn compiler files are copied to the correct location during build.
19
+
11
20
+#### Version 4.1.0 (preview1)
12
21
-#### Drop install.ps1, Rely more on msbuild
13
22
Nuget has moved on from install.ps1. We had one foot in the msbuild camp before, and one foot still in the install.ps1 camp. Time to just jump in with both feet. See the 'RoslynRegisterInConfig' setting description below.
0 commit comments