Skip to content
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

All source code cannot be built. #302

Open
milochen0418 opened this issue Jun 29, 2020 · 5 comments
Open

All source code cannot be built. #302

milochen0418 opened this issue Jun 29, 2020 · 5 comments

Comments

@milochen0418
Copy link

I choice x64 Windows 10
I use Visual studio 2019 to open .sln

After I click build. All samples are failed to build.
Even I try to change AnyCPU into x64, the IDE still built it in AnyCPU and then get failed again.

Could any one write basic document to show how to build the code?

@vatsan-madhavan
Copy link
Member

vatsan-madhavan commented Jun 29, 2020

After git clean -xdf, I opened WPFSamples.sln in Visual Studio, and hit F6/Build; it built cleanly for me. I'm on Visual Studio 16.7.0 Preview 4.0 [30226.3.master].

If you look at global.json at the root of the repo, it requires 3.1.301, which corresponds to Visual Studio 2019 16.6. In general, this repo requires the latest supported version of Visual Studio, fully updated.

@ryalanms, please consider fixing up the docs. At present, it just says this:

To build the samples, open one of the solution files in Visual Studio 2019 and build the solution.

One simplification could be made IMO to the repo policy for the duration of .NET Core 3.1 - fixing global.json to 3.1.201, which is basically the first fully functional (wrt WPF) SDK in the 3.1 line (dotnet/wpf#2274), and letting the latestFeature policy in global.json kick in helpfully for developers who aren't (yet) fully up-to date. In turn, this would allow us to assert that the min. required VS version is Visual Studio 2019 version 16.5.

If you decide to update this, remember to update altsdk.netcoreapp3.1 as well in global.json to be in sync with 3.1.201.

@milochen0418
Copy link
Author

milochen0418 commented Jun 30, 2020

Thanks for your reply ! ~
I found this official document to come here. So I thought this samples code might be easily built by many developer.
https://docs.microsoft.com/en-us/dotnet/framework/wpf/getting-started/walkthrough-my-first-wpf-desktop-application
As a open source application developer, we open run sample code first and then we can learn quickly on the samples code. Then we can quickly learn and use it to develop.

This information of Visual Studio 2019 Home Edition that I use. I download it yesterday (version 16.6.2)
I install Visual Studio 2019 on Windows 10 Home
Screen Shot 2020-06-30 at 9 46 32 AM

This is what happen when I built
Screen Shot 2020-06-30 at 9 49 12 AM

And this is my what I can see in Configure Manager
Screen Shot 2020-06-30 at 9 40 06 AM

I have tried it three days and I still have no idea why the code cannot be built.
If I would like to build the samples WPF-Samples, what should I do next?
Could anyone help me ?

Thanks !

@milochen0418
Copy link
Author

milochen0418 commented Jun 30, 2020

Hello @vatsan-madhavan :)

The code can be built now by Visual Studio 2019 Version 16.6.2!

I checkout the old version code.

 git clean -xdf
 git checkout 863659c68ce44b430775edf3fd513c3325cac8ef
 start WPFSamples.sln

Screen Shot 2020-06-30 at 3 59 41 PM

Right now , I can use this resource to develop WPF application.

Thanks for your information

@milochen0418
Copy link
Author

It would be helpful if some people could prepare some document to guide the new developer to checkout some branch, so they can enjoy sample code in their Visual Studio quickly. And your team can keep going to develop.

@milochen0418
Copy link
Author

milochen0418 commented Jun 30, 2020

There is some way for Visual Studio 2019 to built WPF-Samples

$ git clone https://github.com/microsoft/WPF-Samples 
$ cd WPF-Samples 
$ dotnet.exe restore WPFSamples.sln
$ dotnet.exe restore WPFSamples.msbuild.sln

Then we can open command line to start these solution (I use Git Bash because I like bash )

$ start WPFSamples.sln
$ start WPFSamples.msbuild.sln

Or we can use Visual Studio 2019 to build it.

Hi @vatsan-madhavan
Many WPF project on the internet cannot also built by Visual Studio 2019
Maybe this issue should report to the Visual Studio 2019 team, so that the IDE can auto-detect some old-style file know the issue and then IDE can call something like dotnet.exe restore to restore solution.

So user can use that project directly

Because there are not too much people know how to process this issue when they first time to use Visual Studio but maybe they need to evaluate Windows solution quickly. So in that case, Visual Studio should be support it so that people can use a lot of open source solution from internet .

I think many developer will love it.

Is that a good idea ?

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

No branches or pull requests

2 participants