Build Errors with umbraco 7.4 visual studio 2013, - umbraco7

I am new to Umbraco. I am trying to build the website using it. Due to some issues i deleted the Umbraco project that i have created. I had back up so i copy and pasted it in visual studio project folder and tried to run. Before execution it show build error which are out of my knowledge.
The type 'Umbraco.Web.PublishedContentModels.Home' already contains a definition for
'ModelTypeAlias' C:\Users\dell\Documents\Visual Studio
2013\Projects\MyUmbracoApp\MyUmbracoApp\MyUmbracoApp\App_Data\Models\models.generated.cs 30 27 MyUmbracoApp
Error 5 The type 'Umbraco.Web.PublishedContentModels.Home' already contains a definition for
'ModelItemType' C:\Users\dell\Documents\Visual Studio
2013\Projects\MyUmbracoApp\MyUmbracoApp\MyUmbracoApp\App_Data\Models\models.generated.cs 31 38 MyUmbracoApp
Error 6 Type 'Umbraco.Web.PublishedContentModels.Home' already defines a member called 'Home' with the same parameter
types C:\Users\dell\Documents\Visual Studio
2013\Projects\MyUmbracoApp\MyUmbracoApp\M
Error 7 Type 'Umbraco.Web.PublishedContentModels.Home' already defines a member called 'GetModelContentType' with the same parameter
types C:\Users\dell\Documents\Visual Studio
2013\Projects\MyUmbracoApp\MyUmbracoApp\MyUmbracoApp\App_Data\Models\models.generated.cs 39 42 MyUmbracoApp
Error 8 Type 'Umbraco.Web.PublishedContentModels.Home' already defines a member called 'GetModelPropertyType' with the same parameter
types C:\Users\dell\Documents\Visual Studio
2013\Projects\MyUmbracoApp\MyUmbracoApp\MyUmbracoApp\App_Data\Models\models.generated.cs 45 39 MyUmbracoApp
Error 9 The type 'Umbraco.Web.PublishedContentModels.Home' already contains a definition for 'BodyText' C:\Users\dell\Documents\Visual
Studio
2013\Projects\MyUmbracoApp\MyUmbracoApp\MyUmbracoApp\App_Data\Models\models.generated.cs 54 22 MyUmbracoApp
Error 10 The type 'Umbraco.Web.PublishedContentModels.Home' already contains a definition for
'CarouselImages' C:\Users\dell\Documents\Visual Studio
2013\Projects\MyUmbracoApp\MyUmbracoApp\MyUmbracoApp\App_Data\Models\models.generated.cs 63 17 MyUmbracoApp
Error 11 The type 'Umbraco.Web.PublishedContentModels.Home' already contains a definition for
'FooterText' C:\Users\dell\Documents\Visual Studio
2013\Projects\MyUmbracoApp\MyUmbracoApp\MyUmbracoApp\App_Data\Models\models.generated.cs 72 17 MyUmbracoApp
Error 12 The type 'Umbraco.Web.PublishedContentModels.Home' already contains a definition for
'PageTitle' C:\Users\dell\Documents\Visual Studio
2013\Projects\MyUmbracoApp\MyUmbracoApp\MyUmbracoApp\App_Data\Models\models.generated.cs 81 17 MyUmbracoApp
Error 13 The type 'Umbraco.Web.PublishedContentModels.Glimpses' already contains a definition for
'ModelTypeAlias' C:\Users\dell\Documents\Visual Studio
2013\Projects\MyUmbracoApp\MyUmbracoApp\MyUmbracoApp\App_Data\Models\models.generated.cs 92 27 MyUmbracoApp
Error 14 The type 'Umbraco.Web.PublishedContentModels.Glimpses' already contains a definition for 'ModelItemType'

In your project you have a folder called App_Data. In this folder you will find a Models folder which contains all the generated .cs class files of your Umbraco project.
You can delete this folder and then rebuild the application. During the rebuild your class files will be re-generated and placed in the App_Data/Models folder.

Delete didn't work for me and created different errors.
What worked for me was when I excluded the App_Data\Models folder from the project (and previously had to change the App_Data folder properties from readonly).
The project rebuilt immediately.

Related

visual studio 2022 17.4.3 Fake Error in razor (blazor) page

in visual studio 2022 in blazor project i have fake error in all element bind
my project build and run and publish successfully ... but this error existed everywhere ...
how i fix it ?
Error :
Severity Code Description Project File Line Suppression State
Error (active) RZ9989 The attribute '#bind' was matched by multiple bind attributes. Duplicates:
Microsoft.AspNetCore.Components.Web.BindAttributes
Microsoft.AspNetCore.Components.Web.BindAttributes \Pages\CacheManagementPaymentSystems\ReportDaily.razor 84
in visual studio 17.4.4 the problem fixed

Microsoft.Office.Core is defined in an assembly that is not referenced. You must add a reference to assembly office, Version=15.0.0.0

