Skip to content

Roslyn compiler is copied to root directory #41

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wpsmmb opened this issue Mar 23, 2018 · 7 comments
Closed

Roslyn compiler is copied to root directory #41

wpsmmb opened this issue Mar 23, 2018 · 7 comments
Assignees

Comments

@wpsmmb
Copy link

wpsmmb commented Mar 23, 2018

Version Used:
1.0.6, 1.0.7, 1.0.8

Steps to Reproduce:
Use the compiler in a non ASP.NET project to compile dynamic assemblies as follow:

string classSource = "// some source"; 

CompilerParameters options = new CompilerParameters {
	GenerateExecutable = false,
	GenerateInMemory = true,
	IncludeDebugInformation = true,
	CompilerOptions = "/define:DEBUG"
};

CodeDomProvider provider = new CSharpCodeProvider();
CompilerResults result = provider.CompileAssemblyFromSource(options, classSource);

Expected Behavior:
Roslyn files will be located in subfolder of the project.

Actual Behavior:
The compiler is copied to 'C:\bin\roslyn' or if the solution is located on drive D the files are copied to 'D:\bin\roslyn'.

@wpsmmb
Copy link
Author

wpsmmb commented Mar 23, 2018

Here you can find a sample project (VS 2017 - 15.5.7, .NET 4.5.1)
https://github.com/wpsmmb/RoslynIssue24940
Same with target framework .NET 4.7.1 and Microsoft.Net.Compilers v2.6.1

As supposed in dotnet/roslyn#24940 reopened here.

@wpsmmb
Copy link
Author

wpsmmb commented Mar 23, 2018

I think #32 will solve this issue.

@bzier
Copy link

bzier commented Apr 19, 2018

@Jinhuafei Do you have any estimate for when the next version (>=1.0.9) will be available on the official/stable channel? I was experiencing this problem on our TeamCity build agent with 1.0.8 and attempted 1.0.9 from your comment here, which seems to have fixed it. Just curious when that version will be released. Thanks.

FYI, our project is a ServiceStack web project. I was a little surprised that the $(WebProjectOutputDir) is not specified for that. However, I was seeing the roslyn stuff get copied to the root of the drive (as mentioned in this issue) and the build failing during OctoPack due to the missing files in the proper output directory.

@Jinhuafei
Copy link
Contributor

@bzier I'm trying to get another fix into the next release, after finish the testing we will publish it. In the meanwhile, can you give it a try with the private build which you can get from this myget feed?

@bzier
Copy link

bzier commented Apr 20, 2018

@Jinhuafei Yes, I pulled the 1.0.9 package from the MyGet feed and that is working for us. Thank you.

@Jinhuafei Jinhuafei self-assigned this May 4, 2018
@Jinhuafei
Copy link
Contributor

2.0.0-preview is released. After upgrading Microsoft.CodeDom.Providers.DotNetCompilerPlatform nupkg, please remember to uninstall Microsoft.Net.Compilers nupkg in your project.

@bzier
Copy link

bzier commented May 4, 2018

Thanks for the update @Jinhuafei

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants