Comments (34)
Seing this error in the Visual Studio extension? With the website running in IIS Express on port 53105? Is the website running?
from modelsbuilder.original.
Yes, Yes, Yes, it is running.
I had to make IIS Express works with http://127.0.0.1 like there:
https://cyanbyfuchsia.wordpress.com/2014/07/29/make-iis-express-works-with-http127-0-0-1/
In Output window
from modelsbuilder.original.
Cool. So you solved it? Anything I could do to make things easier for you?
from modelsbuilder.original.
I just updated to v.2.1.2 (VS extension, nuget package, and umbraco website package) and when running the Custom Tool for the models to build in VS, it failed with a similar error:
ZbuModelsBuilder: Starting v2.1.2.42 5/6/2015 8:05:16 PM.
ZbuModelsBuilder: ZbuModelsBuilder failed to generate code: WebException: Unable to connect to the remote server
ZbuModelsBuilder: at System.Net.HttpWebRequest.GetResponse()
at System.Xml.XmlDownloadManager.GetNonFileStream(Uri uri, ICredentials credentials, IWebProxy proxy, RequestCachePolicy cachePolicy)
at System.Xml.XmlDownloadManager.GetStream(Uri uri, ICredentials credentials, IWebProxy proxy, RequestCachePolicy cachePolicy)
at System.Xml.XmlUrlResolver.GetEntity(Uri absoluteUri, String role, Type ofObjectToReturn)
at System.Xml.XmlTextReaderImpl.FinishInitUriString()
at System.Xml.XmlTextReaderImpl..ctor(String uriStr, XmlReaderSettings settings, XmlParserContext context, XmlResolver uriResolver)
at System.Xml.XmlReaderSettings.CreateReader(String inputUri, XmlParserContext inputContext)
at System.Xml.XmlReader.Create(String inputUri, XmlReaderSettings settings, XmlParserContext inputContext)
at Zbu.ModelsBuilder.CustomTool.VisualStudio.VisualStudioHelper.ToHierarchy(Project project)
at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
at System.Linq.Enumerable.<CastIterator>d__b1`1.MoveNext()
at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable`1 source, Func`2 predicate)
at Zbu.ModelsBuilder.CustomTool.VisualStudio.VisualStudioHelper.GetSourceItem(String inputFilePath)
at Zbu.ModelsBuilder.CustomTool.CustomTool.ZbuModelsBuilder.GenerateRaw(String wszInputFilePath, String wszDefaultNamespace, IntPtr[] rgbOutputFileContents, UInt32& pcbOutput, String& errMsg)
ZbuModelsBuilder: Inner: SocketException: No connection could be made because the target machine actively refused it 127.0.0.1:57319
ZbuModelsBuilder: at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Exception& exception)
I am running my site via regular IIS with a custom url (ex: mysite.local) which is setup in my local HOSTS file. I use that domain in the options dialog for the Zbu extension. It always worked fine in previous versions, so I'm not sure what changed.
from modelsbuilder.original.
In addition... if I follow the instructions in the link provided by Lechus, and change the config to:
<bindings>
<binding protocol="http" bindingInformation="*:57319:127.0.0.1" />
</bindings>
I get the same error from Zbu...
Changing it to use my custom domain name:
<binding protocol="http" bindingInformation="mysite.local" />
doesn't work either.
from modelsbuilder.original.
What URL have you configured in Zbu.ModelsBuilder config (in the Tools | Options menu) ?
from modelsbuilder.original.
My custom IIS url (mysite.local)
from modelsbuilder.original.
So if you browse http://mysite.local/ on any browser, it works, but if Visual Studio tries to connect, it fails? But... hold on, hold on: the exception is throw in VisualStudioHelper.GetSourceItem
which in turns invokes VisualStudioHelper.ToHierarchy
and at that point we're not trying to connect to your site at all.
It's an entirely different problem. And I'm glad you posted your stacktrace - should have paid more attention to it.
The ToHierarchy
method creates an XmlReader
to read the project file in order to retrieve the project's GUID. Or so it seems (I must admit that I've copied that part of the code). So that reader should read a local file. Why it tries to connect to some remote url... I need to work on it to understand.
Re-opening the issue.
from modelsbuilder.original.
Would it be OK to share your the csproj file of the project that contains the file using the custom tool? You can email it to me if you don't want it posted here.
from modelsbuilder.original.
Sure. Where can I find your email? Or DM me on Twitter (HFloyd)
from modelsbuilder.original.
Le 07/05/2015 18:01, Heather Floyd a écrit :
Sure. Where can I find your email?
from modelsbuilder.original.
Sent :-)
from modelsbuilder.original.
Hi Stephan,
Just wondering if you had any ideas about this. I can't update models any longer :-(
from modelsbuilder.original.
(have been offline a couple of days - back - looking at it asap)
from modelsbuilder.original.
Hi Stephan,
Just wanted to add that I set Zbu up in a completely different project and am having the same issue when attempting to "Run Custom Tool" to generate the models, so it isn't specific to that one project.
from modelsbuilder.original.
This is the output when I run it on the new project:
ZbuModelsBuilder: Starting v2.1.2.42 5/22/2015 2:14:44 PM.
ZbuModelsBuilder: ZbuModelsBuilder failed to generate code: WebException: Unable to connect to the remote server
ZbuModelsBuilder: at System.Net.HttpWebRequest.GetResponse()
at System.Xml.XmlDownloadManager.GetNonFileStream(Uri uri, ICredentials credentials, IWebProxy proxy, RequestCachePolicy cachePolicy)
at System.Xml.XmlDownloadManager.GetStream(Uri uri, ICredentials credentials, IWebProxy proxy, RequestCachePolicy cachePolicy)
at System.Xml.XmlUrlResolver.GetEntity(Uri absoluteUri, String role, Type ofObjectToReturn)
at System.Xml.XmlTextReaderImpl.FinishInitUriString()
at System.Xml.XmlTextReaderImpl..ctor(String uriStr, XmlReaderSettings settings, XmlParserContext context, XmlResolver uriResolver)
at System.Xml.XmlReaderSettings.CreateReader(String inputUri, XmlParserContext inputContext)
at System.Xml.XmlReader.Create(String inputUri, XmlReaderSettings settings, XmlParserContext inputContext)
at Zbu.ModelsBuilder.CustomTool.VisualStudio.VisualStudioHelper.ToHierarchy(Project project)
at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
at System.Linq.Enumerable.<CastIterator>d__b1`1.MoveNext()
at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable`1 source, Func`2 predicate)
at Zbu.ModelsBuilder.CustomTool.VisualStudio.VisualStudioHelper.GetSourceItem(String inputFilePath)
at Zbu.ModelsBuilder.CustomTool.CustomTool.ZbuModelsBuilder.GenerateRaw(String wszInputFilePath, String wszDefaultNamespace, IntPtr[] rgbOutputFileContents, UInt32& pcbOutput, String& errMsg)
ZbuModelsBuilder: Inner: SocketException: No connection could be made because the target machine actively refused it 127.0.0.1:65202
ZbuModelsBuilder: at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Exception& exception)
from modelsbuilder.original.
It's always the same thing - reading an Xml file causes the reader to try and access some external resource it cannot find - still trying to understand ;-((
from modelsbuilder.original.
Very strange stuff... Am I the only one experiencing an error on that?
from modelsbuilder.original.
Not sure if this helps at all...
http://stackoverflow.com/questions/24096657/no-connection-could-be-made-because-the-target-machine-actively-refused-it-127-0
BTW - I turned off the Windows Firewall service and still get the error.
from modelsbuilder.original.
Another stab-in-the-dark...
I noticed a recent file updated was 2dad5eb which did effect the "ToHierarchy" method... which was referenced in the stack trace:
at Zbu.ModelsBuilder.CustomTool.VisualStudio.VisualStudioHelper.ToHierarchy(Project project)
from modelsbuilder.original.
Unfortunately both seem to be non-related. I feel really sorry ;-( I just cannot figure out what's happening. But I don't give up.
from modelsbuilder.original.
Well, if there is anything I can do to help with the debugging, let me know...
from modelsbuilder.original.
Hi Stephan,
I have figured something out.
The address that is erroring is
127.0.0.1:65202
And I noticed that the hostname my colleague had added to the main site node is
http://localhost:65202/
Coincidence? Perhaps not.
However, I also have my "site.local" domain name assigned as a hostname on the same node, and in the ModelsBuilder options I have "http://site.local" as the Umbraco Url, so I wasn't sure why it would be grabbing the other hostname with the port... or why my colleague doesn't have a similar issue when using the tool.
As an experiment, I removed the "http://localhost:65202/" hostname from the site node and ran "/umbraco/dialogs/republish.aspx?xml=true", but when I pop back over to VS, I am getting the same error, with reference to "127.0.0.1:65202"
So, I took a look in the VS .sln file and see this:
Project("{E24C65DC-7377-472B-9ABA-BC803B73C61A}") = "UmbracoCms(9)", "http://localhost:65202", "{CDD64279-76E3-4057-A118-778F06B5B58F}"
I can't update the sln to use "http://site.local" in the Project configuration because I get this error on re-opening:
Error opening web http://site.local. The Web Site 'http://site.local' is configured to use IIS Express as the web server but the URL is currently configured on the local IIS web server. To open this Web Site, you must use IIS Manager to remove the bindings using this URL from the local IIS web server.
So, I removed the website project from the solution and re-added it from IIS, so it was displaying as "http://site.local/" rather than how we usually add it via the file system (UmbracoCms)
When I ran ModelsBuilder then, it completed successfully!
The only problem is that not everyone in our dev team uses IIS and sets up "site.local" domain names... adding the website via the File system is always how we have done it. So, considering that ModelsBuilder used to work with that arrangement... I wonder if something related to domain resolution changed in ModelsBuilder?
As a further experiment, I removed the website project entirely from the solution so that it only contained the custom code project with the models, etc. I then ran the Custom Tool again successfully!
So, it seems that ModelsBuilder doesn't NEED the website in the VS solution in order to run... but if it IS there, the domain name is being checked & used for some reason.
If it would be possible for you to change that behavior it would be great... Otherwise I will have to be continually removing & re-adding the website project to the solution...
Thanks!
from modelsbuilder.original.
Glad that it works but this is super-weird - will run some experiments today.
from modelsbuilder.original.
Oh my... think I have it.
The error you're seeing is in VisualStudioHelper.GetSourceItem()
in ZbuModelsBuilder.GenerateRaw()
. When GetSourceItem
is invoked, we have already checked that the extension version is compatible with the site, ie we have already talked to the site at the address that is configured in the options. So the site is answering fine.
And then we iterate the projects and invoke ToHierarchy
for each project, which reads the project file using an xml reader - and that reader internally decides to talk to the site that is configured in the web project. Probably when parsing that web project. When you remove the web project from the solution, it's not parsed anymore and it works.
Turns out, this is a normal project in a .sln file:
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Zbu.ModelsBuilder", "Zbu.ModelsBuilder\Zbu.ModelsBuilder.csproj", "{998FB014-303A-4146-B3E4-B927BAB0210F}"
and this is a web project:
Project("{E24C65DC-7377-472B-9ABA-BC803B73C61A}") = "UmbracoCms(9)", "http://localhost:65202", "{CDD64279-76E3-4057-A118-778F06B5B58F}"
and ToHierarchy
is trying to read the file from project.FileName
ie... from that url. And it fails, because there is nothing listening there. Of course, fixing the .sln file, etc. is a solution but really, we don't want to parse web projects at all because you are not supposed to put the custom tool file in there.
So what we want is to exclude web projects. I just merged a PR because someone else wanted to exclude the Solution Items entry... will create a beta release with those project types excluded, for you to test.
from modelsbuilder.original.
Version 2.1.3-beta001 is released, for you to test. Let me know!
from modelsbuilder.original.
Thank you, Stephan,
But it's still not working...
ZbuModelsBuilder: Starting v2.1.3.43 5/29/2015 12:14:40 PM.
ZbuModelsBuilder: ZbuModelsBuilder failed to generate code: WebException: Unable to connect to the remote server
ZbuModelsBuilder: at System.Net.HttpWebRequest.GetResponse()
at System.Xml.XmlDownloadManager.GetNonFileStream(Uri uri, ICredentials credentials, IWebProxy proxy, RequestCachePolicy cachePolicy)
at System.Xml.XmlDownloadManager.GetStream(Uri uri, ICredentials credentials, IWebProxy proxy, RequestCachePolicy cachePolicy)
at System.Xml.XmlUrlResolver.GetEntity(Uri absoluteUri, String role, Type ofObjectToReturn)
at System.Xml.XmlTextReaderImpl.FinishInitUriString()
at System.Xml.XmlTextReaderImpl..ctor(String uriStr, XmlReaderSettings settings, XmlParserContext context, XmlResolver uriResolver)
at System.Xml.XmlReaderSettings.CreateReader(String inputUri, XmlParserContext inputContext)
at System.Xml.XmlReader.Create(String inputUri, XmlReaderSettings settings, XmlParserContext inputContext)
at Zbu.ModelsBuilder.CustomTool.VisualStudio.VisualStudioHelper.ToHierarchy(Project project)
at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
at System.Linq.Enumerable.<CastIterator>d__b1`1.MoveNext()
at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable`1 source, Func`2 predicate)
at Zbu.ModelsBuilder.CustomTool.VisualStudio.VisualStudioHelper.GetSourceItem(String inputFilePath)
at Zbu.ModelsBuilder.CustomTool.CustomTool.ZbuModelsBuilder.GenerateRaw(String wszInputFilePath, String wszDefaultNamespace, IntPtr[] rgbOutputFileContents, UInt32& pcbOutput, String& errMsg)
ZbuModelsBuilder: Inner: SocketException: No connection could be made because the target machine actively refused it 127.0.0.1:65202
ZbuModelsBuilder: at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Exception& exception)
I ran the one update NuGet package in my custom code project, and the other on the UmbracoCMs project, and installed the VSIX update...
from modelsbuilder.original.
I'm happy to help further test new builds as needed.
from modelsbuilder.original.
I have emailed you a DLL on 6/3 - have you received it?
from modelsbuilder.original.
Thanks for letting me know I hadn't seen it, and now I have found it in my Spam folder. Maybe due to the attached file...
Anyway, I'll get it installed ans tested within the next hour. :-)
from modelsbuilder.original.
Your report was just what I needed. Emailed another DLL that should fix the issue now. Let me know!
from modelsbuilder.original.
Stephan, you're brilliant! Thanks so much. It works beautifully now :-)
from modelsbuilder.original.
Woohoo!
from modelsbuilder.original.
Hi Stephan,
Sorry to comment on a closed issue but I am getting the same error. The DLL that has the fix can I grab from nuget git etc??
Thanks
Ad
from modelsbuilder.original.
Related Issues (20)
- Generating models using the VS extension can cause namespace issues HOT 3
- Cleaner csproj include generated files HOT 1
- Can't Rebuild Models After Deleting Document Type HOT 6
- Interface definition only generated when document type is in use HOT 1
- Request error: The URL returned a 404 (not found): /App_Plugins/ModelsBuilder/modelsbuilder.html HOT 1
- Provide option for generated code to use Language Fallback HOT 7
- ModelsBuilder API Generates first IPublishedElement then never finishes HOT 10
- VS Extension: Method not found: 'System.String Umbraco.ModelsBuilder.Building.Compiler.CreateValidIdentifier(System.String)' HOT 2
- v4: Repository shouldnt link to local nuget server
- v4: If Document type with Template is created Umbraco fails with save of Document Type
- Implemented property keeps being generated HOT 6
- ModelsBuilder on Umbraco v8.8 HOT 10
- v4: Generator should be swappable / extendable
- Generated Models missing PublishedElementModel on generated model.
- Stack Overflow when implementing same interface in generated and partial class
- VS Extension install issue
- Execute ModelsBuilder Programmatically
- When generating models for IPublishedElement it adds a controller no matter what
- UmbracoModelsBuilder: UmbracoModelsBuilder failed to generate code: NullReferenceException HOT 1
- VS2022 HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from modelsbuilder.original.