VB.NET WinForm Web Connection stopped working when project was upgraded from .NET 3.5 to 4.0 - .net-4.0

I've got a strange issue that's left me scouring Google for the past couple of hours, but I haven't found anything even close to this.
I have a VB.NET Winforms project containing a class that dynamically generates an image URL for a remotely hosted charting API, and returns the URL as the source to a PictureBox (pbCallChart.ImageLocation = MyURL). This has been in place and working fine for years now. However, I recently had to upgrade the project from .NET 3.5 to .NET 4.0 (I'm working in VS 2010 on a 64-bit build, which apparently won't let you do active debug in .NET 3.5). As soon as I did this, my image stopped showing up.
I verified that the image works when I pull up the URL in a web browser on the same machine that I'm working from. At first I figured maybe that property was removed in 4.0, so I tried switching to the Load() function. No dice. Then I took it one step further and wrote this little function:
Public Function ChartImage() As Bitmap
Dim ChartURL As String = "http://www.anyURL.com/img.jpg" 'Chart()
Return New System.Drawing.Bitmap(New IO.MemoryStream(New System.Net.WebClient().DownloadData(ChartURL)))
End Function
When I run this (and I've confirmed that it doesn't matter what URL I pass it), I always get the error:
An unhandled exception of type 'System.Net.WebException' occurred in System.dll
Additional information: Unable to connect to the remote server
I know this isn't a proxy problem, because it works fine on this same computer under .NET 3.5. And I've confirmed it's not just a debugging quirk, because I compiled executables and provided them to users - they confirmed that the .NET 3.5 version works and the .NET 4.0 version does not.
I can only assume that there must be some security configuration difference in the two versions that I don't know about, but it seems like someone would have mentioned it somewhere. Has anyone else ever experienced anything like this? I'm pretty much out of ideas - do you have any?

Related

VB.NET application compiled to target 4.6.1 framework does't run successfully on Computer with only 4.8 .Net framewor

