VS 2022: An error occured while loading the project properties editor. System.ArgumentException: Expected _ values Build::DefineConstants, but got _ - version

I use Visual Studio 17.3.5
I have this error: An error occured while loading the project properties editor. System.ArgumentException: Expected _ values Build::DefineConstants, but got _
Projects can't be loaded properly. There is a warning beside all faulty projects.
It happen when I was trying to working with projects configurations (Build-Configuration Manager). I was trying to add "x64" configuration. But I wasn't able to do so for 3 projects on 20. It was blocked (can't do it) but it seems that it worked in reality creating a new duplicate configuration for each of my try.

I had an update to do, so I updated VS2022 to 17.3.6.
The update fixed my problem. But it is possible that a simple restart would have suffice. I don't remember I try it but I think so.

Related

"ERROR: General failure building project output groups" while creating Set Up project in Visual Studio 2019

I made a Windows Form App for borehole heat exchangers simulation, consisting only of one Form. When trying to build a set up project to install the app, I constantly get an error in the building. Message appears like below, and 4 times each message. All this is using Visual Studio 2019 updated.
ERROR: General failure building project output groups
ERROR: Unrecoverable build error - 0x80004005
I checked that every image used in the app are in the source file, that I have done the building in the right order, but every time I create a project output, no .xml file appears.
Although I think it should be not an issue, the program also created a Form1.resx file that sends a message (not an error, neither a warning) Object reference not set to an instance of an object. I donĀ“t remember creating such thing. I tried to erase it and almost got my app deleted.
Does anybody now what can be the problem and how to fix it?
Mainly my process consisted in building classes that represent different modellings of a borehole heat exchanger. I then made the program build an "borehole" object of the certain class you choose in a ComboBox. I had no fundamentals whatsoever in coding so maybe this is not the way I should do that, maybe it shouldn't be classes. The app works perfectly on debugging mode.
Public Class Modelo2D
Inherits ModeloNTU
Public ReadOnly Property Calor2D As Double
Is there a problem in this?

Visual Studio DB project: model already has an element that has the same name

I am currently working on a build of a Solution with several Database Projects (Staging, Core, Business) in Visual Studio 2013. Unfortunately I get into troubles, when i have the same object in different projects.
Error: SQL71508: The model already has an element that has the same name DIM.
As there are build dependencies, the first project will be able to CREATE the schema DIM. The second one will fail. Therefore a lot of errors will be thrown.
How am i able to solve this issue?
It was very confusing, but what finally solved my issue was:
saving & closing the solution
removing all *.dbmdl files (each project had one)
reopening the solution
Reopening took a while, but finally those errors were gone.
Function of DBMDL files

Enable-Migrations causes project failed to build

I have created a sample WPF project, worked fine.
I added a MVVMLight project, made it a default startup project, and ran fine.
Now I added a class library project, and added an ADO.NET data model with "Code First From Database", and selected relevant tables, that gave me a good collection of entity classes.
I thought this way, I can keep my data model seperate from presentation and businesss logic layers, plus add additional target plateforms if needed and take the advantage of SoC.
So far so good.
Now I want to enable Migrations on my data layer only. I fired up Nuget console, selected dataLayer project in the "Default Project" drop down. Issued Enable-Migrations command and very first error I got was
"No connection string named 'dpFinDataModel' could be found in the application config file."
Now I modified Startup project - i.e. Mvvm project's App.Config to add App.Config details from DataLayer project.
Tried to rerun "Enable-Migrations", and following error occured:
PM> Enable-Migrations
The project 'dpFinMvvm' failed to build.
Am I doing something wrong here?
Will this approach work?
Thanks for all your help.
-DP
1) PM> Enable-Migrations would get an error if your project itself contains errors.
Try going through your code such as in debug mode and check if you have any build errors then try.
2) And for your config file error you may have not referenced it properly, try this tutorial to solve your issue.
http://www.asp.net/mvc/overview/getting-started/getting-started-with-ef-using-mvc/creating-a-more-complex-data-model-for-an-asp-net-mvc-application

Entity Framework (Code First) and WPF

Originally, I was following along in this ASP.NET MVC4 tutorial on using EF: http://www.asp.net/mvc/tutorials/getting-started-with-ef-using-mvc/creating-an-entity-framework-data-model-for-an-asp-net-mvc-application
Everything worked fine there, so I tried to replicate it in WPF and I can't get the localDb (MDF) file to generate.
I've tried this tutorial on EF which uses a Console app instead of ASP.NET: http://msdn.microsoft.com/en-us/data/jj193542
Again, it works fine in the Console, but trying to do it in WPF in the MainWindows.xaml.cs fails.
Any ideas?
EDIT: (I'm using VS2012 and .NET 4.5)
EDIT2: Yes, I'm getting this error:
{"'The invocation of the constructor on type 'MyProgram.MainWindow' that matches the specified binding constraints threw an exception.' Line number '3' and line position '9'."}
EDIT3: Apparently that exception above is very common and unhelpful. The solution I found elsewhere is to press CTRL + ALT + E and check every box and click OK and re run the application. Then a helpful exception shows up. (I'm still figuring out what this new one is.)
EDIT4: Well, I got it working. A call to Console.ReadLine() is illegal in WPF. Who knew? (I guess it makes sense.) Now I'm trying my own CodeFirst design and running into a different error.
Check your user folder (C:\Users\UserName)
When I followed the example, the mdf file got created here.
So the answer was to turn on all exceptions by pressing CTRL + ALT + E and selecting all check boxes.
Then I got the real exception which was: Cannot open database "MyDatabase" requested by the login. The login failed.
The solution was found here: EF 4.1 code first causes weird (login) runtime errors
I had to delete the SUO file (and re-enable everything again via CTRL + ALT + E) and then I found another (new) error, which I fixed, and everything was fine.
Create (don't copy) the EF context in a separate project. Then it can be accessed from a console application or a WPF application. That separates the concerns and will lead you to diagnosing the problems quicker. Note that you will need to add the connection string as found in the EF project appconfig in any project which is a consumer of the EF project you created.

Cannot publish because a project failed to build and Could not find file 'obj\x86\Debug\MyApplication.exe' Errors

I am striving to get the source of my issue but no luck. I did check almost all suggestions to fix this problem when publishing project (publishing using right-click, checked DevExpress is not installed).
-Regarding DevExpress the application have some of it's assemblies.
- Cannot publish because a project failed
- Could not find file 'obj\x86\Debug\MyApplication.exe'
I did send publishing diagnostic to the Output and get this :
Task "GenerateApplicationManifest" (TaskId:158)
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(2580,9): error MSB3113: Could not find file 'obj\x86\Debug\MyApplication.exe'.
Done executing task "GenerateApplicationManifest" -- FAILED. (TaskId:158)
Done building target "GenerateApplicationManifest" in project "MyApplication.csproj" -- FAILED.: (TargetId:194)
Can someone list all things I have to check to get this issue fixed ?
I just ran into the problem today. In my particular case, it was caused by this Microsoft Windows Update.
I uninstalled that update and publish began working as it always had. This is only a temporary work around and means you should probably regenerate your keys/certificates.
Right click on you Project
Click Publish
Go to Settings Tab
Click File Publish Options
Check All the options in the tab (As seen in attached image)

Resources