# Former project in VS2017 and v10.0.0.2255 and webrequest

**URL:** https://talk.remobjects.com/t/former-project-in-vs2017-and-v10-0-0-2255-and-webrequest/15754
**Category:** Oxygene
**Created:** [March 12, 2018, 3:31am UTC](https://talk.remobjects.com/t/former-project-in-vs2017-and-v10-0-0-2255-and-webrequest/15754 "2018-03-12T03:31:07Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![lhsoft](https://talk.remobjects.com/letter_avatar_proxy/v4/letter/l/35a633/32.png) [@lhsoft](https://talk.remobjects.com/u/lhsoft)
#### Post date: [March 12, 2018, 3:31am UTC](https://talk.remobjects.com/t/former-project-in-vs2017-and-v10-0-0-2255-and-webrequest/15754/1 "2018-03-12T03:31:08Z")

</div>

Hello,  
according to Microsoft the Syntax of webrequest should be:  
var req: System.Net.WebRequest := System.Net.WebRequest.Create(URL: String);

If doing so in a new Project (from your web template in VS2017) i get Error \<Cannot instantiate abstract class “WebRequest”\>

If opening my Project Directory from former VS2015 and Oxygen v9.3.xxx in VS2017, there is no Compiler error at the same Code file in VS2017. and the whole (huge) Project works fine.  
the lines are within a class method:

> class method globalfuncs.isHor(Img: System.String): System.Boolean;  
> begin  
> var Im: System.Drawing.Image;  
> try  
> if System.Environment.MachineName.ToUpper.StartsWith(‘XXX’) then  
> begin  
> var req: System.Net.WebRequest := System.Net.WebRequest.Create(globalvar.ImageURL + Img);  
> var res: System.Net.WebResponse := req.GetResponse;  
> var st: System.IO.Stream := res.GetResponseStream;  
> Im := System.Drawing.Image.FromStream(st);  
> end else  
> Im := System.Drawing.Image.FromFile(globalvar.ImagePath + Img);  
> var ImgW: System.Single := Im.PhysicalDimension.Width;  
> var ImgH: System.Single := Im.PhysicalDimension.Height;  
> if ImgH \> ImgW then Result := False else Result := True;  
> Im.Dispose;  
> except  
> if Im \<\> nil then Im.Dispose;  
> Result := False;  
> end;  
> end;

Do you have any ideas?

There is another strange behavior might bring an idea:  
if opening old Directory with the web application in VS2017, the files \*.aspx and \*.aspx.pas are not grouped any more, the Debugger does not work propperly, the CC does not work and moving mouse over objects like WebRequest shows “unknown type”, but application compiles and works without Problems.

if creating a new Project from your templates in VS2017, the files are grouped, the Debugger works, the CC works and all objects are wellknown. I copied about 8000 lines of my Code in this new Project and all works but only WebRequest does not as described above.

I tried a few hours but found no idea for a solution.

Can you help me?

best regards  
Hans

---

<div class="post-metadata">

### Author: ![JohnMoshakis](https://talk.remobjects.com/user_avatar/talk.remobjects.com/johnmoshakis/32/2286_2.png) [@JohnMoshakis](https://talk.remobjects.com/u/JohnMoshakis)
#### Post date: [March 12, 2018, 3:45am UTC](https://talk.remobjects.com/t/former-project-in-vs2017-and-v10-0-0-2255-and-webrequest/15754/2 "2018-03-12T03:45:04Z")

</div>

Is legacy create turned on ?

What happens if you add & before the Create ie

`var req: System.Net.WebRequest := System.Net.WebRequest.&Create(URL: String);`

---

<div class="post-metadata">

### Author: ![lhsoft](https://talk.remobjects.com/letter_avatar_proxy/v4/letter/l/35a633/32.png) [@lhsoft](https://talk.remobjects.com/u/lhsoft)
#### Post date: [March 12, 2018, 11:13am UTC](https://talk.remobjects.com/t/former-project-in-vs2017-and-v10-0-0-2255-and-webrequest/15754/3 "2018-03-12T11:13:17Z")

</div>

Hello,  
yes the reason was the lagacy create enabled. Since turning off, there is no exception any more.

But the second part of the Problem still remains:  
I suppose that the old “Web-Application” til VS2015 does not work any more because if creating a Project with VS2017 in old mode, there is no Oxygen available. Therefore, I guess, CC and nothing else regarding Oxygen is available.

If creating a Project with template Oxygene [ASP.NET](http://ASP.NET) Web-Application, Oxygene works fine but the design files are not updated if writing code to the aspx-file. So I can not use objects of aspx in Code behind without updating the design-file manually. That would be terrible.

What I’m doing wrong?  
How to migrate a web-application from VS2015 to VS2017?

best regards  
hans
