none
.Net Core xproj Problems

    Question

  • I have a project which compiles under several different platforms: Silverlight, UWP, and .Net. However, I'm struggling to get it to compile for .Net Core. I am using Visual Studio 2015 Update 3.

    As a general point, the new xproj format looks like a good idea, but there are two key bugs - at least with the .Net Core implementation. There is also a 3rd big problem that looks like it's going to cause a major headache while I'll explain later.

    1. Conditional Compilation Symbols Broken

    Rather than explain, please download this solution and you will see right away. It's broken. Enough said.

    Conditional Compilation Symbols Broken

    2. Can't Exclude Files

    I much prefer the new system where files are automatically included rather than excluded. It makes far more sense than the other way around. However, this system is useless unless we are able to exclude files. We have a lot of projects where we can't simply delete files where we don't want the code compiled, because other platform versions need that code, in that place. So, please fix this bug. This sample app shows the bug. I've put some code that doesn't compile in a cs file. Then I hid the file file using the context menu. I though this would stop the compilation errors, but it doesn't. Please fix this bug.

    Can't Exclude Files

    3. All project.json files, are named project.json

    The guy who made this design decision must have said to himself "no user is ever going to want to have more than one project file in the same folder." Well guess what! We keep all of our project files in the same place so that we can compile for many different platforms. This seems to be quite a common practice. However, VS seems to be hard coded so that it always looks for project.json no matter what the name of the project is. This is just plain silly. Why can't we specify a different name so that we can maintain multiple projects in the same folder? This setup means that two projects in the same folder try to use the same project.json.


    Sunday, July 24, 2016 6:41 AM