I intend to build simple Winform application just to allow user to automate their file creation and store the last filled form in a file to keep it for next run.
thus, I'm not interested in creating installer for this simple Winform application. I expected to only compile it to .exe and let it run on other computers.
I develop the application using VS2019 community with target .net 4.6.1
It won't run on computer with Windows 10 with only .net framework 4.8
We are not able to install framework 4.6.1 since it says an earlier version of .net framework is already installed.
Should I recompile my application with target .net framework 4.8?
Can't I compile my application to run on any computer which at least has 4.6.1 or newer? without installer.
(I don't really understand the .net framework backward compatibility truly mean)
my application uses:
library of user32.dll for SetForegroundWindow function
to create .ini file
Finally it works. Even compiled to target .NET 4.6.1 still work on .NET 4.8 computer actually.
The issue is because my application is targeting to another application using interope COM interface, while the license is not sufficient for the user to allow COM interface.
we notice it when we finally create a pure simple windows form, then step-by-step compiling while adding each feature.
Sorry Every Body for this silly case. And my special apologize to evry1falls for spending your time.
I'm thinking to change this Question or delete it. because it is not the issue at all
The Actual Issue is:
I created Windows Form Application starting from a blank Project. And I don't know that the .NET Unhandled Exception is not activated by default.
When created from Windows Form Project Template, the Unhandled Exception message shown.
I created another Question about it: Here

Asp.net Core application is not running with VS 2017?

I have installed the visual studio 2017 for ASP.Net Core. I created Dot Net Core project. Build it successfully and run it but on Firefox it shows the blank page and on chrome it shows "**The localhost page isn’t working
localhost is currently unable to handle this request"
I thought there is a problem in code. I debugged the code and there is nothing wrong with the code. It's the default template and code generated for Asp.Net Core. I googled and tried many things like restart the VS, removed cache, etc but nothing worked for me. Then i uninstalled the VS 2017 and used C Cleaner to remove all temp files etc and installed the visual studio 2017 again but the same error came again. Then i created MVC application, console application in VS 2017 and both worked fine. Issue comes only in Asp.net core application. I use fiddler to see the request status and it is 500. I debugged the code but nothing wrong with the code(No Exception). I have tried many things but did not find anything helpful. Can anyone tell me what's the issue?
The blank page response can be caused by a number of reasons. Sometimes because you are lacking something in the system , routing issues, wrong code on the wrong location, .csproj configuration issues, permission issues, and many more.
There are a couple of things you can try:
Check to see if you have the appropriate ASP.NET Core Module installed in you system. (Either x86 or x64 depending on your system )
Make sure you have enabled IIS Integration in your code
See if you have the error middleware in your Configure code, it mostly helps to solve your issues by giving full detail.
Looks like you are running into error similar to this issue with browserlink .What version of browser link package do you have in your machine
Microsoft.VisualStudio.Web.BrowserLink should be 1.0.1 referring the templates
This SO post discuss the similar issue .If that does not solve, Please make sure you have 1.0.1 in your project referenced and then try this
Clearing your NuGet cache
dotnet nuget locals all --clear
Set Environment variable DOTNET_SKIP_FIRST_TIME_EXPERIENCE to 1 . This is to avoid caching packages
dotnet restore
Does it happens to be runtime compilation issues?
I stumble across this issues log while studying the feasibility of using ASP.Net Core for ERP System host on LinuxOS.
Issues #2017 on GitHub
Try setting
<PreserveCompilationContext>false<PreserveCompilationContext>
in your csproj

AIR App crashes at Extension context creation on one machine but works fine on others

I am using an ane in our AIR application which works fine except on some machines(I have access to one such machine).
I tried other ane on that machine and that is running just fine.
Now after spending hours and hours I have come to know that the app crashes at this line:
objExtCtx = ExtensionContext.createExtensionContext("device.boost.NativeAdd",null);
this call never returns and my app crashes :(
What's more is everything works when I debug the application on that same machine.
This problem is common but no solution is available.
Any help will be appreciated.
Thank you.
I got the answer :)
seems like my c++ code was using some managed code and hence was dependent on .net framework and by default the target was set to .net 4.0.
Now my code crashes on the machines which have .net 3.5 or lower.
I think changing the target .net version should do fine..will update my answer if it does.
EDIT1: seems like vs2008 is needed to change the dependency to .net 3.5 and that too full version, as express version doesn't contain all the libraries required in the project.
So now the required platform becomes .net 4.0 .

The type initializer for 'PayPal.Manager.ConfigManager' threw an exception >Paypal SetExpressCheckout

for some reason I am getting an error "cannot read config file" when trying to set the SetExpressCheckout, I have copied across the web config settings, but for some reason I cannot read them, the error isn't very helpful other than what I have mentioned.
I am using mvc4, and to be honest I have had a problem reading the web.config in the past..
any suggestions would be much appreciated.
Just looked at this... thought it might help someone. Looked at the Inner Exception, saw it was looking for the Log4Net dll... so I gave it to the app and hey ho. It worked.
I had a similar problem and ended up getting both the core and merchant sdk source from GitHub. Change the SpecificVersion=True to False for the log4net reference in the core sdk and re-build it. I also re-targeted both for .net 4.0 so I re-built the merchant sdk with a reference to the new core sdk. Import both of these new dll's to your main project and you should be good to go. I had to change the config in 1 place for the section handler.
<section name="paypal" type="PayPal.Manager.SDKConfigHandler, PayPalCoreSDK"/>
since the Assembly name does not have the underscores if built from source (vs downloaded or added via NuGet).
A bit of explanation:
I was already using log4net version 1.11 before adding the sdk. The sdk was looking specifically for version 1.10. these 2 versions have a different public key, so 'simple' binding redirection won't work. If you have a reference to a different version of log4net (for example using ninject logging extensions requires min version 2.11 so these 2 ninject and the paypal sdk, are incompatible off the shelf).
so the root of the problem was actually caused by the dll version issues but manifested as a Configuration exception. check the inner exceptions and see what you get.
ok, just a quick update, I think it must be something to do with MVC, I have created a new empty asp project, copied the sdk config details across, created the same function call as I have in my mvc code, and called it from a simple asp button... and it works ??
does anyone have any ideas why I am getting an error in an mvc4 project, and not in a simple asp project ??
any help or ideas would be much appreciated.

Script Error on aspx page: running .NET 1.1 on 64

I have a namespace like this in one of my aspx pages (.NET 1.1)
<%# Register TagPrefix="jwg" Namespace="Janus.Web.GridEX" Assembly="Janus.Web.GridEX" %>
This code used to run alright in .Net 1.1 on a 32 bit system but recently we are porting it to 64 bit system (only the run time not the development environment). It has already been ported successfully on one 64 bit system - however that was done like months ago and I have now completely forgotten what all settings were done at that time (and unfortunately I did not take any notes at the time).
Everything runs fine except for few pages where I use the above mentioned namespace registration tag. It is throwing me a script error error at run time from browser saying that An error has occurred in the script on this page. Error: 'GridEx' is undefined. Do you want to continue running scripts on this page? The DLL in the bin is same as it is in on the another 64 bit working box. All other setttings on IIS seems to be working fine since I was able to set .NET 1.1 app pool on it and run the entire application.
Thanks.
In the Visual Studio I removed all the references and created them once again (choosing the path to bin directory of the project) and this resolved this issue... What was probably happening that even though in properties of the references it was showing the path to bin, but somehow the whole thing needed to be refreshed to reflect it into the compiled project file. Its Visual Studio 2003.
Thanks guys.