.Net project compiles and runs in debug but...

I have a .Net project that builds and runs fine in debug mode

But when I compile and try and run the executeable... it doesn't run.

Says that there is a .Net 4.5.1 versus 4.5.2 issue?
lrbristerAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
Éric MoreauConnect With a Mentor Senior .Net ConsultantCommented:
can you change the targeted framework of your app for 4.5.2?
0
 
Éric MoreauSenior .Net ConsultantCommented:
exact error please? from the same computer?
0
 
lrbristerAuthor Commented:
1>------ Build started: Project: SendGridNG, Configuration: Debug Any CPU ------
1>C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets(1820,5): warning MSB3274: The primary reference "SendGrid, Version=7.0.2.0, Culture=neutral, PublicKeyToken=4f047e93159395ca, processorArchitecture=MSIL" could not be resolved because it was built against the ".NETFramework,Version=v4.5.2" framework. This is a higher version than the currently targeted framework ".NETFramework,Version=v4.5.1".
1>  SendGridNG -> C:\Projects\Brand Tango\GitHub\SendGridNG\bin\Debug\SendGridNG.exe
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
Éric MoreauSenior .Net ConsultantCommented:
is it possible that you have a solution with (at least) 2 projects (SendGridNG and SendGrid)? Check the properties of both (or all) projects to make sure they are all targeting the same version of the framework
0
 
Éric MoreauSenior .Net ConsultantCommented:
you will find the target framework under the Application tab of the project properties
0
 
lrbristerAuthor Commented:
Eric...
SendGridNG is my app

SendGrid is an API Library I am using from a vendor
0
 
lrbristerAuthor Commented:
On my local machine... yes. it does compile correctly.

However... it does not run when I DBL-CLick on the EXE
0
 
Éric MoreauSenior .Net ConsultantCommented:
can you change the targeted framework of your app for 4.5.2 before building the solution (and then try the .exe)?
0
 
lrbristerAuthor Commented:
If I set the Target Framework it builds fine
It actually runs in debug perfectly

But the exe is not actually running
0
 
Prakash SamariyaIT ProfessionalCommented:
Install Microsoft .NET Framework 4.5.2 and try with your executable!
https://www.microsoft.com/en-in/download/details.aspx?id=42643

For more info please check below link
https://msdn.microsoft.com/en-us/library/bb822049(v=vs.110).aspx
0
 
Éric MoreauSenior .Net ConsultantCommented:
you may have to clean your solution before rebuilding to have it to work.
0
 
lrbristerAuthor Commented:
OK... one of the issues was the library I was referencing.
Reverting to 4.5 allowed to build with no errors.
BUT...
When I double click on the EXE... the form is NOT running
SP1SP2
0
 
Prakash SamariyaConnect With a Mentor IT ProfessionalCommented:
What type of error message it shows?
Are you trying to execute on different machine with other .net framework?

I have created one sample Win form and it works!
0
 
Éric MoreauSenior .Net ConsultantCommented:
but isn't your library targeting 4.5.2? You would be better to have the app to target the same version.

>>When I double click on the EXE... the form is NOT running

Any exceptions? What is the behavior?
0
 
lrbristerAuthor Commented:
Eric and Prakash...
The other machine in fact had a corrupted version of 4.5.2

I would like to award 400/100 to you guys if there are no objections
0
 
lrbristerAuthor Commented:
Thanks guys
0
All Courses

From novice to tech pro — start learning today.