getting CS1056 Unexpected character '[]' error on .net core 2.0.3 web project - asp.net-core

When i build my .net core MVC web project i get this error 190 times :
CS1056 Unexpected character '[]' .
This problem is seen after a few builds. Any suggestions?

This is about a file in my temp folder which is on
users\[My User]\AppData\temp\.NETCoreApp,Version=v2.0.AssemblyAttributes.cs, when I delete this my project completely built.

If you're getting this error during publishing, you can alternatively resolve the issue by creating a new release profile.

Related

ASP.NET Core error on building with NSwag Error MSB3073

When I build the application, I get the following error message
The command "dotnet "C:\Users\Adminuser\.nuget\packages\nswag.msbuild\13.0.6\build\../tools/NetCore22/dotnet-nswag.dll" run /variables:Configuration=Debug" exited with code
-2147450730. Northwind.WebUI C:\Users\Adminuser\Documents\Visual Studio 2017\Projects\NorthwindTraders-master\Northwind.WebUI\Northwind.WebUI.csproj 60
Any Idea how to fix this issue?
Swagger doesn't like it when two or more endpoints in the same Controller share the same name. make use of routing attributes and make sure they are unique.
Try to install NSwagStudio then re open your visual studio.
That's should solve your problem.
If it's still not working
give a look about your output console when you try to compile your project, you should see something like this
1>Executing file 'nswag.json' with variables 'Configuration=Debug'...
1>Launcher directory:
C:\Users\Shadow.nuget\packages\nswag.msbuild\13.1.6\tools\NetCore30
You should have a file called dotnet-nswag.exe in your c:\user...\tools\netcore30 directory.
Put this exe in your environnement path.
Re open visual studio and your error should be gone.

Unable to build project output group 'Content Files from Web (Active)

I got below error in MS build.
WARNING: Could not find prerequisite 'Microsoft .NET Framework 4 (x86 and x64)' in path 'C:....\Microsoft SDKs\Windows\v7.0A\Bootstrapper\'
ERROR: Unable to build project output group 'Content Files from Web (Active)'
Any suggestions
Thanks
This error came up because my workspace wasn't upto date. I did get force (Get specific version) and rerun the build, it worked !! Posting it may helpful to somebody else.
In your project expand all the Folders and see if there are any files missing with yellow alert symbol.If you delete them,you can build your application as normally.

ASP.NET Mvc Project EF Code First Enable Migrations Error

I am working PluralSight Video Tutorials on ASP.NET MVC. And i couldn't enable migrations on package console..
when i wrote enable-migrations, i am receiving this error;
More than one context type was found in the assembly 'eManager.Web'.
To enable migrations for eManager.Web.Infrastructure.DepartmentDb, use Enable-Migrations -ContextTypeName eManager.Web.Infrastructure.DepartmentDb.
To enable migrations for eManager.Web.Models.UsersContext, use Enable-Migrations -ContextTypeName eManager.Web.Models.UsersContext.
when i wrote Enable-Migrations -ContextTypeName eManager.Web.Infrastructure.DepartmentDb., i am receiving this error;
The context type 'eManager.Web.Infrastructure.DepartmentDb.' was not found in the assembly 'eManager.Web'.
Thanks for your help.
I strongly suspect that your issue is similar to the one in this question:
How to Enable Migration to update my database in MVC4?
Check the selected answer and see if that helps with your issue.
The solution for the mentioned error "The context type .... was not found" is to select the correct project that holds the context type before running the enable-migration command. You can choose the correct project from the "default project" drop down at the top of Nuget manager tool window.
The solution to this problem is simple, just remove the dot (.) at the end of this statement "Enable-Migrations -ContextTypeName eManager.Web.Infrastructure.DepartmentDb." and run the package manager console again, the migration should be enabled.

breezejs: error when minifying the script

I'm facing an issue when minifying breezejs :
Error : Cannot get property « Validator » of a null reference
(that's not the exact message but a translation of the original.)
This is happening when I try to call breeze.Validator, meaning breeze is undefined.
Now, I rely on ASP.NET MVC bundling mechanism for minifying the file breeze.debug.js along with all the other scripts in my application.
However, if instead of using breeze.debug.js I use breeze.min.js (the one provided by Breeze team), then it works fine.
What could be the reason for this problem ?
I've solved the problem by ignoring the breeze.debug.js file when in release mode and by ignoring the breeze.min.js file when in debug mode:
bundles.IgnoreList.Ignore("*.debug.js", OptimizationMode.WhenEnabled);
bundles.IgnoreList.Ignore("*.min.js", OptimizationMode.WhenDisabled);
bundles.Add(new ScriptBundle("~/bundles/breeze").Include("~/scripts/libs/breeze/breeze.debug.js")
.Include("~/scripts/libs/breeze/breeze.min.js"));

Team Build sends error when trying to compile a Structuremap method

I'm getting a strange error when trying to compile a solution that is using StructureMap on Team Build.
When I try to compile the solution locally on Visual Studio it works fine, but when trying to queue a new build in Team Build I get the following error:
Overload resolution failed because no accessible 'Use' can be called with these arguments:
The line of code that gets this error is the second one:
ForSingletonOf(Of ISessionFactory)().Use(NHibernateSessionFactory.SessionFactory)
Me.For(Of ISession)().lifecycleIs(New HybridLifecycle()).Use(Function(x) x.GetInstance(Of ISessionFactory)().OpenSession())
It's a standard registration for the NHibernate session, so I don't really get why this error pops up.
Thanks in advance for the clues.
Make sure you have the correct version of NHibernate on the build server, and that your hint paths are all appropriately set in your project file. We haven't had this specific issue (as we're not using NHibernate), but we've had weird issues like that being related to version mismatches of "infrastructure" DLLs between local and build.