New Project Missing After Closing and Re-Opening VS2017

Greetings -
I've added a new project to the 'application.sln' in VS2017. Every time I close the SLN file and re-open, the newly added project is missing. I then have to re-add it (Right click-->Add-->Existing Project...).

I'm getting the below error in VS2017 after I've re-added the missing project and tried to re-build.

Severity Code Description Project File Line Suppression State
Error It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS. D:\UserData\Documents\Radzen Projects\zfDemo_dotNet2\client\node_modules\selenium-webdriver\lib\test\data\Web.Config 29

Should I be able to add additional Project to the 'application.sln'?

Thanks!

...additionally, seeing this error when I try to build/run the Radzen application...

radzen: Generating code ...
radzen: Code generation done in 59ms.
dotnet: C:\Program Files\dotnet\sdk\2.2.104\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.ObsoleteReferences.targets(33,5): warning NETSDK1059: The tool 'Microsoft.EntityFrameworkCore.Tools.DotNet' is now included in the .NET Core SDK. Information on resolving this
dotnet: warning is available at (Breaking changes in .NET Core 2.1 - .NET | Microsoft Learn). [D:\UserData\Documents\Radzen Projects\zfDemo_dotNet2\server\project.csproj]

dotnet: C:\Program Files\dotnet\sdk\2.2.104\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.ObsoleteReferences.targets(33,5): warning NETSDK1059: The tool 'Microsoft.EntityFrameworkCore.Tools.DotNet' is now included in the .NET Core SDK. Information on resolving this warning is available at (Breaking changes in .NET Core 2.1 - .NET | Microsoft Learn). [D:\UserData\Documents\Radzen Projects\zfDemo_dotNet2\server\project.csproj]

dotnet: C:\Program Files\dotnet\sdk\2.2.104\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.DefaultItems.targets(153,5): warning NETSDK1071: A PackageReference to 'Microsoft.AspNetCore.All' specified a Version of 2.0.0. Specifying the version of this package is not recommended. For more information, see .NET project SDK overview | Microsoft Learn [D:\UserData\Documents\Radzen Projects\zfDemo_dotNet2\server\project.csproj]

dotnet: D:\UserData\Documents\Radzen Projects\zfDemo_dotNet2\Zenfolio\Zenfolio.csproj(166,3): error MSB4019: The imported project "C:\Program Files\dotnet\sdk\2.2.104\Microsoft\VisualStudio\v15.0\WebApplications\Microsoft.WebApplication.targets" was not found. Confirm that the path in the declaration is correct, and that the file exists on disk.

dotnet:

dotnet: The build failed. Please fix the build errors and run again.

Hi,

Radzen will write application.sln file only once and will never overwrite it on subsequent runs. You can add as many projects as you need:

You can add also additional dependencies to server/project.csproj and on subsequent runs Radzen will merge the template with your current project file.

Thanks for the reply. I believe I've done all these steps yet the project I add still disappears from application.sln. Here are the exact steps I did to recreate the issue. If a screen recording would be better/helpful, please let me know...

  1. create radzen project w/ c# 2.0
  2. create 1 page in project
  3. build radzen project
  4. stop radzen project
  5. open application.sln
  6. add new project to application.sln --> 'WCF Service Application' --> name it 'Zenfolio'
  7. delete auto generated IService1.cs and Service1.svc
  8. rebuild application.sln --> fails.
  9. close application.sln
  10. run/build Radzen application
  11. re-open application.sln --> Zenfolio Project is missing.

Are you saving the sln file after step 6?

I am saving. :slight_smile:

Additional observations...

  1. re-add Project to application.sln (from file).
  2. save, build and close application.sln
  3. re-open application.sln --> note that 'Zenfolio' project is still present.
  4. close 'application.sln'
  5. build/run Radzen application --> fails.

dotnet: C:\Program Files\dotnet\sdk\2.2.104\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.ObsoleteReferences.targets(33,5): warning NETSDK1059: The tool 'Microsoft.EntityFrameworkCore.Tools.DotNet' is now included in the .NET Core SDK. Information on resolving this warning is available at (Breaking changes in .NET Core 2.1 - .NET | Microsoft Learn). [D:\UserData\Documents\Radzen Projects\zfDemo_001\server\project.csproj]

dotnet: D:\UserData\Documents\Radzen Projects\zfDemo_001\Zenfolio\Zenfolio.csproj(85,3): error MSB4019: The imported project "C:\Program Files\dotnet\sdk\2.2.104\Microsoft\VisualStudio\v15.0\WebApplications\Microsoft.WebApplication.targets" was not found. Confirm that the path in the declaration is correct, and that the file exists on disk.

Not sure in this case what’s going on. Can you run the app normally from Visual Studio or from Command Prompt using dotnet run?

How do you mean? Can I run the Radzen application from VS2017? I'm not sure how to do this.

Additionally, I re-did my above steps w/ minor adjustments...please note my observations below.

  1. rebuild application.sln --> fails.

    Severity Code Description Project File Line Suppression State
    Error Node.js is required to build and run this project. To continue, please install Node.js from https://nodejs.org/, and then restart your command prompt or IDE. project D:\UserData\Documents\Radzen Projects\zfDemo_001\server\project.csproj 30

  2. save/close/re-open application.sln --> NOTE: Zenfolio project is STILL present.

  3. project --> dependencies --> add 'Zenfolio'

  4. save/rebuild application.sln --> fails.

    Severity Code Description Project File Line Suppression State
    Error Node.js is required to build and run this project. To continue, please install Node.js from https://nodejs.org/, and then restart your command prompt or IDE. project D:\UserData\Documents\Radzen Projects\zfDemo_001\server\project.csproj 30

  5. save/close application.sln

  6. run Radzen application --> fails

    Severity Code Description Project File Line Suppression State
    Error Node.js is required to build and run this project. To continue, please install Node.js from https://nodejs.org/, and then restart your command prompt or IDE. project D:\UserData\Documents\Radzen Projects\zfDemo_001\server\project.csproj 30

  7. open application.sln --> Zenfolio project is now MISSING.