All replies

  • I applied the hot fix that Microsoft told me to install since the release of Update 3. It made no difference.

    Sunday, July 24, 2016 7:24 AM
  • Where are we supposed to report VS bugs these days?

    I've logged a couple on Microsoft Connect and they've promptly been ignore, and then later closed. Who can we actually report this to that has the power to actually do something?

    Sunday, July 24, 2016 9:57 AM
  • I would like to see an article/articles on how design solutions that have projects for multiple platforms, but share the same code. This may seem like a question that would have a straight forward answer, but there isn't a straight forward answer. We have seen some project types switch from csproj files, to xproj format. If you are building a .Net library, you will be using a csproj file. If you are building .Net Core library, you will be using the xproj format. The way these projects behave are almost mutually exclusive. One works by forcing you to include the files you want, the other just lumps every file in your directory structure in to the project. Also, there are many new project types that have a "project.json". That means that you can't have more than one project file in the same folder, because the projects will try to share the project.json.

    I'm not here to ask which is best, or to point out all the flaws in either format. I'm here to ask how does Microsoft recommend that we manage all these different project types?

    This person recommends shooting for portable libraries:

    Portable Libraries (Stackoverflow)

    I find this very odd:

    Portable Libraries

    There's a platform called ASP.Net Core. Really? I thought ASP.Net Core was just a technology built on .Net Core. Is this saying that there's a whole other platform called ASP.Net Core that is separate from .Net Core?

    But, this aside, my largest struggle right now is sharing code across projects. With csproj files, we would just keep all the code in the same directory structure, and have multiple csproj files in the same directory. We have code shared across Silverlight, and .Net this way. We have UWP code shared in almost the same way. In UWP, we simply have an empty folder structure and link all the files in from the other folder structure.

    We need to share code across Silverlight, .Net, .Net Core, iOS, Android, and UWP.

    This has all changed now. It's almost as though we are going to have to have physically separate, duplicated files for all of the project types. The xproj format doesn't allow us to link files from other projects. But, we can't even have to xproj files in the same folder because they will automatically share the project.json file.

    What are we supposed to do? Has Microsoft full thought through all the implications of what they are doing right now?

    Sunday, July 24, 2016 11:13 PM
  • Hello...
    Monday, July 25, 2016 11:37 PM
  • Hi MelbourneDeveloper,

    >>I've logged a couple on Microsoft Connect and they've promptly been ignore, and then later closed.

    Do you mean that you have submitted the connect report before? If so, would you please share me the link here? I will help you add a comment there.

    In addition, if it is related to the specific project, I think we would discuss this issue with the specific developers, so they could provide dedicated support, for example, if it is related to the ASP.NET Core, we could discuss the issue here:

    http://forums.asp.net/1255.aspx/1?ASP+NET+vNext

    Best Regards,

    Jack


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Tuesday, July 26, 2016 8:00 AM
    Moderator
  • Do you mean that you have submitted the connect report before? If so, would you please share me the link here? I will help you add a comment there.

    Not for this problem. No. It was a general statement. Sorry for the confusion.

    In addition, if it is related to the specific project, I think we would discuss this issue with the specific developers, so they could provide dedicated support, for example, if it is related to the ASP.NET Core, we could discuss the issue here:

    http://forums.asp.net/1255.aspx/1?ASP+NET+vNext

    Absolutely. I'd love to discuss the issue with the specific developers. However, this is not an ASP issue. I'm not even building an ASP project. Did you open the recreation solutions that I provided so that you can see the bug? At least two of the problems I have mentioned are explicit bugs in Visual Studio. The first bug however (conditional compilation) may be a problem in Visual Studio, .Net Core, or the compiler team. I don't know which team this problem belongs to hence the forum post.

    Wednesday, July 27, 2016 3:45 AM
  • Because I'm unsure if the first bug I mentioned is related to Visual Studio, or something other project, I have mentioned the bug here:

    Conditional Compilation Bug

    Wednesday, July 27, 2016 4:08 AM
  • Hi MelbourneDeveloper,

    Not a real .NET Core experts, but if we make sure that it really has the feedbacks, you could submit the connect report directly. So we could get the direct response from the product team experts.

    This is the product connect report site:

    https://connect.microsoft.com/VisualStudio/feedback/CreateFeedback.aspx

    It also provide the report way for the .NET Core, maybe discuss this issue in the GitHub would be better before submitting a real feedback.

    Sincerely,

    Jack


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Wednesday, July 27, 2016 12:01 PM
    Moderator
  • I'm not too confident that this will help, but I have logged #1 of my bug list here (Microsoft Connect)

    If I hear anything back about this, I'll log the others. But, I'm not holding my breath.

    Thursday, July 28, 2016 12:39 AM
  • Hi  MelbourneDeveloper,

    Thanks for your response. As you already submit one feedback on the Microsoft Connect site, let's focus on the case on that channel, may the senior members can provide more professional support.

    Best Regards,

    Jack


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Thursday, July 28, 2016 7:21 AM
    Moderator
  • I have 3 problems here. As yet, I've heard nothing back about the issue I've logged. Meanwhile, are there any work arounds or recommended approaches for these issues?
    Monday, August 01, 2016 3:16 AM
  • Hi MelbourneDeveloper,

    Thanks for your friendly response.

    For the connect report issue, Microsoft engineers will evaluate them seriously, I will help you follow up the report, if I get any latest information from the report, I will share it there.

    Since one thread for one issue, if possible, would you please open a new case for a new question? In this way, our discussion here will not deviate too much from the connect issue. This will make answer searching in the forum easier and be beneficial to other community members as well.

    In addition, the VS General forum is to discuss:

    Visual Studio WPF/SL Designer, Visual Studio Guidance Automation Toolkit, Developer Documentation and Help System, and Visual Studio Editor.

    If it is related to the .NET Core, I suggest you discuss this issue with the NET Core experts, so they could really help you troubleshoot the new issue and provide dedicated support.

    please visit our GitHub repositories first and create an issue on GitHub if necessary. https://github.com/dotnet/coreclr/ https://github.com/dotnet/corefx/.

    Of course, if it is just the VS General issue, please feel free to post a new question in this forum.

    Best Regards,

    Jack


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Monday, August 01, 2016 12:19 PM
    Moderator
  • Yep, totally ignored on Microsoft Connect.

    I've logged it here as well:

    https://github.com/dotnet/corefx/issues/10657

    Monday, August 08, 2016 11:20 PM
  • I have documented the problem here with steps to reproduce which explicitly highlight the problem and where the problem lies for #1

    https://github.com/dotnet/cli/issues/4022#issuecomment-238777946


    The issue is because the VS Project is putting the wrong element in the project.json
    Wednesday, August 10, 2016 11:41 PM
  • The xproj format is more or less considered an experiment project type that is going to get scrapped soon. It's a part of the .NET Core tools preview 2. Essentially, nobody in the teams that manage this care. So, we will need to see what happens when they actually release the .NET Core tools.

    Meantime, I've found some workarounds that I am documenting up.

    Monday, August 15, 2016 4:46 AM
  • Thanks for your friendly response, MelbourneDeveloper.

    davidfowl shared some information here in your discussions:

    https://github.com/aspnet/Tooling/issues/723

    If this tool has certain new features or changes in the next released version, the .NET core team experts would share them in the official site or the blogs, so we could pay attentions to the official site and documents.

    In addition, if you have funded good workarounds, would you mind sharing them here? So it would be helpful for other members who met the same issue.

    Sincerely,

    Jack


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    Monday, August 15, 2016 8:49 AM
    Moderator
  • It seems as though the xproj format is going to get dumped, so I've asked the obvious question of what is going on here:

    https://github.com/aspnet/Tooling/issues/754

    Monday, August 29, 2016 12:29 AM
  • Hi MelbourneDeveloper,

    Thanks for your friendly response.

    Since you have posted the issue to the appropriate forum, would you mind changing this thread to be a discussion thread? So I can keep opening this case for you, and other community members who are familiar with the .NET core could share their suggestions here.

    You can change the issue type to Discussion by opening the Options list at the top of the post editor window, and changing the type. 

    Of course, if you get any VS IDE issue, welcome to this forum.

    Sincerely,

    Jack


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Monday, August 29, 2016 2:52 AM
    Moderator