ASP.NET MVC Scaffoldinghttp://mvcscaffolding.codeplex.com/project/feeds/rssScaffolding package for ASP.NETCommented Unassigned: assembly directive requires full path to project assemblies [61]http://mvcscaffolding.codeplex.com/workitem/61I&#39;m trying to reference a solution generated assembly from a T4 template that I&#39;m invoking from the Package Manager Console using the pattern of .ps1 and .cs.t4 template files created by &#34;scaffold customscaffolder&#34;.<br /><br />If I add an assembly reference like this&#58;<br /><br /> &#60;&#35;&#64; assembly name&#61;&#34;C&#58;&#92;full&#92;path&#92;to&#92;solution&#92;project&#92;bin&#92;foobar.dll&#34; &#35;&#62;<br /><br />it works. But that won&#39;t work for anyone else...<br /><br />If I attempt this&#58;<br /><br /> &#60;&#35;&#64; assembly name&#61;&#34;&#36;&#40;ProjectDir&#41;bin&#92;foobar.dll&#34; &#35;&#62;<br /><br />it fails to find the assembly. &#40;Yes the assembly is in the bin subfolder of the project selected as the &#34;Default Project&#34; for the Package Manager Console.<br /><br />I recognize this may be a T4Scaffolding package issue. Or just me being clueless.<br />Any help in understanding how best to do this would be appreciated.<br /><br />Comments: I&#39;ve tried just using the assembly name without the &#34;.dll&#34; extension and it still cannot find the assembly. I&#39;ve also tried signing the assembly &#40;as suggested elsewhere&#41; with no luck. I don&#39;t understand how it can&#39;t find it when it&#39;s part of the same solution. The only thing that works is the full path, which &#40;as mentioned&#41; is not very team-friendly. The project&#47;assembly that scaffolding can&#39;t find is my Resources project which is just the resource files required for internationalization.jeepdude2009Thu, 12 Jun 2014 17:25:51 GMTCommented Unassigned: assembly directive requires full path to project assemblies [61] 20140612052551PCreated Unassigned: Cannot implicitly convert type 'System.Data.EntityState' to 'System.Data.Entity.EntityState'. [64]http://mvcscaffolding.codeplex.com/workitem/64when using Scaffolding Controller &#60;xxx&#62; -Repository <br /><br />generated<br />public void InsertOrUpdate&#40;Entity entity&#41;<br /><br />has error <br />Cannot implicitly convert type &#39;System.Data.EntityState&#39; to &#39;System.Data.Entity.EntityState&#39;.<br />at line <br />context.Entry&#40;entity&#41;.State &#61; EntityState.Modified&#59;<br /><br /><br />tabdurmanWed, 04 Jun 2014 14:43:44 GMTCreated Unassigned: Cannot implicitly convert type 'System.Data.EntityState' to 'System.Data.Entity.EntityState'. [64] 20140604024344PNew Post: Where is the data stored?http://mvcscaffolding.codeplex.com/discussions/247997<div style="line-height: normal;">Add a constructor to your generated DbContext class<br />
<pre><code> public class RLSBCWebSiteContext : DbContext
{
public RLSBCWebSiteContext()
{
this.Database.Connection.ConnectionString = WebConfigurationManager.ConnectionStrings[&quot;RLSBCWebSite&quot;].ConnectionString;
}
</code></pre>
Add to web.config<br />
<pre><code> &lt;connectionStrings&gt;
&lt;add name=&quot;RLSBCWebSite&quot; connectionString=&quot;Data Source=.\SQLEXPRESS;Initial Catalog=RLSBCWebSite.Models.RLSBCWebSiteContext;Integrated Security=True;&quot; providerName=&quot;System.Data.SqlClient&quot; /&gt;
&lt;/connectionStrings&gt;
&lt;/configuration&gt;</code></pre>
</div>rasorWed, 04 Jun 2014 10:45:26 GMTNew Post: Where is the data stored? 20140604104526ANew Post: Scaffolding fails "Cannot find primary key..." - EF 4.2 Model First or DB Firsthttp://mvcscaffolding.codeplex.com/discussions/284993<div style="line-height: normal;">Thanks guys!<br />
These posts were useful to me<br />
To add to VeXHarbinger's temporary solution to make it just a little more supportable...<br />
<br />
I used a partial class of the same entity name adding a property with an &quot;Id&quot; in the name with the [Key] data annotation. The get and set of this new property just pulled/set the real primary key column from the generated class. Using a partial class in a separate folder got around EF code wiping out my changes.<br />
<br />
Again... yes yes, not totally graceful, but until a better solution comes along.<br />
</div>ericleerinnSun, 18 May 2014 15:54:37 GMTNew Post: Scaffolding fails "Cannot find primary key..." - EF 4.2 Model First or DB First 20140518035437PCreated Unassigned: MVC 5 - EF 6.1 Scaffolding fails when inheriting from IdentityDbContext and IdentityUser [63]http://mvcscaffolding.codeplex.com/workitem/63I have created a &#91;question on stackoverflow&#93;&#40;http&#58;&#47;&#47;stackoverflow.com&#47;questions&#47;22726246&#47;mvc-5-ef-6-1-scaffolding-fails-when-inheriting-from-identitydbcontext-and-iden&#41;<br /><br />Can you check this issue &#63;<br /><br />Thanks<br />mRpHoEniXSat, 29 Mar 2014 05:12:09 GMTCreated Unassigned: MVC 5 - EF 6.1 Scaffolding fails when inheriting from IdentityDbContext and IdentityUser [63] 20140329051209ACommented Issue: Empty Views for EF Entity with Complex Type [19]http://mvcscaffolding.codeplex.com/workitem/19i have an Entity with a Complex Type &#34;Address&#34; , the generated views includes all the properties of the entity Except for the Complex Type &#34;Address&#34;.<br /><br />what changes i have to make in the template to fix this .<br /><br />Comments: I have the same problem too.KSaeediTue, 04 Mar 2014 15:00:39 GMTCommented Issue: Empty Views for EF Entity with Complex Type [19] 20140304030039PCommented Unassigned: assembly directive requires full path to project assemblies [61]http://mvcscaffolding.codeplex.com/workitem/61I&#39;m trying to reference a solution generated assembly from a T4 template that I&#39;m invoking from the Package Manager Console using the pattern of .ps1 and .cs.t4 template files created by &#34;scaffold customscaffolder&#34;.<br /><br />If I add an assembly reference like this&#58;<br /><br /> &#60;&#35;&#64; assembly name&#61;&#34;C&#58;&#92;full&#92;path&#92;to&#92;solution&#92;project&#92;bin&#92;foobar.dll&#34; &#35;&#62;<br /><br />it works. But that won&#39;t work for anyone else...<br /><br />If I attempt this&#58;<br /><br /> &#60;&#35;&#64; assembly name&#61;&#34;&#36;&#40;ProjectDir&#41;bin&#92;foobar.dll&#34; &#35;&#62;<br /><br />it fails to find the assembly. &#40;Yes the assembly is in the bin subfolder of the project selected as the &#34;Default Project&#34; for the Package Manager Console.<br /><br />I recognize this may be a T4Scaffolding package issue. Or just me being clueless.<br />Any help in understanding how best to do this would be appreciated.<br /><br />Comments: The short answer is&#58;&#10;&#10; &#60;&#35;&#64; assembly name&#61;&#34;foobar&#34; &#35;&#62;&#10;&#10;Will work for any assembly referenced by your project. Do NOT add a &#34;.dll&#34; to the end.&#10;&#10;The longer answer is&#58;&#10;&#10;The T4Scaffolding &#34;scaffold&#34; command uses its own DynamicTextTemplatingEngineHost to process the template. This host doesn&#39;t provide access to the Visual Solution macros. Instead, it implements its own ResolveAssemblyReference method which among other things looks through a list of &#34;FindableAssemblies&#34; which it initializes by enumerating the assemblies referenced by your project.&#10;&#10;The key is that an &#34;assembly&#34; directive will match this list only if the assembly FullName &#40;includes path&#41; or Name &#40;no path, no extension&#41; match.TonesNotesFri, 21 Feb 2014 15:53:52 GMTCommented Unassigned: assembly directive requires full path to project assemblies [61] 20140221035352PCommented Unassigned: Accessing Connection Strings From T4 Template [62]http://mvcscaffolding.codeplex.com/workitem/62My template creates an instance of the DBContext used by the default project to customize the template output based on the data in the database, not the schema of the database.<br /><br />To create the instance my template file needs access to the connection string.<br /><br />Question&#58; Short of hard coding the connection string into the t4 template file, what&#39;s the best way of providing it from an external config file&#63;<br /><br />Ideally it would be coming from the Package Manager Console&#39;s Default Project&#39;s config file.<br />Comments: Punted and went for parsing the config file manually.&#10;Added the following method to a t4 include file&#58;&#10;&#10; &#60;&#35;&#43;&#10; string GetConnectionString&#40;string configFile&#41; &#123;&#10; &#9;var doc &#61; new System.Xml.XmlDocument&#40;&#41;&#59;&#10; &#9;doc.Load&#40;configFile&#41;&#59;&#10; &#9;var node &#61; doc.SelectSingleNode&#40;&#34;&#47;configuration&#47;connectionStrings&#47;add&#91;&#64;name&#61;&#39;MyEntities&#39;&#93;&#34;&#41;&#59;&#10; return node.Attributes&#91;&#34;connectionString&#34;&#93;.Value&#59;&#10; &#125;&#10; &#35;&#62;TonesNotesFri, 21 Feb 2014 15:18:29 GMTCommented Unassigned: Accessing Connection Strings From T4 Template [62] 20140221031829PCreated Unassigned: Accessing Connection Strings From T4 Template [62]http://mvcscaffolding.codeplex.com/workitem/62My template creates an instance of the DBContext used by the default project to customize the template output based on the data in the database, not the schema of the database.<br /><br />To create the instance my template file needs access to the connection string.<br /><br />Question&#58; Short of hard coding the connection string into the t4 template file, what&#39;s the best way of providing it from an external config file&#63;<br /><br />Ideally it would be coming from the Package Manager Console&#39;s Default Project&#39;s config file.<br />TonesNotesFri, 21 Feb 2014 05:03:38 GMTCreated Unassigned: Accessing Connection Strings From T4 Template [62] 20140221050338ACreated Unassigned: assembly directive requires full path to project assemblies [61]http://mvcscaffolding.codeplex.com/workitem/61I&#39;m trying to reference a solution generated assembly from a T4 template that I&#39;m invoking from the Package Manager Console using the pattern of .ps1 and .cs.t4 template files created by &#34;scaffold customscaffolder&#34;.<br /><br />If I add an assembly reference like this&#58;<br /><br /> &#60;&#35;&#64; assembly name&#61;&#34;C&#58;&#92;full&#92;path&#92;to&#92;solution&#92;project&#92;bin&#92;foobar.dll&#34; &#35;&#62;<br /><br />it works. But that won&#39;t work for anyone else...<br /><br />If I attempt this&#58;<br /><br /> &#60;&#35;&#64; assembly name&#61;&#34;&#36;&#40;ProjectDir&#41;bin&#92;foobar.dll&#34; &#35;&#62;<br /><br />it fails to find the assembly. &#40;Yes the assembly is in the bin subfolder of the project selected as the &#34;Default Project&#34; for the Package Manager Console.<br /><br />I recognize this may be a T4Scaffolding package issue. Or just me being clueless.<br />Any help in understanding how best to do this would be appreciated.<br /><br />TonesNotesFri, 21 Feb 2014 04:59:08 GMTCreated Unassigned: assembly directive requires full path to project assemblies [61] 20140221045908ACreated Unassigned: T4Scaffolding.Core.1.0.0 init.ps1 causes VS2012 to misbehave [60]http://mvcscaffolding.codeplex.com/workitem/60I&#39;ve attached a sample solution that reproduces the issue.<br />If you open that solution you will see that it has 3 projects and all projects have the T4Scaffolding.Core package.<br /><br />What I found is that once the init.ps1 script runs, the solution properties windows on the solution fails to open&#33;<br />&#33;&#91;Image&#93;&#40;http&#58;&#47;&#47;i42.tinypic.com&#47;ibgu8g.jpg&#41;<br />Here is the error&#58;<br />&#33;&#91;Image&#93;&#40;http&#58;&#47;&#47;i39.tinypic.com&#47;2wnwvvo.png&#41;<br /><br />The issue is caused by&#58;<br />&#96;&#96;&#96;<br />&#91;System.AppDomain&#93;&#58;&#58;CurrentDomain.SetShadowCopyFiles&#40;&#41;<br />&#96;&#96;&#96;<br />If I comment out that line, it works.<br />johnsimonsWed, 09 Oct 2013 23:53:22 GMTCreated Unassigned: T4Scaffolding.Core.1.0.0 init.ps1 causes VS2012 to misbehave [60] 20131009115322PNew Post: Scaffolding fails "Cannot find primary key..." - EF 4.2 Model First or DB Firsthttp://mvcscaffolding.codeplex.com/discussions/284993<div style="line-height: normal;">Has any answer been found for this, apart from adding the [Key] to the EF autogenerated file, or changing the name of the PK field to follow the expected convention, i.e. ID or &lt;Classname&gt;Id<br />
</div>steveculshawMon, 30 Sep 2013 09:21:55 GMTNew Post: Scaffolding fails "Cannot find primary key..." - EF 4.2 Model First or DB First 20130930092155ANew Post: Where is the branch of the version in nuget?http://mvcscaffolding.codeplex.com/discussions/459276<div style="line-height: normal;">I didn't find the branch that has whe MvcScaffolding.nuspec with the 1.0.9 version, which one is it?<br />
</div>luizfbicalhoWed, 25 Sep 2013 20:12:10 GMTNew Post: Where is the branch of the version in nuget? 20130925081210PNew Post: MvcScaffolding versus the built-in Visual Studio 2012 "MVC Scaffolding"http://mvcscaffolding.codeplex.com/discussions/457447<div style="line-height: normal;">Is the MvcScaffolding deprecated in favour of the built-in Visual Studio 2012 &quot;MVC Scaffolding&quot;?
<br />
<br />
And if not, what's the benefit of using it, rather than the built-in?<br />
</div>steveculshawThu, 19 Sep 2013 16:11:30 GMTNew Post: MvcScaffolding versus the built-in Visual Studio 2012 "MVC Scaffolding" 20130919041130PCommented Unassigned: Visual Studio Busy when generating template [59]http://mvcscaffolding.codeplex.com/workitem/59Hi, I found an issue with Visual Studio hanging when generating templates. Is anyone else having this issue&#63; It would take 2 minutes for a template with just Id and Name, and sometimes even that would fail. I would wait for 30 and 45 minutes for a template with just 10 properties and the scaffolding operation would just hang visual studio.<br /><br />I lost the last two days of my life to this issue, but I have the solution and I can post a pull request if others are also experiencing this issue. It ended up being an infinite recursion caused by circular class references being transversed within the plugin. The method name where the recursion issue exists is GetCodeTypesFromLocalCodeElements&#40;&#41;.<br /><br />Thanks&#33;<br /><br />Rob<br /><br />Comments: So, sounds like it could be the same issue. I would certainly like to see you post a pull request.&#10;&#10;Thanks for all of the work you did on tracking down this issue.&#10;&#10;BTW, do you know of any workaround&#63;sburdeauThu, 12 Sep 2013 14:10:34 GMTCommented Unassigned: Visual Studio Busy when generating template [59] 20130912021034PCommented Unassigned: Visual Studio Busy when generating template [59]http://mvcscaffolding.codeplex.com/workitem/59Hi, I found an issue with Visual Studio hanging when generating templates. Is anyone else having this issue&#63; It would take 2 minutes for a template with just Id and Name, and sometimes even that would fail. I would wait for 30 and 45 minutes for a template with just 10 properties and the scaffolding operation would just hang visual studio.<br /><br />I lost the last two days of my life to this issue, but I have the solution and I can post a pull request if others are also experiencing this issue. It ended up being an infinite recursion caused by circular class references being transversed within the plugin. The method name where the recursion issue exists is GetCodeTypesFromLocalCodeElements&#40;&#41;.<br /><br />Thanks&#33;<br /><br />Rob<br /><br />Comments: Yes, that is just what I experienced too. Hang, but no CPU usage.robwafleThu, 12 Sep 2013 12:43:04 GMTCommented Unassigned: Visual Studio Busy when generating template [59] 20130912124304PCommented Unassigned: Visual Studio Busy when generating template [59]http://mvcscaffolding.codeplex.com/workitem/59Hi, I found an issue with Visual Studio hanging when generating templates. Is anyone else having this issue&#63; It would take 2 minutes for a template with just Id and Name, and sometimes even that would fail. I would wait for 30 and 45 minutes for a template with just 10 properties and the scaffolding operation would just hang visual studio.<br /><br />I lost the last two days of my life to this issue, but I have the solution and I can post a pull request if others are also experiencing this issue. It ended up being an infinite recursion caused by circular class references being transversed within the plugin. The method name where the recursion issue exists is GetCodeTypesFromLocalCodeElements&#40;&#41;.<br /><br />Thanks&#33;<br /><br />Rob<br /><br />Comments: Rob,&#10;&#10;We have also seen problems with VS 2012 hanging when adding a new controller when the MvcScaffolding package is installed. We have some other packages of our own under development also installed and had initially assumed these were the culprit. However, just yesterday I saw the issue without our packages installed.&#10;&#10;Not sure if this is the same issue or not&#59; do you see processor usage with your issue&#63; We see what appears to be no processor usage, just a hang.sburdeauWed, 11 Sep 2013 11:23:53 GMTCommented Unassigned: Visual Studio Busy when generating template [59] 20130911112353ACreated Unassigned: Visual Studio Busy when generating template [59]http://mvcscaffolding.codeplex.com/workitem/59Hi, I found an issue with Visual Studio hanging when generating templates. Is anyone else having this issue&#63; It would take 2 minutes for a template with just Id and Name, and sometimes even that would fail. I would wait for 30 and 45 minutes for a template with just 10 properties and the scaffolding operation would just hang visual studio.<br /><br />I lost the last two days of my life to this issue, but I have the solution and I can post a pull request if others are also experiencing this issue. It ended up being an infinite recursion caused by circular class references being transversed within the plugin. The method name where the recursion issue exists is GetCodeTypesFromLocalCodeElements&#40;&#41;.<br /><br />Thanks&#33;<br /><br />Rob<br /><br />robwafleMon, 09 Sep 2013 15:50:19 GMTCreated Unassigned: Visual Studio Busy when generating template [59] 20130909035019PNew Post: Error reported by mvcscaffolding in MVC4 projecthttp://mvcscaffolding.codeplex.com/discussions/392089<div style="line-height: normal;">After debugging this for a while I found that some Project Types return a Blank path. You can filter these out by adding a filter before the EnumerateFiles call so that the blanks are taken out.<br />
<pre><code> | ?{$_}`</code></pre>
The function should then look like this:<br />
<pre><code>function CountSolutionFilesByExtension($extension) {
$files = (Get-Project).DTE.Solution`
| ?{ $_.FileName }`
| %{ [System.IO.Path]::GetDirectoryName($_.FileName) }`
| ?{$_}`
| %{ [System.IO.Directory]::EnumerateFiles($_, &quot;*.&quot; + $extension, [System.IO.SearchOption]::AllDirectories) }
($files | Measure-Object).Count
}</code></pre>
This works for any project types, including Wix Projects that seem to give issues for the Get-Project call.
<br />
This solution was still needed for the init.ps1 file in version 1.0.9.
<br />
Hope this helps someone.<br />
</div>coisSun, 01 Sep 2013 19:25:06 GMTNew Post: Error reported by mvcscaffolding in MVC4 project 20130901072506PSource code checked in, #411bd1c6d507http://mvcscaffolding.codeplex.com/SourceControl/changeset/411bd1c6d507New branch for 1.0.9 releaseshalterMon, 05 Aug 2013 19:03:10 GMTSource code checked in, #411bd1c6d507 20130805070310P