I'm using Visual Studio 2022. I have created a .net 6 project.
I added the COM references: Microsoft Excel 16 Object Library (Microsoft.Office.Interop.Excel) and Microsoft Office 16 Object Library (Microsoft.Office.Core).
The following lines of Excel interop code threw an error at SetElement(), could not build:
Chart c = (Chart)wbSheets.Application.Workbooks[1].Charts.Add();
chart.SetElement(Microsoft.Office.Core.MsoChartElementType.msoElementChartTitleAboveChart);
Microsoft.Office.Core... is defined in an assembly that is not referenced. You must add a reference to assembly office, Version=15.0.0.0, ..., PublicKeyToken=71e9bce111e9429c
A very strange error, that an Office 16 (Office 2016) libary needs references to Office 15 (Office 2013).
The exact same steps for COM referencing and c# code works perfectly in .NET 4.8 Framework. So the problem is specific to .NET 6 (possibly .NET 5 and all previous .NET Core versions).
Using a nuget command Install-Package MicrosoftOfficeCore -Version 15.0.0 to install the reference and manually removing the previous v16 reference, did resolve the code building error. But now the dependency had a yellow triangle warning, that the dependency is for .NET 4.6-4.8 Framework and might be incompatible with .NET 6.
Despite this, the code seemed to work and the Excel file was generated.
But I'll post a better fix in the answer.
The better fix is to go to:
Solution Explorer > project > Dependencies > COM > select Microsoft.Office.Core > properties pane.
The last property is Wrapper Tool, with a default value of tlbimp
Type in primary for the value, click somewhere else to update the field and the problem is solved. No nuget package required.
Found this obscure solution from here (bottom most post):
https://github.com/dotnet/project-system/issues/5735

Visual Studio 2017 cannot create or open .shproj (shared Project) files

I have recently upgraded to Visual Studio 2017 version 15.6.3. After doing so (and fixing a bunch of other issues), I can no longer open or create .shproj files.
My existing projects say (load failed) next to each shared project file, and I have the following in my output window whenever I try reloading the project:
C:\File\Path\Project.Shared.shproj : error : Expected 1 export(s) with contract name "Microsoft.VisualStudio.ProjectSystem.VS.Implementation.Package.ProjectFactory+ProjectLoadHelper" but found 0 after applying applicable constraints.
Similarly if I try to create a new shared project, I get the same message in a popup:
Microsoft Visual Studio
Expected 1 export(s) with contract name Microsoft.VisualStudio.ProjectSystem.VS.Implementation.Package.ProjectFactory+ProjectLoadHelper" but found 0 after applying applicable constraints.
Why is Visual Studio not allowing me to load or create .shproj files and how can I solve it?
I deleted the entire folder at UserName\AppData\Local\Microsoft\VisualStudio (idea from https://developercommunity.visualstudio.com/content/problem/190581/1560-preview-3-breaks-azure-functions-projects.html) and now my .sproj files load.

LNK2038: mismatch detected for '_MSC_VER': value '1600' doesn't match value '1700' in Maineng.obj

We are trying to open a c++ project which was built on VS 2010 and Object ARX 2014 in VS 2012 but getting below errors :
LNK2038: mismatch detected for '_MSC_VER': value '1600' doesn't match value '1700' in Maineng.obj in rxapi.lib
Could anybody let us know the solution for this error. The Include Path is correctly set to VC++ 2012 installation directory. We have VS 2012 Update 4

VS 2013: cannot add PCL NuGet package to compatible project due to dnxcore50 dependency

I have VS 2013 and VS 2015 installed on my system.
With VS 2013, I am currently developing a Profile 111 PCL project. The PCL target dialog looks like this:
I am trying to add a NuGet package (MetroLog), which contains dedicated assemblies for a number of platforms, and a Profile 259 PCL assembly, portable-net45+wp8+win81+wpa81.
Since Profile 111 targets a subset of Profile 259, it should be possible to install this NuGet package in my Profile 111 project. However, it does not! This is the error message I get instead:
So, the NuGet installer thus expects that the portable assembly in the NuGet package also target dnxcore50!
If I look in the list of supported frameworks for Profile 111 (C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETPortable\v4.5\Profile\Profile111\SupportedFrameworks), the target corresponding to dnxcore50, ASP.NET Core 5.0 is indeed included (which I suppose is a consequence of a recent update of VS 2015?).
However, why is this affecting my ability to reference the PCL Profile 259 library from NuGet in my Profile 111 project?
And, is there anything I can do to override this behavior of the NuGet installation, other than manually removing the ASP.NET Core 5.0.xml file from the Profile 111 supported frameworks folder?
NOTE 1 The library specification for the portable assembly in the MetroLog package (version 0.8.9) is actually incorrect. It states that win81 is targeted, but it should really state win or win8 or netcore45. However, I have modified the .nupkg file locally but a change to a correct Windows 8 specification is not enough to make the NuGet accessible.
NOTE 2 When attempting the same task in VS 2015, ASP.NET Core 5.0 is displayed in the PCL target setup, and when selecting the other targets associated with Profile 111, the Change Targets dialog informs that ASP.NET Core 5.0 will be automatically added to the list of supported targets. When trying to install the MetroLog NuGet package, the error message is instead that MetroLog does not contain any profile compatible with PCL Profile 111. Different paths, same end result...
UPDATE With VS 2015, I have found that the only issue is the invalid win81 specification in the portable folder path. Is this is changed to a valid PCL Profile 111 target, i.e. win8 (or the equivalents win or netcore45), I am allowed to use the NuGet package in my Profile 259 project. In VS 2015, the NuGet component sufficiently identifies the PCL profile as long as the sub-components are correctly specified, regardless of whether dnxcore50 is listed or not.

Resources