You can check this article for more info:
https://www.radzen.com/documentation/run-with-visual-studio/

About missing project I'm afraid that I'm out of ideas. Radzen will not touch the solution file after it is generated for the first time.

I've tried running from VS2017 - The command prompt loads but the UI never does. After a few minutes of waiting, I try to manually navigate to the UI screen (http://localhost:8000/zf-login) but I only get this error...

This site can’t be reached

localhost refused to connect.

ERR_CONNECTION_REFUSED

Regarding this...

It appears that Radzen is making changes to the application.sln file.

To test this I,

  1. Created the project from scratch.

  2. Added the new Project (Zenfolio) to the application.sln file.

  3. Added dependency to Zenfolio w/in application.sln.

  4. Save/Build --> Build is ok.

  5. Closed/Re-Open application.sln --> Confirmed 'Zenfolio' project is still present.

  6. Repeated this step two more times.

  7. Closed application.sln.

  8. COPIED 'applcation.sln' to new folder.

  9. Opened Radzen Project.

  10. Build/Run --> failed.
    dotnet: D:\UserData\Documents\Radzen Projects\zfDemo_001\Zenfolio\Zenfolio.csproj(166,3): error MSB4019: The imported project "C:\Program Files\dotnet\sdk\2.2.104\Microsoft\VisualStudio\v15.0\WebApplications\Microsoft.WebApplication.targets" was not found. Confirm that the path in the declaration is correct, and that the file exists on disk.

    dotnet:

    dotnet: The build failed. Please fix the build errors and run again.

  11. Closed Radzen

  12. Compared 'application.sln' and the COPY of 'application.sln' from step 8 above and observed that the 'applcation.sln' has changed. Please see below.

Again - it appears that 'application.sln' did NOT change until I opened the Radzen Project and did a build/run.


Hmm ... it seems that you are right. We will release fix immediately!

1 Like

Radzen 2.11.4 was just released!

1 Like

Thanks for the fast update on this!

SOOOO close! :wink:

With 2.11.4, the added project remains in application.sln even after the build/run from Radzen.

However, one error remains.

Observations:

  1. Add new WCF 'Zenfolio' Project to application.sln
  2. Do NOT add dependency in 'project' to 'Zenfolio'
  3. Save/Build/Close application.sln
  4. Open Radzen project - run build --> builds and run WITHOUT error.
  5. Stop Radzen / Close.
  6. Re-Open 'application.sln' --> 'Zenfolio' project STILL present (as expected - yay!)
  7. 'project' --> Dependencies --> Add Reference --> Select 'Zenfolio'
  8. Save/Build --> Build is ok.
  9. Close 'application.sln'
  10. Re-open Radzen
  11. Build/Run --> ERROR.

radzen: Generating code ...
radzen: Code generation done in 68ms.
dotnet: C:\Program Files\dotnet\sdk\2.2.104\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.ObsoleteReferences.targets(33,5): warning NETSDK1059: The tool 'Microsoft.EntityFrameworkCore.Tools.DotNet' is now included in the .NET Core SDK. Information on resolving this warning is available at (Breaking changes in .NET Core 2.1 - .NET | Microsoft Learn). [D:\UserData\Documents\Radzen Projects\zfDemo_002\server\project.csproj]

dotnet: C:\Program Files\dotnet\sdk\2.2.104\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.ObsoleteReferences.targets(33,5): warning NETSDK1059: The tool 'Microsoft.EntityFrameworkCore.Tools.DotNet' is now included in the .NET Core SDK. Information on resolving this warning is available at (Breaking changes in .NET Core 2.1 - .NET | Microsoft Learn). [D:\UserData\Documents\Radzen Projects\zfDemo_002\server\project.csproj]

dotnet: D:\UserData\Documents\Radzen Projects\zfDemo_002\Zenfolio\Zenfolio.csproj(166,3): error MSB4019: The imported project "C:\Program Files\dotnet\sdk\2.2.104\Microsoft\VisualStudio\v15.0\WebApplications\Microsoft.WebApplication.targets" was not found. Confirm that the path in the declaration is correct, and that the file exists on disk.

dotnet:

dotnet: The build failed. Please fix the build errors and run again.

Further Observations:

  1. Close Radzen
  2. Re-open 'applicaiton.sln'
  3. Remove dependency from step 7 above.
  4. Save/Build/Close
  5. Re-open Radzen
  6. Build/Run --> No Errors.

It seems that adding the project dependency to the newly added project in VS2017 is breaking Radzen...

Unfortunately I was unable to reproduce such problem locally however I've found that there are lot of similar reports:

Can you try some of the solutions in your csproj - maybe this one?

Thanks again. Though I don't completely understand this issue, I was able to resolve it by adding the following Nuget feed to my 'application.sln'
https://www.nuget.org/packages/MSBuild.Microsoft.VisualStudio.Web.targets/