Comments (26)
The binaries are, at the moment and because we're in a beta phase, not released on the NuGet servers, etc. The only place where you can find them all is on the release page, ie 2.0.0-beta9 as I'm writing this.
So you probably do not want to build the binaries by yourself.
Should you still want to rebuild... because we're building a Visual Studio Extensions you need to install the proper Visual Studio SDK. Have updated the Building & Versionning doc accordingly.
from modelsbuilder.original.
DOH! I didn't see the releases tab. Sorry! Going to go hang my head in shame now.
from modelsbuilder.original.
Ok i got the package and the extension installed but the package didn't add any items to my web.confg.
So i have added the following items that need:
<add key="Zbu.ModelsBuilder.EnableApi" value="true"/>
<add key="Zbu.ModelsBuilder.ModelsNamespace" value="UmbracoBase.Web.Models.DocumentTypes"/>
And i have added a builder class and set the custom tool and set the properties in the zbu options.
When i save the class i now get the following error:
Warning 22 Found conflicts between different versions of the same dependent assembly that could not be resolved. These reference conflicts are listed in the build log when log verbosity is set to detailed. UmbracoBase.Web
Where is the build log and have i missing something?
from modelsbuilder.original.
If you want to use the Visual Studio extension... you do not need to enable the API as it is enabled by default, and you do not need to indicate a namespace in web.config as the Visual Studio extension is going to override it anyway. So it's normal that there's nothing in web.config.
Good that you are testing all this, will help me improve the doc.
Regarding the warning that you get... this is strange. It happens when you save the file... so probably when the extension triggers. Can you hit View | Output in Visual studio and find the extension's output (you have to pick the right "Show output from..." & I can't remember which one it is in). Can you copy/paste the whole thing here?
from modelsbuilder.original.
1st issue was id put the wrong login name (damn having to use an email because i cant get used to not using admin!) :)
i got this error:
ZbuModelsBuilder: Starting 7/20/2014 1:02:41 PM.
ZbuModelsBuilder: ZbuModelsBuilder failed to generate code: Exception: Response status code does not indicate success (Unauthorized)
ZbuModelsBuilder: at Zbu.ModelsBuilder.AspNet.ModelsBuilderApi.EnsureSuccess(HttpResponseMessage result)
at Zbu.ModelsBuilder.AspNet.ModelsBuilderApi.ValidateClientVersion()
at Zbu.ModelsBuilder.CustomTool.CustomTool.ZbuModelsBuilder.GenerateRaw(String wszInputFilePath, String wszDefaultNamespace, IntPtr[] rgbOutputFileContents, UInt32& pcbOutput, String& errMsg)
So i changed the username and now im getting this:
ZbuModelsBuilder: Starting 7/20/2014 1:03:48 PM.
ZbuModelsBuilder: ZbuModelsBuilder failed to generate code: Exception: Response status code does not indicate success (InternalServerError)
{"Message":"An error has occurred.","ExceptionMessage":"Could not load file or assembly 'Microsoft.CodeAnalysis.CSharp, Version=0.7.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)","ExceptionType":"System.IO.FileLoadException","StackTrace":" at Zbu.ModelsBuilder.Building.CodeParser.Parse(IDictionary2 files)\r\n at Zbu.ModelsBuilder.AspNet.ModelsBuilderApiController.GetModels(GetModelsData data)\r\n at lambda_method(Closure , Object , Object[] )\r\n at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.<>c__DisplayClass13.<GetExecutor>b__c(Object instance, Object[] methodParameters)\r\n at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.Execute(Object instance, Object[] arguments)\r\n at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.<>c__DisplayClass5.<ExecuteAsync>b__4()\r\n at System.Threading.Tasks.TaskHelpers.RunSynchronously[TResult](Func
1 func, CancellationToken cancellationToken)"}
ZbuModelsBuilder: at Zbu.ModelsBuilder.AspNet.ModelsBuilderApi.EnsureSuccess(HttpResponseMessage result)
at Zbu.ModelsBuilder.AspNet.ModelsBuilderApi.GetModels(Dictionary`2 ourFiles, String modelsNamespace)
at Zbu.ModelsBuilder.CustomTool.CustomTool.ZbuModelsBuilder.GenerateRaw(String wszInputFilePath, String wszDefaultNamespace, IntPtr[] rgbOutputFileContents, UInt32& pcbOutput, String& errMsg)
Be good to add to docs to view Output window for errors because i didnt know where to look.
from modelsbuilder.original.
Yes, I'm waiting 'till we sort out your issues and then will update the doc accordingly.
As for the missing assembly error... my mistake. Beta-9 is broken, I forgot to update a dependency in the NuGet package. Stupid, stupid me. Uploading beta-10 asap, stay tuned. Sorry, really....
from modelsbuilder.original.
Hey no problem - happy to help to get this working with you.
from modelsbuilder.original.
Just me know how to upgrade the package as i seem to remember reading you cant do an update - so how to remove and re-add as im a little unfamiliar outside nuget.
from modelsbuilder.original.
You can now get new files from beta10. I think that you do not need to update the Visual Studio extension, so just try to keep it unchanged. As for the package... are you using the Umbraco package? Best to uninstall and re-install then.
from modelsbuilder.original.
no im using the nuget package but added manually
from modelsbuilder.original.
Mmm... dunno how you're supposed to update a manually installed (from file) nuget package. Either Google for it or uninstall/reinstall I guess.
from modelsbuilder.original.
I uninstalled the packages and added v10
but im still getting an error:
ZbuModelsBuilder: Starting 7/20/2014 1:23:37 PM.
ZbuModelsBuilder: ZbuModelsBuilder failed to generate code: Exception: Response status code does not indicate success (InternalServerError)
{"Message":"An error has occurred.","ExceptionMessage":"Could not load file or assembly 'Microsoft.CodeAnalysis.CSharp, Version=0.7.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)","ExceptionType":"System.IO.FileLoadException","StackTrace":" at Zbu.ModelsBuilder.Building.CodeParser.Parse(IDictionary2 files)\r\n at Zbu.ModelsBuilder.AspNet.ModelsBuilderApiController.GetModels(GetModelsData data)\r\n at lambda_method(Closure , Object , Object[] )\r\n at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.<>c__DisplayClass13.<GetExecutor>b__c(Object instance, Object[] methodParameters)\r\n at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.Execute(Object instance, Object[] arguments)\r\n at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.<>c__DisplayClass5.<ExecuteAsync>b__4()\r\n at System.Threading.Tasks.TaskHelpers.RunSynchronously[TResult](Func
1 func, CancellationToken cancellationToken)"}
ZbuModelsBuilder: at Zbu.ModelsBuilder.AspNet.ModelsBuilderApi.EnsureSuccess(HttpResponseMessage result)
at Zbu.ModelsBuilder.AspNet.ModelsBuilderApi.GetModels(Dictionary2 ourFiles, String modelsNamespace) at Zbu.ModelsBuilder.CustomTool.CustomTool.ZbuModelsBuilder.GenerateRaw(String wszInputFilePath, String wszDefaultNamespace, IntPtr[] rgbOutputFileContents, UInt32& pcbOutput, String& errMsg) ZbuModelsBuilder: Starting 7/20/2014 1:23:59 PM. ZbuModelsBuilder: ZbuModelsBuilder failed to generate code: Exception: Response status code does not indicate success (InternalServerError) {"Message":"An error has occurred.","ExceptionMessage":"Could not load file or assembly 'Microsoft.CodeAnalysis.CSharp, Version=0.7.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)","ExceptionType":"System.IO.FileLoadException","StackTrace":" at Zbu.ModelsBuilder.Building.CodeParser.Parse(IDictionary
2 files)\r\n at Zbu.ModelsBuilder.AspNet.ModelsBuilderApiController.GetModels(GetModelsData data)\r\n at lambda_method(Closure , Object , Object[] )\r\n at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.<>c__DisplayClass13.b__c(Object instance, Object[] methodParameters)\r\n at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.Execute(Object instance, Object[] arguments)\r\n at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.<>c__DisplayClass5.b__4()\r\n at System.Threading.Tasks.TaskHelpers.RunSynchronously[TResult](Func1 func, CancellationToken cancellationToken)"} ZbuModelsBuilder: at Zbu.ModelsBuilder.AspNet.ModelsBuilderApi.EnsureSuccess(HttpResponseMessage result) at Zbu.ModelsBuilder.AspNet.ModelsBuilderApi.GetModels(Dictionary
2 ourFiles, String modelsNamespace)
at Zbu.ModelsBuilder.CustomTool.CustomTool.ZbuModelsBuilder.GenerateRaw(String wszInputFilePath, String wszDefaultNamespace, IntPtr[] rgbOutputFileContents, UInt32& pcbOutput, String& errMsg)
ZbuModelsBuilder: Starting 7/20/2014 1:25:11 PM.
ZbuModelsBuilder: ZbuModelsBuilder failed to generate code: Exception: Response status code does not indicate success (InternalServerError)
{"Message":"An error has occurred.","ExceptionMessage":"Could not load file or assembly 'System.Collections.Immutable, Version=1.1.22.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)","ExceptionType":"System.IO.FileLoadException","StackTrace":" at Zbu.ModelsBuilder.Building.Compiler.GetCompilation(String assemblyName, IDictionary2 files, SyntaxTree[]& trees)\r\n at Zbu.ModelsBuilder.Building.CodeParser.Parse(IDictionary
2 files)\r\n at Zbu.ModelsBuilder.AspNet.ModelsBuilderApiController.GetModels(GetModelsData data)\r\n at lambda_method(Closure , Object , Object[] )\r\n at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.<>c__DisplayClass13.b__c(Object instance, Object[] methodParameters)\r\n at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.Execute(Object instance, Object[] arguments)\r\n at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.<>c__DisplayClass5.b__4()\r\n at System.Threading.Tasks.TaskHelpers.RunSynchronously[TResult](Func1 func, CancellationToken cancellationToken)"} ZbuModelsBuilder: at Zbu.ModelsBuilder.AspNet.ModelsBuilderApi.EnsureSuccess(HttpResponseMessage result) at Zbu.ModelsBuilder.AspNet.ModelsBuilderApi.GetModels(Dictionary
2 ourFiles, String modelsNamespace)
at Zbu.ModelsBuilder.CustomTool.CustomTool.ZbuModelsBuilder.GenerateRaw(String wszInputFilePath, String wszDefaultNamespace, IntPtr[] rgbOutputFileContents, UInt32& pcbOutput, String& errMsg)
from modelsbuilder.original.
I have uninstalled the extension also and added v10 extension. Now i get a different error:
ZbuModelsBuilder: Starting 7/20/2014 1:31:05 PM.
ZbuModelsBuilder: ZbuModelsBuilder failed to generate code: Exception: Response status code does not indicate success (InternalServerError)
{"Message":"An error has occurred.","ExceptionMessage":"Could not load file or assembly 'System.Collections.Immutable, Version=1.1.22.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)","ExceptionType":"System.IO.FileLoadException","StackTrace":" at Zbu.ModelsBuilder.Building.Compiler.GetCompilation(String assemblyName, IDictionary2 files, SyntaxTree[]& trees)\r\n at Zbu.ModelsBuilder.Building.CodeParser.Parse(IDictionary
2 files)\r\n at Zbu.ModelsBuilder.AspNet.ModelsBuilderApiController.GetModels(GetModelsData data)\r\n at lambda_method(Closure , Object , Object[] )\r\n at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.<>c__DisplayClass13.b__c(Object instance, Object[] methodParameters)\r\n at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.Execute(Object instance, Object[] arguments)\r\n at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.<>c__DisplayClass5.b__4()\r\n at System.Threading.Tasks.TaskHelpers.RunSynchronously[TResult](Func1 func, CancellationToken cancellationToken)"} ZbuModelsBuilder: at Zbu.ModelsBuilder.AspNet.ModelsBuilderApi.EnsureSuccess(HttpResponseMessage result) at Zbu.ModelsBuilder.AspNet.ModelsBuilderApi.GetModels(Dictionary
2 ourFiles, String modelsNamespace)
at Zbu.ModelsBuilder.CustomTool.CustomTool.ZbuModelsBuilder.GenerateRaw(String wszInputFilePath, String wszDefaultNamespace, IntPtr[] rgbOutputFileContents, UInt32& pcbOutput, String& errMsg)
from modelsbuilder.original.
Damn. See, I have updated the Roslyn dependency to use their latest version, and obviously something's wrong.
Can you right-click on you project in VS, "Manage NuGet Packages", and tell me which packages exactly are installed (with version)? There should be Zbu.ModelsBuilder, which depends on Microsoft.CodeAnalysis.CSharp, which depends on Microsoft.CodeAnalysis.Common, which depends on Microsoft.Bcl.Immutable which therefore should be there too!
from modelsbuilder.original.
on its way
from modelsbuilder.original.
Got your email. Now I see what the issue is. Microsoft.CodeAnalysis.Common wants Microsoft.Bcl.Immutable >= 1.1.20... so if there's nothing yet it installs 1.1.20... but on my dev machine I updated both Roslyn and Microsoft.Bcl.Immutable so now I have 1.1.22, so when I build Zbu.ModelsBuilder it wants that one.
So I guess... there's going to be a beta-11 ;-(
That being said, you should be able to fix it right now on your side: go to Manage NuGet Package then go to Updates and there should be updates for Microsoft Immutable Collections and maybe also *Microsoft ECMA-335 Metadata Reader". Do update both, and then all should be fine.
NuGet updates sure are fun ;-((
from modelsbuilder.original.
Ill get the update from you because that package is pointing to the old libs so will need updating also.
from modelsbuilder.original.
OK, can you try beta11?
What a mess -- really sorry about it.
from modelsbuilder.original.
ZbuModelsBuilder: Starting 7/20/2014 2:38:02 PM.
ZbuModelsBuilder: ZbuModelsBuilder failed to generate code: Exception: Panic: no projets.
ZbuModelsBuilder: 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)
from modelsbuilder.original.
Is this a config issue?
from modelsbuilder.original.
Exit and restart Visual Studio. That one is an internal VS error, don't know what to do about it.
from modelsbuilder.original.
Ah i just did a rebuild on the project and voila!
:)
Nice one... Thanks Stephan.
I'll go check it all out now.
from modelsbuilder.original.
WOOT!
from modelsbuilder.original.
I have a similar issue...
I installed the VS extension using the vsix file, not nuget, and used the umbraco package to install ModelBuilder to the umbraco website (via the Dev section int he back-end). Perhaps this wasn't wise?
Anyway, initially, the CustomTool in VS worked fine, but subsequently, if I attempt to run it (either by editing and saving the file, or by right-clicking and choosing "Run Custom Tool"), I get this error:
{"Message":"An error has occurred.","ExceptionMessage":"Could not load file or assembly 'Microsoft.CodeAnalysis, Version=0.7.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.","ExceptionType":"System.IO.FileNotFoundException","StackTrace":" at Zbu.ModelsBuilder.Building.CodeParser.Parse(IDictionary`2 files)\r\n at Zbu.ModelsBuilder.AspNet.ModelsBuilderApiController.GetModels(GetModelsData data)\r\n at lambda_method(Closure , Object , Object[] )\r\n at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.<>c__DisplayClass13.<GetExecutor>b__c(Object instance, Object[] methodParameters)\r\n at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.Execute(Object instance, Object[] arguments)\r\n at System.Threading.Tasks.TaskHelpers.RunSynchronously[TResult](Func`1 func, CancellationToken cancellationToken)"}
ZbuModelsBuilder: at Zbu.ModelsBuilder.AspNet.ModelsBuilderApi.EnsureSuccess(HttpResponseMessage result)
at Zbu.ModelsBuilder.AspNet.ModelsBuilderApi.GetModels(Dictionary`2 ourFiles, String modelsNamespace)
at Zbu.ModelsBuilder.CustomTool.CustomTool.ZbuModelsBuilder.GenerateRaw(String wszInputFilePath, String wszDefaultNamespace, IntPtr[] rgbOutputFileContents, UInt32& pcbOutput, String& errMsg)
If I uninstall and re-install the VS extension, it will work again, but then stops functioning again later. I assume that something is getting lost somewhere in between system reboots or whatever...
The Package Manager for the project lists no installed packages, and nothing comes up if I do a search for "Microsoft.CodeAnalysis.CSharp", so I can't seem to just add the dependencies.
from modelsbuilder.original.
@hfloyd Installing the VS extension using the VSIX file, and the Umbraco component using the Umbraco package, makes perfect sense.
The error that you see is not linked to the VS extension (so no need to uninstall and re-install) but to some DLLs installed by the Umbraco package. There were some issues with some packages that I released so make sure you are using the latest version.
After you install the Umbraco package, can you check the ~/bin directory of your Umbraco install and ensure that a file named Microsoft.CodeAnalysis.dll
is present in there? Then, when you get the error, can you check again that the file is present?
from modelsbuilder.original.
Thanks, Stephan for your reply.
The version I am using is 2.0.0-beta14 from the releases tab.
The files were missing from my website project, though I'm not sure why they disappeared (or why re-installing the VSIX fixed it initially... very peculiar)
When I re-added them to the bin, it ran without error. Thanks for pointing me in the right direction.
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.