Closed threezool closed 7 years ago
@threezool
Thanks for contributing!
@warpech @miyconst
Can you guys take a look at this too, from the app dev side? You would know better if this is something we are missing and/or if there are already plans for something similar. @Mackiovello is already busy reviewing the actual code, and I can take on me to review the technical aspects (i.e. the actual project settings, etc).
@threezool
You request to merge this into develop
, meaning 2.4
. Note that we currently have a non-compatible leap 2.3 -> 2.4, meaning projects should be configured differently for each target.
The project template you provide is compatible with 2.3, but not 2.4. So either this merge should go into v2.3
, or you should adapt to 2.4, i.e. develop
branch.
Details are here: https://github.com/Starcounter/Starcounter.VisualStudio/wiki/Version-compatibility#how-do-i-migrate-a-project-from-21-3--24-or-vice-versa
@per-samuelsson
Since its already in 2.3 we can start there and after it gets merged i could adapt it for 2.4. I'm guessing that 2.3 resides in the master branch instead of the develop branch?
Implements: Starcounter/Starcounter#4114
The let's invite @jwillmer and ask for his review if he can find the time.
How can I test it? Do you have a vsix file for me or is it already integrated in a nightly starcounter build?
@jwillmer
Sounds really time consuming. Let me give you feedback as soon as you have worked out how to ship it to the end user.
@jwillmer
I made a .vsix file for the template and it should work, first time i had to make one. The template should now also be under the Starcounter node with this installer.
I have (only) VisualStudio 2015 on this machine.
Yah i just noticed that its limited to VS 2017 atm, looking in to making it compatible for VS 2015 also.
Try to give the VSIX a good name already since it is used to auto update and don't forget to always increase the version number after changes so that all systems will recognize it as an update.
There, figured out how to set the appropriate version for the vsix installer.
VisualStudio 2015:
<entry>
<record>613</record>
<time>2017/03/21 16:24:35.691</time>
<type>Error</type>
<source>Editor or Editor Extension</source>
<description>Microsoft.VisualStudio.ExtensibilityHosting.InvalidMEFCacheException: The Visual Studio component cache is out of date. Please restart Visual Studio.
 at Microsoft.VisualStudio.ExtensibilityHosting.FaultCatchingAssemblyLoader.<LoadAssembly>b__15_0(AssemblyName assemblyNameParam)
 at Microsoft.VisualStudio.ExtensibilityHosting.Utilities.SafeGetOrAdd[TKey,TValue](IDictionary`2 dictionary, TKey key, Object lockObj, Func`2 valueFactory)
 at Microsoft.VisualStudio.ExtensibilityHosting.FaultCatchingAssemblyLoader.LoadAssembly(AssemblyName assemblyName)
 at Microsoft.VisualStudio.Composition.Reflection.TypeRef.get_ResolvedType()
 at Microsoft.VisualStudio.Composition.LazyMetadataWrapper.Enum32Substitution.get_ActualValue()
 at Microsoft.VisualStudio.Composition.LazyMetadataWrapper.SubstituteValueIfRequired(Object value)
 at Microsoft.VisualStudio.Composition.LazyMetadataWrapper.SubstituteValueIfRequired(String key, Object value)
 at Microsoft.VisualStudio.Composition.LazyMetadataWrapper.TryGetValue(String key, Object& value)
 at _proxy_Microsoft.VisualStudio.Text.Utilities.IWpfTextViewMarginMetadata_7e5c586b-2c09-40d6-893a-63049b022746.get_GridUnitType()
 at Microsoft.VisualStudio.Text.Utilities.ContainerMargin.AddMargin(IWpfTextViewMargin margin, Lazy`2 marginProvider, Boolean trackVisibility)
 at Microsoft.VisualStudio.Text.Utilities.ContainerMargin.AddMargins(IList`1 providers, List`1 oldMargins)
 at Microsoft.VisualStudio.Text.Utilities.ContainerMargin.Initialize()
 at Microsoft.VisualStudio.Text.Editor.Implementation.RightControlMarginProvider.CreateMargin(IWpfTextViewHost wpfTextViewHost, IWpfTextViewMargin marginContainer)
 at Microsoft.VisualStudio.Text.Utilities.ContainerMargin.<AddMargins>b__25_1(IWpfTextViewMarginProvider mp)
 at Microsoft.VisualStudio.Text.Utilities.GuardedOperations.InstantiateExtension[TExtension,TMetadata,TExtensionInstance](Object errorSource, Lazy`2 provider, Func`2 getter)</description>
</entry>
Second start of VisualStudio worked without this error.
File Structure:
Comments:
Handle.Get
but be aware that I could also use "My space Project" and that this breaks the handler. (There is a function to remove spaces)http://localhost:8080
but you can't expect that I would know which path I need to enter in order to see the appREADME
that tells the user the next steps [..]
for bindings in HTML and describe the differenceSimplified
DLL. It is especially a problem in the beginning to think about the Copy Local: false
flagIf I browse to http://localhost:8080/StarcounterApplication1
I get:
System.ArgumentOutOfRangeException: Das angegebene Argument liegt außerhalb des gültigen Wertebereichs.
Parametername: Can not find referenced Html file: "/StarcounterApplication1/viewmodels/MainPage.html"
bei Starcounter.HtmlFromJsonProvider.ProvideFromFilePath[T](String filePath) in C:\TeamCity\BuildAgent\work\sc-2824\Level1\src\Starcounter\Middleware\HtmlFromJsonProvider.cs:Zeile 58.
bei Starcounter.HtmlFromJsonProvider.Invoke(MimeProviderContext context, Action next) in C:\TeamCity\BuildAgent\work\sc-2824\Level1\src\Starcounter\Middleware\HtmlFromJsonProvider.cs:Zeile 53.
bei Starcounter.Internal.JsonMimeConverter.Convert(Request request, IResource before, MimeType mimeType, MimeType& resultingMimeType) in C:\TeamCity\BuildAgent\work\sc-2824\Level1\src\Starcounter.Apps.JsonPatch\BuiltInRestHandlers\JsonMimeConverter.cs:Zeile 18.
bei Starcounter.Json.AsMimeType(MimeType mimeType, MimeType& resultingMimeType, Request request) in C:\TeamCity\BuildAgent\work\sc-2824\Level1\src\Starcounter.XSON\Class Json\Json.IResource.cs:Zeile 43.
bei Starcounter.Response.ConstructFromFields(Request req, Byte[] givenBuffer) in C:\TeamCity\BuildAgent\work\sc-2824\Level1\src\Starcounter.Internal\Http\Response.cs:Zeile 809.
bei Starcounter.Request.SendResponse(Response resp, Byte[] serializationBuf) in C:\TeamCity\BuildAgent\work\sc-2824\Level1\src\Starcounter.Internal\Http\Request.cs:Zeile 1241.
bei Starcounter.Internal.AppsBootstrapper.ProcessExternalRequest(Request req) in C:\TeamCity\BuildAgent\work\sc-2824\Level1\src\Starcounter.Apps.JsonPatch\AppsBootstrapper.cs:Zeile 811.
ParamName=Can not find referenced Html file: "/StarcounterApplication1/viewmodels/MainPage.html"
HResult=-2146233086
More information about this error may be available in the server error log.
It is especially a problem in the beginning to think about the Copy Local: false flag
FWIW, this is changed in 2.4. There, we are switching to other private assemblies (i.e. Copy local: true
), which is the default for standard projects.
Ping @threezool. This was a good initiative. Where are we on this?
Have had some other things to do but it is not forgotten. Just need to find the time.
Let's not have so much work laying on the floor. Maybe it is best to merge as it is and split @jwillmer's comments (most, if not all, of which are valid) into separate issues?
Its ok with me, i can transfer over the points in to separate issues to be worked on. It would also be easier to find the time if they are split.
This PR is was not updated in a while. Please consider speeding up the review, splitting the changes into smaller tasks or anything else that makes it easier to decide about merging before it starts to smell.
Merging and will add the points from @jwillmer as issues instead.
The template contains boilerplate code for a new Starcounter app with the folder structure and basic handlers and viewmodels in place.