Solved

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

Posted on 2016-08-08
16
97 Views
Last Modified: 2016-08-10
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?
0
Comment
Question by:lrbrister
  • 7
  • 7
  • 2
16 Comments
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 41747146
exact error please? from the same computer?
0
 

Author Comment

by:lrbrister
ID: 41747168
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
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 41747174
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
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 
LVL 70

Expert Comment

by:Éric Moreau
ID: 41747178
you will find the target framework under the Application tab of the project properties
0
 

Author Comment

by:lrbrister
ID: 41747185
Eric...
SendGridNG is my app

SendGrid is an API Library I am using from a vendor
0
 
LVL 70

Accepted Solution

by:
Éric Moreau earned 400 total points
ID: 41747189
can you change the targeted framework of your app for 4.5.2?
0
 

Author Comment

by:lrbrister
ID: 41747194
On my local machine... yes. it does compile correctly.

However... it does not run when I DBL-CLick on the EXE
0
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 41747201
can you change the targeted framework of your app for 4.5.2 before building the solution (and then try the .exe)?
0
 

Author Comment

by:lrbrister
ID: 41747209
If I set the Target Framework it builds fine
It actually runs in debug perfectly

But the exe is not actually running
0
 
LVL 9

Expert Comment

by:Prakash Samariya
ID: 41747212
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
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 41747218
you may have to clean your solution before rebuilding to have it to work.
0
 

Author Comment

by:lrbrister
ID: 41748695
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
 
LVL 9

Assisted Solution

by:Prakash Samariya
Prakash Samariya earned 100 total points
ID: 41748759
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
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 41748784
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
 

Author Comment

by:lrbrister
ID: 41750414
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
 

Author Closing Comment

by:lrbrister
ID: 41750615
Thanks guys
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
MailAddress in vb 4 29
Retrieve Active Directory Groups a User belongs to in VB.NET 3 20
Access Schema 6 26
need to convert function to c# 5 31
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question